Commit c2a83320 authored by Heiko Becker's avatar Heiko Becker

Finish IEE validator soundness in Coq

parent 29624021
......@@ -2256,13 +2256,14 @@ Proof.
+ rename R into valid_rec.
rewrite (typingSoundnessExp _ _ L0 eval_float_e) in *;
simpl in *.
destruct (Gamma (Var Q n)) eqn:?; try congruence.
match goal with
| [ H: _ && _ = true |- _] => andb_to_prop H
end.
type_conv.
destruct (IHf absenv (updEnv n v E1) (updEnv n vF E2) outVars fVars
(NatSet.add n dVars) vR elo ehi err P Gamma
(updDefVars n m defVars))
(updDefVars n m0 defVars))
as [vF_res [m_res step_res]];
eauto.
{ eapply ssa_equal_set; eauto.
......@@ -2381,13 +2382,14 @@ Proof.
rename R into valid_rec.
rewrite (typingSoundnessExp _ _ L0 eval_float_e) in *;
simpl in *.
destruct (Gamma (Var Q n)); try congruence.
match goal with
| [ H: _ && _ = true |- _] => andb_to_prop H
end.
type_conv.
apply (IHf absenv (updEnv n v E1) (updEnv n v0 E2) outVars fVars
(NatSet.add n dVars) vR vF mF elo ehi err P Gamma
(updDefVars n m defVars));
(updDefVars n m0 defVars));
eauto.
+ eapply approxUpdBound; try auto.
simpl in *.
......
This diff is collapsed.
Require Import Coq.Reals.Reals Coq.QArith.QArith Coq.micromega.Psatz
Require Import Coq.Reals.Reals Coq.QArith.QArith Coq.QArith.Qabs Coq.micromega.Psatz
Coq.QArith.Qreals.
Require Import Daisy.Expressions Daisy.Infra.RationalSimps
Daisy.Infra.RealRationalProps.
......
......@@ -101,9 +101,10 @@ Fixpoint typeCheckCmd (c:cmd Q) (Gamma:nat -> option mType) (tMap:exp Q -> optio
match c with
| Let m x e g => if typeCheck e Gamma tMap
then
match tMap e with
| Some me => mTypeEq me m && typeCheckCmd g (updDefVars x me Gamma) tMap
| _ => false
match tMap e, tMap (Var Q x) with
| Some me, Some mx => mTypeEq me m && mTypeEq m mx
&& typeCheckCmd g (updDefVars x me Gamma) tMap
| _, _ => false
end
else
false
......@@ -260,6 +261,7 @@ Proof.
specialize (IHc (updDefVars n m0 Gamma) (updEnv n v0 E)).
simpl.
rewrite e_type_m0 in R.
destruct (expTypes (Var Q n)) eqn:?; try congruence.
andb_to_prop R.
apply IHc; auto.
- simpl in *.
......
......@@ -48,7 +48,7 @@ val typeCmd_def = Define `
val typeMapCmd_def = Define `
typeMapCmd (Gamma: num -> mType option) (f: real cmd) (f': real exp) : mType option =
case f of
| Let m n e c => if f' = (Var n) then
| Let m n e c => if f' = (Var n) then (*FIXME: This may fail because n not in Gamma... *)
(case Gamma n of
| SOME m' => if isMorePrecise m m' then SOME m else NONE
| NONE => NONE)
......
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