mirror of
https://github.com/achlipala/frap.git
synced 2024-11-27 23:06:20 +00:00
One more redaction from Interpreters_template
This commit is contained in:
parent
901cacd35a
commit
9720a6e0c6
1 changed files with 3 additions and 19 deletions
|
@ -304,22 +304,6 @@ Qed.
|
|||
* counts. That is, we can duplicate the loop body instead of using an explicit
|
||||
* loop. *)
|
||||
|
||||
Fixpoint seqself (c : cmd) (n : nat) : cmd :=
|
||||
match n with
|
||||
| O => Skip
|
||||
| S n' => Sequence c (seqself c n')
|
||||
end.
|
||||
|
||||
Fixpoint unroll (c : cmd) : cmd :=
|
||||
match c with
|
||||
| Skip => c
|
||||
| Assign _ _ => c
|
||||
| Sequence c1 c2 => Sequence (unroll c1) (unroll c2)
|
||||
| Repeat (Const n) c1 => seqself (unroll c1) n
|
||||
(* ^-- the crucial case! *)
|
||||
| Repeat e c1 => Repeat e (unroll c1)
|
||||
end.
|
||||
|
||||
(* This obvious-sounding fact will come in handy: self-composition gives the
|
||||
* same result, when passed two functions that map equal inputs to equal
|
||||
* outputs. *)
|
||||
|
@ -334,7 +318,7 @@ Proof.
|
|||
trivial.
|
||||
Qed.
|
||||
|
||||
Theorem unroll_ok : forall c v, exec (unroll c) v = exec c v.
|
||||
(*Theorem unroll_ok : forall c v, exec (unroll c) v = exec c v.
|
||||
Proof.
|
||||
admit.
|
||||
Qed.
|
||||
|
||||
Qed.*)
|
||||
|
|
Loading…
Reference in a new issue