diff options
author | Chloe Brown <chloe.brown.00@outlook.com> | 2025-06-24 18:09:53 +0100 |
---|---|---|
committer | Chloe Brown <chloe.brown.00@outlook.com> | 2025-06-24 18:09:53 +0100 |
commit | dac18624162e82fb59b1432d94dbf33e734026a7 (patch) | |
tree | 6afdb8643a0a34afd773f4d2c53b8b35c907e8df | |
parent | 07269d4ab102aac0e3d4995812627d59a316d79b (diff) |
Fix 126--131.
-rw-r--r-- | sec/systemt.ltx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sec/systemt.ltx b/sec/systemt.ltx index cfcd660..57a0bdf 100644 --- a/sec/systemt.ltx +++ b/sec/systemt.ltx @@ -92,11 +92,13 @@ encode a data type, there are three operations we need to account for: As a concrete example, consider the pseudocode in \cref{lst:tree-eq} for comparing whether two binary trees are equal. We use a fold to create an equality predicate out of \systemtinline{tree1}. When -\systemtinline{tree1} is a leaf, we pattern match on the other tree to -see if it is also a leaf. If \systemtinline{tree1} is instead a -branch, we obtain equality predicates for its two subtrees by the -induction principal. We again pattern match on the other tree and test -equality recursively when it is also a branch. +\systemtinline{tree1} is a leaf, we pattern match on the other tree +\systemtinline{t} to see if it is also a leaf. If +\systemtinline{tree1} is instead a branch, the \foldkw{} provides +equality predicates \systemtinline{l} and \systemtinline{r} for its +two subtrees by the induction principal. We again pattern match on the +other tree and when it is also a branch we test equality recursively +with the predicates. \begin{listing} \begin{systemt} |