mirror of
https://github.com/achlipala/frap.git
synced 2025-02-26 03:22:13 +00:00
TypesAndMutation: finish lambda-ref soundness proof
This commit is contained in:
parent
c279d3d610
commit
cf9062fa4e
1 changed files with 43 additions and 21 deletions
|
@ -181,9 +181,6 @@ Module Rlc.
|
||||||
| [ H : hasty _ _ ?e _, H' : value ?e |- _ ] => (invert H'; invert H); []
|
| [ H : hasty _ _ ?e _, H' : value ?e |- _ ] => (invert H'; invert H); []
|
||||||
| [ H : hasty _ _ _ _ |- _ ] => invert1 H
|
| [ H : hasty _ _ _ _ |- _ ] => invert1 H
|
||||||
| [ H : plug _ _ _ |- _ ] => invert1 H
|
| [ H : plug _ _ _ |- _ ] => invert1 H
|
||||||
|
|
||||||
| [ H : forall l t, ?h $? l = Some t -> _,
|
|
||||||
H' : ?h $? _ = Some _ |- _ ] => apply H in H'
|
|
||||||
end; subst.
|
end; subst.
|
||||||
|
|
||||||
Ltac t := simplify; propositional; repeat (t0; simplify); try equality; eauto 7.
|
Ltac t := simplify; propositional; repeat (t0; simplify); try equality; eauto 7.
|
||||||
|
@ -197,6 +194,8 @@ Module Rlc.
|
||||||
\/ exists he', step (h, e) he'.
|
\/ exists he', step (h, e) he'.
|
||||||
Proof.
|
Proof.
|
||||||
induct 2; t.
|
induct 2; t.
|
||||||
|
apply H2 in H8; t.
|
||||||
|
apply H1 in H8; t.
|
||||||
Qed.
|
Qed.
|
||||||
|
|
||||||
Lemma weakening_override : forall (G G' : fmap var type) x t,
|
Lemma weakening_override : forall (G G' : fmap var type) x t,
|
||||||
|
@ -288,7 +287,9 @@ Module Rlc.
|
||||||
-> forall H1 t, hasty H1 $0 e1 t
|
-> forall H1 t, hasty H1 $0 e1 t
|
||||||
-> heapty H1 h1
|
-> heapty H1 h1
|
||||||
-> exists H2, hasty H2 $0 e2 t
|
-> exists H2, hasty H2 $0 e2 t
|
||||||
/\ heapty H2 h2.
|
/\ heapty H2 h2
|
||||||
|
/\ (forall l t, H1 $? l = Some t
|
||||||
|
-> H2 $? l = Some t).
|
||||||
Proof.
|
Proof.
|
||||||
invert 1; t.
|
invert 1; t.
|
||||||
|
|
||||||
|
@ -297,31 +298,51 @@ Module Rlc.
|
||||||
econstructor.
|
econstructor.
|
||||||
simplify.
|
simplify.
|
||||||
auto.
|
auto.
|
||||||
eauto.
|
eauto 6.
|
||||||
|
|
||||||
|
apply H3 in H9; t.
|
||||||
rewrite H1 in H2.
|
rewrite H1 in H2.
|
||||||
invert H2.
|
invert H2.
|
||||||
eauto.
|
eauto.
|
||||||
|
|
||||||
rewrite H1 in H2.
|
assert (H0 $? l = Some t) by assumption.
|
||||||
invert H2.
|
apply H3 in H8.
|
||||||
exists H0; propositional.
|
invert H8; propositional.
|
||||||
Admitted.
|
rewrite H1 in H5.
|
||||||
|
invert H5.
|
||||||
|
eexists; propositional.
|
||||||
|
eauto.
|
||||||
|
exists bound; propositional.
|
||||||
|
cases (l ==n l0); simplify; eauto.
|
||||||
|
subst.
|
||||||
|
rewrite H in H2; invert H2.
|
||||||
|
eauto.
|
||||||
|
apply H4 in H2.
|
||||||
|
cases (l ==n l0); simplify; equality.
|
||||||
|
assumption.
|
||||||
|
Qed.
|
||||||
|
|
||||||
Hint Resolve preservation0.
|
Hint Resolve preservation0.
|
||||||
|
|
||||||
Lemma generalize_plug : forall e1 C e1',
|
Lemma generalize_plug : forall H e1 C e1',
|
||||||
plug C e1 e1'
|
plug C e1 e1'
|
||||||
-> forall e2 e2', plug C e2 e2'
|
-> forall t, hasty H $0 e1' t
|
||||||
-> (forall H t, hasty H $0 e1 t -> hasty H $0 e2 t)
|
-> exists t0, hasty H $0 e1 t0
|
||||||
-> (forall H t, hasty H $0 e1' t -> hasty H $0 e2' t).
|
/\ (forall e2 e2' H',
|
||||||
|
hasty H' $0 e2 t0
|
||||||
|
-> plug C e2 e2'
|
||||||
|
-> (forall l t, H $? l = Some t -> H' $? l = Some t)
|
||||||
|
-> hasty H' $0 e2' t).
|
||||||
Proof.
|
Proof.
|
||||||
induct 1; t.
|
Ltac applyIn := match goal with
|
||||||
|
| [ H : forall x, _, H' : _ |- _ ] =>
|
||||||
|
apply H in H'; clear H; invert H'; propositional
|
||||||
|
end.
|
||||||
|
|
||||||
|
induct 1; t; (try applyIn; eexists; t).
|
||||||
Qed.
|
Qed.
|
||||||
|
|
||||||
Hint Resolve generalize_plug.
|
Lemma preservation : forall h1 e1 h2 e2,
|
||||||
|
|
||||||
Lemma preservation : forall h1 e1 h2 e2,
|
|
||||||
step (h1, e1) (h2, e2)
|
step (h1, e1) (h2, e2)
|
||||||
-> forall H1 t, hasty H1 $0 e1 t
|
-> forall H1 t, hasty H1 $0 e1 t
|
||||||
-> heapty H1 h1
|
-> heapty H1 h1
|
||||||
|
@ -329,11 +350,12 @@ Module Rlc.
|
||||||
/\ heapty H2 h2.
|
/\ heapty H2 h2.
|
||||||
Proof.
|
Proof.
|
||||||
invert 1; simplify.
|
invert 1; simplify.
|
||||||
eapply preservation0 in H6.
|
eapply generalize_plug in H; eauto.
|
||||||
|
invert H; propositional.
|
||||||
|
eapply preservation0 in H6; eauto.
|
||||||
invert H6; propositional.
|
invert H6; propositional.
|
||||||
exists x; propositional.
|
eauto.
|
||||||
3: eauto.
|
Qed.
|
||||||
Admitted.
|
|
||||||
|
|
||||||
Hint Resolve progress preservation.
|
Hint Resolve progress preservation.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue