tweaked arithmetic
authorJim Pryor <profjim@jimpryor.net>
Thu, 30 Sep 2010 18:28:25 +0000 (14:28 -0400)
committerJim Pryor <profjim@jimpryor.net>
Thu, 30 Sep 2010 18:28:25 +0000 (14:28 -0400)
Signed-off-by: Jim Pryor <profjim@jimpryor.net>
arithmetic.mdwn

index f7406cc..cac56f2 100644 (file)
@@ -198,7 +198,7 @@ Here are a bunch of pre-tested operations for the untyped lambda calculus. In so
                ))  in
 
 
-       ; Curry's fixed point combinator
+       ; Rosenbloom's fixed point combinator
        let Y = \f. (\h. f (h h)) (\h. f (h h)) in
        ; Turing's fixed point combinator
        let Z = (\u f. f (u u f)) (\u f. f (u u f))  in
@@ -239,3 +239,23 @@ Here are a bunch of pre-tested operations for the untyped lambda calculus. In so
                        ; and consume is
                        (\p. p get_2nd p)  in ; or
 -->
+
+<!--
+       gcd
+       pow_mod
+
+
+       show Oleg's definition of integers:
+               church_to_int = \n sign. n
+               church_to_negint = \n sign s z. sign (n s z)
+
+               ; int_to_church
+               abs = \int. int I
+
+               sign_case = \int ifpos ifzero ifneg. int (K ifneg) (K ifpos) ifzero
+
+               negate_int = \int. sign_case int (church_to_negint (abs int)) zero (church_to_int (abs int))
+
+       for more, see http://okmij.org/ftp/Computation/lambda-arithm-neg.scm
+
+-->