mirror of
https://github.com/urbit/shrub.git
synced 2024-11-27 18:34:48 +03:00
8. updates nock 4K spec
This commit is contained in:
parent
7507de1e6c
commit
898beb2931
@ -1,5 +1,7 @@
|
|||||||
A noun is an atom or a cell. An atom is a natural number. A cell is an ordered pair of nouns.
|
A noun is an atom or a cell. An atom is a natural number. A cell is an ordered pair of nouns.
|
||||||
|
|
||||||
|
Reduce by the first matching pattern; variables match any noun.
|
||||||
|
|
||||||
nock(a) *a
|
nock(a) *a
|
||||||
[a b c] [a [b c]]
|
[a b c] [a [b c]]
|
||||||
|
|
||||||
@ -9,7 +11,6 @@ nock(a) *a
|
|||||||
+a 1 + a
|
+a 1 + a
|
||||||
=[a a] 0
|
=[a a] 0
|
||||||
=[a b] 1
|
=[a b] 1
|
||||||
=a =a
|
|
||||||
|
|
||||||
/[1 a] a
|
/[1 a] a
|
||||||
/[2 a b] a
|
/[2 a b] a
|
||||||
@ -30,15 +31,15 @@ nock(a) *a
|
|||||||
*[a 2 b c] *[*[a b] *[a c]]
|
*[a 2 b c] *[*[a b] *[a c]]
|
||||||
*[a 3 b] ?*[a b]
|
*[a 3 b] ?*[a b]
|
||||||
*[a 4 b] +*[a b]
|
*[a 4 b] +*[a b]
|
||||||
*[a 5 b] =*[a b]
|
*[a 5 b c] =[*[a b] *[a c]]
|
||||||
|
|
||||||
*[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 6 b c d] *[a *[[c d] 0 *[[2 3] 0 *[a 4 4 b]]]]
|
||||||
*[a 7 b c] *[a 2 b 1 c]
|
*[a 7 b c] *[*[a b] c]
|
||||||
*[a 8 b c] *[a 7 [[7 [0 1] b] 0 1] c]
|
*[a 8 b c] *[[*[a b] a] c]
|
||||||
*[a 9 b c] *[a 7 c 2 [0 1] 0 b]
|
*[a 9 b c] *[*[a c] 2 [0 1] 0 b]
|
||||||
*[a 10 [b c] d] *[a 8 c 7 [0 3] d]
|
*[a 10 [b c] d] #[b *[a c] *[a d]]
|
||||||
*[a 10 b c] *[a c]
|
|
||||||
*[a 12 [b c] d] #[b *[a c] *[a d]]
|
*[a 11 [b c] d] *[[*[a c] *[a d]] 0 3]
|
||||||
|
*[a 11 b c] *[a c]
|
||||||
|
|
||||||
*a *a
|
*a *a
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user