This commit is contained in:
crumbtoo
2023-12-04 19:52:35 -07:00
parent cb7c4fed95
commit cb0de3b26b
23 changed files with 218 additions and 92 deletions

View File

@@ -147,6 +147,29 @@ Core Transition Rules
& m
}
#. Again, building on the previous rules, this rule makes the machine consider
unapplied supercombinators to be in WHNF
.. math::
\gmrule
{ \mathtt{Unwind} : \nillist
& a_0 : \ldots : a_n : \nillist
& \langle i, s \rangle : d
& h
\begin{bmatrix}
a_0 : \mathtt{NGlobal} \; k \; c
\end{bmatrix}
& m
}
{ i
& a_n : s
& d
& h
& m \\
\SetCell[c=2]{c}
\text{when $n < k$}
}
#. If an application is on top of the stack, :code:`Unwind` continues unwinding
.. math::
@@ -340,28 +363,47 @@ Core Transition Rules
& m
}
#. Consider unapplied functions to be in WHNF
#. Pack a constructor if there are sufficient arguments
.. math::
\gmrule
{ \mathtt{Unwind} : \nillist
& a_0 : \ldots : a_n : \nillist
& \langle i, s \rangle : d
{ \mathtt{Pack} \; t \; n : i
& a_1 : \ldots : a_n : s
& d
& h
\begin{bmatrix}
a_0 : \mathtt{NGlobal} \; k \; c
\end{bmatrix}
& m
}
{ i
& a_n : s
& a : s
& d
& h
& m \\
\SetCell[c=2]{c}
\text{when $n < k$}
\begin{bmatrix}
a : \mathtt{NConstr} \; t \; [a_1,\ldots,a_n]
\end{bmatrix}
& m
}
#. Evaluate a case
.. math::
\gmrule
{ \mathtt{CaseJump} \begin{bmatrix} t \to c \end{bmatrix} : i
& a : s
& d
& h
\begin{bmatrix}
a : \mathtt{NConstr} \; t \; v
\end{bmatrix}
& m
}
{ c \concat i
& d
& h
& m
}
***************
Extension Rules
***************