Commit 29b21eb6 authored by Nikita Zyuzin's avatar Nikita Zyuzin

Try progressing on cmd validation soundness

parent a91b364b
This diff is collapsed.
...@@ -1161,6 +1161,34 @@ Proof. ...@@ -1161,6 +1161,34 @@ Proof.
rewrite <- (H n); auto. rewrite <- (H n); auto.
Qed. Qed.
Lemma eval_exp_ignore_bind e:
forall x v m Gamma E,
eval_exp E Gamma e v m ->
~ NatSet.In x (usedVars e) ->
forall m_new v_new,
eval_exp (updEnv x v_new E) (updDefVars x m_new Gamma) e v m.
Proof.
induction e; intros * eval_e no_usedVar *; cbn in *;
inversion eval_e; subst; try eauto.
- assert (n <> x).
{ hnf. intros. subst. apply no_usedVar; set_tac. }
rewrite <- Nat.eqb_neq in H.
eapply Var_load.
+ unfold updDefVars.
rewrite H; auto.
+ unfold updEnv.
rewrite H; auto.
- eapply Binop_dist'; eauto;
[ eapply IHe1 | eapply IHe2];
eauto;
hnf; intros; eapply no_usedVar;
set_tac.
- eapply Fma_dist'; eauto;
[eapply IHe1 | eapply IHe2 | eapply IHe3];
eauto;
hnf; intros; eapply no_usedVar;
set_tac.
Qed.
(* (*
(** (**
Analogous lemma for unary expressions. Analogous lemma for unary expressions.
......
...@@ -201,7 +201,15 @@ Proof. ...@@ -201,7 +201,15 @@ Proof.
case_eq (n =? y); auto. case_eq (n =? y); auto.
Qed. Qed.
(* Lemma ssa_inv_let V (e:exp V) m x g inVars outVars:
ssa (Let m x e g) inVars outVars ->
~ NatSet.In x inVars /\ ~ NatSet.In x (usedVars e).
Proof.
intros ssa_let.
inversion ssa_let; subst.
set_tac.
Qed.
(*
Lemma shadowing_free_rewriting_exp e v E1 E2 defVars: Lemma shadowing_free_rewriting_exp e v E1 E2 defVars:
(forall n, E1 n = E2 n)-> (forall n, E1 n = E2 n)->
eval_exp E1 defVars (toREval e) v M0 <-> eval_exp E1 defVars (toREval e) v M0 <->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment