This commit is contained in:
Simon Forman 2022-03-25 15:16:30 -07:00
parent 1b1fe5f5bb
commit 7403b1a07e
4 changed files with 272 additions and 234 deletions

View File

@ -2,21 +2,17 @@
## i ## i
(Basis Combinator) Basis Combinator
Append a quoted expression onto the pending expression. Append a quoted expression onto the pending expression.
[Q] i [Q] . i
----------- -------------
Q . Q
### Source
combo(i, [list(P)|S], S, Ei, Eo) :- append(P, Ei, Eo).
### Discussion ### Discussion
This is probably the fundamental combinator. You wind up using it in all This is a fundamental combinator. It is used in all kinds of places. For
kinds of places (for example, the `x` combinator can be defined as `dup i`.) example, the [x] combinator can be defined as `dup i`.

View File

@ -2,30 +2,46 @@
## ii ## ii
Basis Function Combinator Combinator
Take a quoted program from the stack and run it twice, first under the
top item, then again with the top item.
... a [Q] ii ... a [Q] ii
------------------ ------------------
... Q a Q ... Q a Q
Gentzen diagram.
### Definition ### Definition
if not basis. > \[[dip]\] [dupdip] [i]
### Derivation ### Example
if not basis. It's a little tricky to understand how this works so here's an example trace:
### Source 1 2 3 4 [++] • [dip] dupdip i
1 2 3 4 [++] [dip] • dupdip i
if basis 1 2 3 4 [++] • dip [++] i
1 2 3 • ++ 4 [++] i
1 2 4 • 4 [++] i
1 2 4 4 • [++] i
1 2 4 4 [++] • i
1 2 4 4 • ++
1 2 4 5 •
### Discussion ### Discussion
Lorem ipsum. In some cases (like the example above) this is the same effect as using [app2] but most of the time it's not:
1 2 3 4 [+] ii
--------------------
1 9
1 2 3 4 [+] app2
----------------------
1 2 5 6
### Crosslinks ### Crosslinks
Lorem ipsum. [app2]
[b]

File diff suppressed because it is too large Load Diff

View File

@ -1862,23 +1862,19 @@ This is another function that has to wait on the numeric tower.
## i ## i
(Basis Combinator) Basis Combinator
Append a quoted expression onto the pending expression. Append a quoted expression onto the pending expression.
[Q] i [Q] . i
----------- -------------
Q . Q
### Source
combo(i, [list(P)|S], S, Ei, Eo) :- append(P, Ei, Eo).
### Discussion ### Discussion
This is probably the fundamental combinator. You wind up using it in all This is a fundamental combinator. It is used in all kinds of places. For
kinds of places (for example, the `x` combinator can be defined as `dup i`.) example, the [x] combinator can be defined as `dup i`.
------------------------------------------------------------------------ ------------------------------------------------------------------------
@ -1959,33 +1955,49 @@ Lorem ipsum.
## ii ## ii
Basis Function Combinator Combinator
Take a quoted program from the stack and run it twice, first under the
top item, then again with the top item.
... a [Q] ii ... a [Q] ii
------------------ ------------------
... Q a Q ... Q a Q
Gentzen diagram.
### Definition ### Definition
if not basis. > \[[dip]\] [dupdip] [i]
### Derivation ### Example
if not basis. It's a little tricky to understand how this works so here's an example trace:
### Source 1 2 3 4 [++] • [dip] dupdip i
1 2 3 4 [++] [dip] • dupdip i
if basis 1 2 3 4 [++] • dip [++] i
1 2 3 • ++ 4 [++] i
1 2 4 • 4 [++] i
1 2 4 4 • [++] i
1 2 4 4 [++] • i
1 2 4 4 • ++
1 2 4 5 •
### Discussion ### Discussion
Lorem ipsum. In some cases (like the example above) this is the same effect as using [app2] but most of the time it's not:
1 2 3 4 [+] ii
--------------------
1 9
1 2 3 4 [+] app2
----------------------
1 2 5 6
### Crosslinks ### Crosslinks
Lorem ipsum. [app2]
[b]
-------------------- --------------------