File: digit.curry

package info (click to toggle)
curry-tools 1.0.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,492 kB
  • ctags: 121
  • sloc: makefile: 470; sh: 421
file content (20 lines) | stat: -rw-r--r-- 384 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

digit :: Int -> Success

digit 0 = success
digit 1 = success
digit 2 = success
digit 3 = success
digit 4 = success
digit 5 = success
digit 6 = success
digit 7 = success
digit 8 = success
digit 9 = success

-- goals: arithmetic functions as passive constraints:
goal x y =  x + x =:= y & x * x =:= y & digit x

goal1 x y = PEVAL (goal x y)

main = goal1 x y &> (x, y) where x, y free