clarify current state of "WHNF"

doc corrections

doc corrections
This commit is contained in:
crumbtoo
2023-12-04 06:39:13 -07:00
parent f2b5ec1a52
commit 535f2781b9

View File

@@ -253,7 +253,8 @@ Core Transition Rules
& m & m
} }
13. When unwinding, if the top of the stack is in WHNF, pop the dump 13. When unwinding, if the top of the stack is in WHNF (currently this just
means a number), pop the dump
.. math:: .. math::
\gmrule \gmrule
@@ -295,21 +296,24 @@ Extension Rules
*************** ***************
1. A sneaky trick to enable sharing of :code:`NNum` nodes. We note that the 1. A sneaky trick to enable sharing of :code:`NNum` nodes. We note that the
global environment is a mapping of :code:`Name` objects (i.e. identifiers) to global environment is a mapping of plain old strings to heap addresses.
heap addresses. Strings of digits are not considered valid identifiers! We Strings of digits are not considered valid identifiers, so putting them on
abuse this by modifying Core Rule 2 to update the global environment with the the global environment will never conflict with a supercombinator! We abuse
new node's address. Consider how this rule might impact garbage collection this by modifying Core Rule 2 to update the global environment with the new
node's address. Consider how this rule might impact garbage collection
(remember that the environment is intended for *globals*). (remember that the environment is intended for *globals*).
.. math:: .. math::
\gmrule \gmrule
{ \mathtt{PushInt} \; n : i { \mathtt{PushInt} \; n : i
& s & s
& d
& h & h
& m & m
} }
{ i { i
& a : s & a : s
& d
& h & h
\begin{bmatrix} \begin{bmatrix}
a : \mathtt{NNum} \; n a : \mathtt{NNum} \; n
@@ -327,9 +331,10 @@ Extension Rules
action when a number already exists in the environment: action when a number already exists in the environment:
.. math:: .. math::
\transrule \gmrule
{ \mathtt{PushInt} \; n : i { \mathtt{PushInt} \; n : i
& s & s
& d
& h & h
& m & m
\begin{bmatrix} \begin{bmatrix}
@@ -338,6 +343,7 @@ Extension Rules
} }
{ i { i
& a : s & a : s
& d
& h & h
& m & m
\\ \\