File tree 1 file changed +39
-10
lines changed
1 file changed +39
-10
lines changed Original file line number Diff line number Diff line change
1
+ /** Style conventions
2
+ * -----------------
3
+ *
4
+ * t ::=
5
+ * - x
6
+ * // Variable
7
+ * - (x. t)
8
+ * // Abstraction
9
+ * - (t t)
10
+ * // Application
11
+ */
12
+
13
+
1
14
// Combinators
2
- $ID: (x.x)
3
- $OMEGA: ((x.xx) (x.xx))
15
+ ID: (x. x)
16
+ CLONE: (x. x x)
17
+ FORK-BOMB: (CLONE CLONE CLONE)
18
+
19
+
20
+ // Algebraic data structures
21
+ N-TUPLE: (x. ID x)
22
+
23
+ 0-TUPLE: UNIT: ID
24
+ 1-TUPLE: (N-TUPLE 0-TUPLE)
25
+ 2-TUPLE: (N-TUPLE 1-TUPLE)
26
+ 3-TUPLE: (N-TUPLE 2-TUPLE)
4
27
5
- // Boolean values
6
- $TRUE: (t.f.t)
7
- $FALSE: (t.$ID)
8
28
9
- // Logical operators
10
- $AND: (b1.b2.(b1 b2 $FALSE))
11
- $OR: (b1.b2.(b1 $TRUE b2))
12
- $NOT: (b.(b $FALSE $TRUE))
13
- $XOR: (b1.b2.(b1 ($NOT b2) b2))
29
+ // Boolean logic
30
+ TRUE: (xy. x)
31
+ FALSE: (xy. y)
32
+
33
+ BOOL-NOT: (p. p FALSE TRUE)
34
+ BOOL-AND: (pq. p q FALSE)
35
+ BOOL-OR: (pq. p TRUE q)
36
+ BOOL-XOR: (pq. p (NOT q) q)
37
+
38
+
39
+ // While
40
+ FIXED-POINT-COMBINATOR: (f. (x. f (y. x x y)) (x. f (y. x x y)))
14
41
15
42
// Church numerals
16
43
$ZERO: $FALSE
44
+ $SUCCESSOR: (nsz. s (n s z))
45
+
You can’t perform that action at this time.
0 commit comments