diff --git a/tests/basics-binary-scott/solution.txt b/tests/basics-binary-scott/solution.txt index c8d4222..3c18042 100644 --- a/tests/basics-binary-scott/solution.txt +++ b/tests/basics-binary-scott/solution.txt @@ -17,28 +17,28 @@ Z = \ f . ( \ x . f \ y . x x y ) ( \ x . f \ y . x x y ) #import Boolean.lc -False = \ f t . f -True = \ f t . t +False = \ f _t . f +True = \ _f t . t -not = \ p . p True False +not = \ p . \ f t . p t f and = \ p . p p or = \ p q . p q p xor = \ p q . p q (not q) -implies = \ p . p (True) +implies = \ p . p True #import Ordering.lc -LT = \ lt eq gt . lt -EQ = \ lt eq gt . eq -GT = \ lt eq gt . gt +LT = \ lt _eq _gt . lt +EQ = \ _lt eq _gt . eq +GT = \ _lt _eq gt . gt #import Pair.lc Pair = \ x y fn . fn x y -fst = \ xy . xy \ x _ . x -snd = \ xy . xy \ _ y . y +fst = \ xy . xy \ x _y . x +snd = \ xy . xy \ _x y . y first = \ fn xy . xy \ x . Pair (fn x) second = \ fn xy . xy \ x y . Pair x (fn y) @@ -48,11 +48,11 @@ curry = \ fn xy . xy fn # data Number = End | Even Number | Odd Number -zero = \ end even odd . end +zero = \ end _even _odd . end -shiftR0 = \ n . \ end even odd . even n # mind that a shiftR in LE is a multiplication -shiftR1 = \ n . \ end even odd . odd n # mind that a shiftR in LE is a multiplication -shiftL = \ n . n n I I # mind that a shiftL in LE is a division +shiftR0 = \ n . \ _end even _odd . even n # mind that a shiftR in LE is a multiplication +shiftR1 = \ n . \ _end _even odd . odd n # mind that a shiftR in LE is a multiplication +shiftL = \ n . n n I I # mind that a shiftL in LE is a division isStrictZero = \ n . n True (K False) (K False) # disallow padding zeroes # O(1) isZero = \ n . n True isZero (K False) # allow padding zeroes # amortised O(2), so don't worry too much diff --git a/tests/is-prime-scott/solution.txt b/tests/is-prime-scott/solution.txt index de9ee6d..f4666a8 100644 --- a/tests/is-prime-scott/solution.txt +++ b/tests/is-prime-scott/solution.txt @@ -4,9 +4,9 @@ B = \ f g x . f (g x) I = \ x . x K = \ x _ . x Y = \ f . ( \ x . f (x x) ) ( \ x . f (x x) ) -True = \ t f . t -False = \ t f . f -Succ = \ n z s . s n +True = \ t _f . t +False = \ _t f . f +Succ = \ n _z s . s n Pred = \ n . n 0 I Plus = \ m n . m n (B Succ (Plus n)) Minus = \ m n . m 0 (B (n m) Minus) diff --git a/tests/is-prime/solution.txt b/tests/is-prime/solution.txt index ac3fdc5..49de4fb 100644 --- a/tests/is-prime/solution.txt +++ b/tests/is-prime/solution.txt @@ -1,8 +1,8 @@ # JohanWiltink Y = \ f . ( \ x . f (x x) ) ( \ x . f (x x) ) -True = \ t f . t -False = \ t f . f +True = \ t _f . t +False = \ _t f . f Succ = \ n s z . s (n s z) Pred = \ n s z . n ( \ f g . g (f s) ) (\_.z) \x.x Minus = \ m n . n Pred m diff --git a/tests/prime-sieve/solution.txt b/tests/prime-sieve/solution.txt index a01ffe2..af8f4fb 100644 --- a/tests/prime-sieve/solution.txt +++ b/tests/prime-sieve/solution.txt @@ -20,23 +20,23 @@ Z = \ f . ( \ x . f \ y . x x y ) ( \ x . f \ y . x x y ) #import Ordering.lc -LT = \ lt eq gt . lt -EQ = \ lt eq gt . eq -GT = \ lt eq gt . gt +LT = \ lt _eq _gt . lt +EQ = \ _lt eq _gt . eq +GT = \ _lt _eq gt . gt # import Booleans.lc -False = \ false true . false -True = \ false true . true +False = \ false _true . false +True = \ _false true . true # data Number = End | Even Number | Odd Number # zero :: Int -zero = \ end even odd . end +zero = \ end _even _odd . end # shiftR0,shiftR1 :: Int -> Int -shiftR0 = \ n . \ end even odd . even n # mind that a shiftR in LE is a multiplication -shiftR1 = \ n . \ end even odd . odd n # mind that a shiftR in LE is a multiplication +shiftR0 = \ n . \ _end even _odd . even n # mind that a shiftR in LE is a multiplication +shiftR1 = \ n . \ _end _even odd . odd n # mind that a shiftR in LE is a multiplication # isZero :: Int -> Bool isZero = \ n . n True (K False) (K False) @@ -84,10 +84,10 @@ minus = \ m n . gt m n zero (unpad (unsafeMinus m n)) # needs explicit unpad or pair = \ x y . \ pair . pair x y # fst :: Pair a b -> a -fst = \ xy . xy ( \ x y . x ) +fst = \ xy . xy ( \ x _y . x ) # snd :: Pair a b -> b -snd = \ xy . xy ( \ x y . y ) +snd = \ xy . xy ( \ _x y . y ) # data Stream a :: Cons a (Stream a) @@ -95,10 +95,10 @@ snd = \ xy . xy ( \ x y . y ) cons = \ x xs . \ cons . cons x xs # head :: Stream a -> a -head = \ xs . xs ( \ x xs . x ) +head = \ xs . xs ( \ x _xs . x ) # tail :: Stream a -> Stream a -tail = \ xs . xs ( \ x xs . xs ) +tail = \ xs . xs ( \ _x xs . xs ) # map :: (a -> b) -> Stream a -> Stream b map = \ fn xs . xs ( \ x xs . cons (fn x) (map fn xs) ) @@ -112,10 +112,10 @@ le = \ m n . compare (head m) (head n) True True False # data Set a = Nil | Branch a (Set a) (Set a) # empty :: Set a -empty = \ nil branch . nil +empty = \ nil _branch . nil # branch :: a -> Set a -> Set a -> Set a -branch = \ x left right . \ nil branch . branch x left right +branch = \ x left right . \ _nil branch . branch x left right # insert :: (Ord a) => a -> Set a -> Set a insert = \ x set . @@ -129,7 +129,7 @@ insert = \ x set . # findMin :: (Partial) => Set a -> a findMin = \ set . set () - \ x left right . + \ x left _right . left x ( \ _ _ _ . findMin left ) # minView :: (Partial) => Set a -> (a,Set a)