mirror of
https://github.com/urbit/shrub.git
synced 2024-12-21 09:51:36 +03:00
4815215eb9
This reverts commit ab7a1bf564
.
43 lines
991 B
Plaintext
43 lines
991 B
Plaintext
1 Structures
|
|
|
|
A noun is an atom or a cell. An atom is any natural number.
|
|
A cell is any ordered pair of nouns.
|
|
|
|
2 Pseudocode
|
|
|
|
[a b c] [a [b c]]
|
|
nock(a) *a
|
|
|
|
?[a b] 0
|
|
?a 1
|
|
^a 1 + a
|
|
=[a a] 0
|
|
=[a b] 1
|
|
|
|
/[1 a] a
|
|
/[2 a b] a
|
|
/[3 a b] b
|
|
/[(a + a) b] /[2 /[a b]]
|
|
/[(a + a + 1) b] /[3 /[a b]]
|
|
|
|
*[a [b c] d] [*[a b c] *[a d]]
|
|
|
|
*[a 0 b] /[b a]
|
|
*[a 1 b] b
|
|
*[a 2 b c] *[*[a b] *[a c]]
|
|
*[a 3 b] ?*[a b]
|
|
*[a 4 b] ^*[a b]
|
|
*[a 5 b] =*[a b]
|
|
|
|
*[a 6 b c d] *[a 2 [0 1] 2 [1 c d] [1 0] 2 [1 2 3] [1 0] 4 4 b]
|
|
*[a 7 b c] *[a 2 b 1 c]
|
|
*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
|
|
*[a 9 b c] *[a 7 c 0 b]
|
|
*[a 10 b c] *[a c]
|
|
*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
|
|
|
|
^[a b] ^[a b]
|
|
=a =a
|
|
/a /a
|
|
*a *a
|