summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lexer.py2
-rw-r--r--main.tex2
-rw-r--r--sec/encoding.ltx12
3 files changed, 13 insertions, 3 deletions
diff --git a/lexer.py b/lexer.py
index a16a38a..6963b77 100644
--- a/lexer.py
+++ b/lexer.py
@@ -9,7 +9,7 @@ class SystemTLexer(OcamlLexer):
aliases = ['syst']
filenames = ['*.syst']
- EXTRA_KEYWORDS = ['primrec', 'fold', 'foldmatch', 'roll']
+ EXTRA_KEYWORDS = ['primrec', 'fold', 'foldmatch', 'roll', 'roll2']
def get_tokens_unprocessed(self, text):
for index, token, value in OcamlLexer.get_tokens_unprocessed(self, text):
diff --git a/main.tex b/main.tex
index 91aa555..f02720b 100644
--- a/main.tex
+++ b/main.tex
@@ -247,7 +247,7 @@
%% Recursive types
\ExplSyntaxOn
\NewDocumentCommand \roll {s}
- { \ensuremath{\mathsf{roll} \IfBooleanT{#1}{'}} }
+ { \ensuremath{\mathsf{roll \IfBooleanT{#1}{2}}} }
\ExplSyntaxOff
\newcommand\unroll{\ensuremath{\mathsf{unroll}}}
\newcommand\foldkw{\ensuremath{\mathsf{fold}}}
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}