diff options
author | Marvin Borner | 2024-05-30 17:20:15 +0200 |
---|---|---|
committer | Marvin Borner | 2024-05-30 17:20:15 +0200 |
commit | 281e998f734b5542808d62db5aba71901a34ec7a (patch) | |
tree | f48b4ccab3d38f857aa3ea75da42d254e9812e84 /std.gpn | |
parent | b12de0cdea4f1c919a850603ab2fcdffee5e7f03 (diff) |
Some progress
Diffstat (limited to 'std.gpn')
-rw-r--r-- | std.gpn | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -1 +1,34 @@ -\x.x +// Combinators +ID = \x.x +K = \x.\y.x +KI = \x.\y.y +Y = \f.(\x.(f (x x)) \x.(f (x x))) + +// Boolean Logic +TRUE = K +FALSE = KI +NOT = \x.((x FALSE) TRUE) +AND = \f.\x.((x f) x) +OR = \x.(x x) +NAND = \f.\x.((((f x) f) FALSE) TRUE) +NOR = \f.\x.((((f f) x) FALSE) TRUE) +XOR = \f.\x.((x ((f FALSE) x)) f) +XNOR = \f.\x.((x f) ((f x) TRUE)) + +// Church Numerals +INC = \n.\f.\x.(f ((n f) x)) +0 = \s.\z.z +1 = (INC 0) +2 = (INC 1) +3 = (INC 2) +4 = (2 2) +5 = (INC 4) +6 = (INC 5) +7 = (INC 6) +8 = (3 2) +9 = (INC 8) +ZERO = \x.((x \f.FALSE) TRUE) +PRED = \n.\f.\x.(((n \a.\b.(b (a f))) \u.x) \i.i) +ADD = \a.\b.\f.\x.((a f) ((b f) x)) +MUL = \a.\b.\f.(a (b f)) +POW = \a.\b.(a b) |