summaryrefslogtreecommitdiff
path: root/sec
diff options
context:
space:
mode:
authorChloe Brown <chloe.brown.00@outlook.com>2025-04-25 13:34:10 +0100
committerChloe Brown <chloe.brown.00@outlook.com>2025-04-25 13:34:10 +0100
commit7408a6b9aa210f06912d18cbf19b703446087c0a (patch)
tree9c422a71a8f9c84c9758b92ae8ce0cd84a789318 /sec
parent6ca26199d5b57ebc0c33d1009d8bff8be92142c1 (diff)
Give examples for phase 1.
Diffstat (limited to 'sec')
-rw-r--r--sec/encoding.ltx12
1 files changed, 11 insertions, 1 deletions
diff --git a/sec/encoding.ltx b/sec/encoding.ltx
index a8d0269..6d339bd 100644
--- a/sec/encoding.ltx
+++ b/sec/encoding.ltx
@@ -99,7 +99,17 @@ Given a well-formedness derivation \(\jdgmnt{ty}{\Psi}{A}\), a type variable \(X
\submult{A}{\sub{\alpha}{X/S \to S \times \alpha(X)}} \to S \to S \times \submult{A}{\alpha}
\]
that calls each accumulator within \(A\) in sequence. The definition is by
-induction on the well-formedness derivation.
+induction on the well-formedness derivation. At the end of this phase, the
+\systemtinline{compose} example is unchanged. The \systemtinline{balanced}
+example reduces to:
+\begin{listing}[H]
+\begin{systemt}
+let balanced n f = primrec n with
+ Zero => roll2 [] (Leaf f)
+| Suc tree => roll2 [tree, tree] (Branch (0, 1))
+\end{systemt}
+\vspace{-\baselineskip}
+\end{listing}
\subsection{Phase 2: Encoding Inductive Types}%
\label{subsec:inductive-types}