Skip to content

Commit f145647

Browse files
committed
Fixes
1 parent 14a5458 commit f145647

File tree

1 file changed

+13
-38
lines changed

1 file changed

+13
-38
lines changed

src/Smallstep.lidr

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -868,31 +868,6 @@ We have already seen that, for our language, single-step reduction is
868868
> normal_forms_unique : deterministic Smallstep.normal_form_of
869869
> normal_forms_unique (l,r) (l2,r2) = ?normal_forms_unique_rhs
870870
871-
> {-
872-
> notAndLemmaLeft : Not x -> Not (x,y)
873-
> notAndLemmaLeft nx (l,r) = nx l
874-
875-
> notStepEqual : Not (Step x x)
876-
> notStepEqual ST_PlusConstConst impossible
877-
> notStepEqual (ST_Plus1 h) = notStepEqual h
878-
> notStepEqual (ST_Plus2 s h) = notStepEqual h
879-
880-
> normal_forms_unique : deterministic {x} {y1} {y2} normal_form_of
881-
> normal_forms_unique (l,r) (l2,r2) =
882-
> case l of
883-
> Multi_refl =>
884-
> case l2 of
885-
> Multi_refl => Refl
886-
> Multi_step {x} {y=y'} single mult => void (r (y' ** single))
887-
> Multi_step {x} {y} single mult =>
888-
> case l2 of
889-
> Multi_refl => void (r2 (y ** single))
890-
> Multi_step {x} {y=y'} single' mult' =>
891-
> let -- indHyp1 = step_deterministic single single'
892-
> -- indHyp2 = normal_forms_unique y z1 z2
893-
> in ?hole
894-
> -}
895-
896871
897872
Indeed, something stronger is true for this language (though not
898873
for all languages): the reduction of _any_ term `t` will
@@ -1018,28 +993,28 @@ The key ideas in the proof can be seen in the following picture:
1018993
C (n1 + n2)
1019994
```
1020995
1021-
That is, the multistep reduction of a term of the form [P t1 t2]
996+
That is, the multistep reduction of a term of the form `P t1 t2`
1022997
proceeds in three phases:
1023998
1024-
- First, we use [ST_Plus1] some number of times to reduce [t1]
1025-
to a normal form, which must (by [nf_same_as_value]) be a
1026-
term of the form [C n1] for some [n1].
1027-
- Next, we use [ST_Plus2] some number of times to reduce [t2]
1028-
to a normal form, which must again be a term of the form [C
1029-
n2] for some [n2].
1030-
- Finally, we use [ST_PlusConstConst] one time to reduce [P (C
1031-
n1) (C n2)] to [C (n1 + n2)].
999+
- First, we use `ST_Plus1` some number of times to reduce `t1`
1000+
to a normal form, which must (by `nf_same_as_value`) be a
1001+
term of the form `C n1` for some `n1`.
1002+
- Next, we use `ST_Plus2` some number of times to reduce `t2`
1003+
to a normal form, which must again be a term of the form `C
1004+
n2` for some `n2`.
1005+
- Finally, we use `ST_PlusConstConst` one time to reduce `P (C
1006+
n1) (C n2)` to `C (n1 + n2)`.
10321007
10331008
To formalize this intuition, you'll need to use the congruence
10341009
lemmas from above (you might want to review them now, so that
10351010
you'll be able to recognize when they are useful), plus some basic
1036-
properties of [->>*]: that it is reflexive, transitive, and
1037-
includes [->>].
1011+
properties of `->>*`: that it is reflexive, transitive, and
1012+
includes `->>`.
10381013
10391014
10401015
==== Exercise: 3 stars, advanced (eval__multistep_inf)
10411016
1042-
Write a detailed informal version of the proof of [eval__multistep]
1017+
Write a detailed informal version of the proof of `eval__multistep`
10431018
10441019
(* FILL IN HERE *)
10451020
@@ -1058,7 +1033,7 @@ The fact that small-step reduction implies big-step evaluation is
10581033
now straightforward to prove, once it is stated correctly.
10591034
10601035
The proof proceeds by induction on the multi-step reduction
1061-
sequence that is buried in the hypothesis [normal_form_of t t'].
1036+
sequence that is buried in the hypothesis `normal_form_of t t'`.
10621037
10631038
Make sure you understand the statement before you start to
10641039
work on the proof.

0 commit comments

Comments
 (0)