Commit 68dc402f authored by Nikita Zyuzin's avatar Nikita Zyuzin

[WIP] Remove DeltaMap as a parameter for type validator

parent dcd05c90
......@@ -685,7 +685,7 @@ Lemma validAffineBounds_sound_var A P E Gamma fVars dVars n:
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars (Var Q n) -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes (Var Q n) Gamma DeltaMapR ->
validTypes (Var Q n) Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -874,7 +874,7 @@ Lemma validAffineBounds_sound_const A P E Gamma fVars dVars m v:
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars (Const m v) -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes (Const m v) Gamma DeltaMapR ->
validTypes (Const m v) Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -998,7 +998,7 @@ Definition validAffineBounds_IH_e A P E Gamma fVars dVars e :=
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars e -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes e Gamma DeltaMapR ->
validTypes e Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -1030,7 +1030,7 @@ Lemma validAffineBounds_sound_unop A P E Gamma fVars dVars u e:
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars (Unop u e) -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes (Unop u e) Gamma DeltaMapR ->
validTypes (Unop u e) Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -1221,7 +1221,7 @@ Lemma validAffineBounds_sound_binop A P E Gamma fVars dVars b e1 e2:
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars (Binop b e1 e2) -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes (Binop b e1 e2) Gamma DeltaMapR ->
validTypes (Binop b e1 e2) Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -1797,7 +1797,7 @@ Lemma validAffineBounds_sound_fma A P E Gamma fVars dVars e1 e2 e3:
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars (Fma e1 e2 e3) -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes (Fma e1 e2 e3) Gamma DeltaMapR ->
validTypes (Fma e1 e2 e3) Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -2086,7 +2086,7 @@ Lemma validAffineBounds_sound_downcast A P E Gamma fVars dVars m e:
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (usedVars (Downcast m e) -- dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes (Downcast m e) Gamma DeltaMapR ->
validTypes (Downcast m e) Gamma ->
exists (map2 : noise_mapping) (af : affine_form Q) (vR : R) (aiv : intv)
(aerr : error),
contained_map map1 map2 /\
......@@ -2195,7 +2195,7 @@ Lemma validAffineBounds_sound (e: expr Q) (A: analysisResult) (P: precond)
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (NatSet.diff (Expressions.usedVars e) dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes e Gamma DeltaMapR ->
validTypes e Gamma ->
exists map2 af vR aiv aerr,
contained_map map1 map2 /\
contained_flover_map iexpmap exprAfs /\
......@@ -2249,7 +2249,7 @@ Lemma validAffineBoundsCmd_sound (c: cmd Q) (A: analysisResult) (P: precond)
affine_dVars_range_valid dVars E A inoise iexpmap map1 ->
NatSet.Subset (NatSet.diff (Commands.freeVars c) dVars) fVars ->
fVars_P_sound fVars E P ->
validTypesCmd c Gamma DeltaMapR ->
validTypesCmd c Gamma ->
exists map2 af vR aiv aerr,
contained_map map1 map2 /\
contained_flover_map iexpmap exprAfs /\
......
......@@ -164,7 +164,7 @@ Section soundnessProofs.
Lemma validErrorboundCorrectVariable_eval E1 E2 A (v:nat) e nR nlo nhi fVars
dVars Gamma DeltaMap exprTypes:
eval_Real E1 Gamma (Var Q v) nR ->
validTypes (Var Q v) Gamma DeltaMap ->
validTypes (Var Q v) Gamma ->
approxEnv E1 (toRExpMap Gamma) A fVars dVars E2 ->
validRanges (Var Q v) A E1 (toRTMap (toRExpMap Gamma)) ->
validErrorbound (Var Q v) exprTypes A dVars = true ->
......@@ -195,7 +195,7 @@ Lemma validErrorboundCorrectVariable:
eval_Real E1 Gamma (Var Q v) nR ->
eval_Fin E2 Gamma DeltaMap (Var Q v) nF mF ->
approxEnv E1 (toRExpMap Gamma) A fVars dVars E2 ->
validTypes (Var Q v) (Gamma) DeltaMap ->
validTypes (Var Q v) (Gamma) ->
validRanges (Var Q v) A E1 (toRTMap (toRExpMap Gamma)) ->
validErrorbound (Var Q v) Gamma A dVars = true ->
NatSet.Subset (NatSet.diff (usedVars (Var Q v)) dVars) fVars ->
......@@ -238,7 +238,7 @@ Qed.
Lemma validErrorboundCorrectConstant_eval E2 m n Gamma DeltaMap:
(forall (e' : expr R) (m' : mType),
exists d : R, DeltaMap e' m' = Some d /\ (Rabs d <= mTypeToR m')%R) ->
validTypes (Const m n) Gamma DeltaMap ->
validTypes (Const m n) Gamma ->
exists nF m',
eval_Fin E2 Gamma DeltaMap (Const m n) nF m'.
Proof.
......@@ -253,7 +253,7 @@ Qed.
Lemma validErrorboundCorrectConstant E1 E2 A m n nR nF e nlo nhi dVars Gamma DeltaMap:
eval_Real E1 Gamma (Const m n) nR ->
eval_Fin E2 Gamma DeltaMap (Const m n) nF m ->
validTypes (Const m n) Gamma DeltaMap ->
validTypes (Const m n) Gamma ->
validErrorbound (Const m n) Gamma A dVars = true ->
(Q2R nlo <= nR <= Q2R nhi)%R ->
FloverMap.find (Const m n) A = Some ((nlo,nhi),e) ->
......@@ -1997,7 +1997,7 @@ Theorem validErrorbound_sound (e:expr Q):
forall E1 E2 fVars dVars A Gamma DeltaMap,
(forall (e' : expr R) (m' : mType),
exists d : R, DeltaMap e' m' = Some d /\ (Rabs d <= mTypeToR m')%R) ->
validTypes e Gamma DeltaMap ->
validTypes e Gamma ->
approxEnv E1 (toRExpMap Gamma) A fVars dVars E2 ->
NatSet.Subset (NatSet.diff (Expressions.usedVars e) dVars) fVars ->
validErrorbound e Gamma A dVars = true ->
......@@ -2020,7 +2020,7 @@ Proof.
split.
+ eapply validErrorboundCorrectConstant_eval; eauto.
+ intros * eval_float.
eapply validErrorboundCorrectConstant with (E2 := E2); eauto.
eapply validErrorboundCorrectConstant with (E2 := E2) (DeltaMap := DeltaMap); eauto.
inversion eval_float; subst; auto.
- rename IHe into IHe'.
assert (validErrorBounds e E1 E2 A Gamma DeltaMap) as IHe.
......@@ -2328,7 +2328,7 @@ Theorem validErrorboundCmd_gives_eval (f:cmd Q) :
NatSet.Subset (NatSet.diff (Commands.freeVars f) dVars) fVars ->
bstep (toREvalCmd (toRCmd f)) E1 (toRTMap (toRExpMap Gamma)) DeltaMapR vR REAL ->
validErrorboundCmd f Gamma A dVars = true ->
validTypesCmd f Gamma DeltaMap ->
validTypesCmd f Gamma ->
validRangesCmd f A E1 (toRTMap (toRExpMap Gamma)) ->
FloverMap.find (getRetExp f) A = Some ((elo,ehi),err) ->
(exists vF m,
......@@ -2424,7 +2424,7 @@ Theorem validErrorboundCmd_sound (f:cmd Q):
ssa f (NatSet.union fVars dVars) outVars ->
NatSet.Subset (NatSet.diff (Commands.freeVars f) dVars) fVars ->
validErrorboundCmd f Gamma A dVars = true ->
validTypesCmd f Gamma DeltaMap ->
validTypesCmd f Gamma ->
validRangesCmd f A E1 (toRTMap (toRExpMap Gamma)) ->
validErrorBoundsCmd f E1 E2 A Gamma DeltaMap.
Proof.
......
......@@ -144,7 +144,7 @@ Theorem validIntervalbounds_sound (f:expr Q) (A:analysisResult) (P:precond)
dVars_range_valid dVars E A ->
NatSet.Subset (NatSet.diff (Expressions.usedVars f) dVars) fVars ->
fVars_P_sound fVars E P ->
validTypes f Gamma DeltaMapR ->
validTypes f Gamma ->
validRanges f A E (toRTMap (toRExpMap Gamma)).
Proof.
induction f;
......@@ -396,7 +396,7 @@ Theorem validIntervalboundsCmd_sound (f:cmd Q) (A:analysisResult):
fVars_P_sound fVars E P ->
NatSet.Subset (NatSet.diff (Commands.freeVars f) dVars) fVars ->
validIntervalboundsCmd f A P dVars = true ->
validTypesCmd f Gamma DeltaMapR ->
validTypesCmd f Gamma ->
validRangesCmd f A E (toRTMap (toRExpMap Gamma)).
Proof.
induction f;
......
......@@ -25,7 +25,7 @@ Theorem RangeValidator_sound (e : expr Q) (A : analysisResult) (P : precond) dVa
RangeValidator e A P dVars = true ->
dVars_range_valid dVars E A ->
affine_dVars_range_valid dVars E A 1 (FloverMap.empty (affine_form Q)) (fun _: nat => None) ->
validTypes e Gamma DeltaMapR ->
validTypes e Gamma ->
fVars_P_sound (usedVars e) E P ->
validRanges e A E (toRTMap (toRExpMap Gamma)).
Proof.
......@@ -76,7 +76,7 @@ Theorem RangeValidatorCmd_sound (f : cmd Q) (A : analysisResult) (P : precond) d
affine_dVars_range_valid dVars E A 1 (FloverMap.empty (affine_form Q)) (fun _: nat => None) ->
fVars_P_sound fVars E P ->
NatSet.Subset (freeVars f -- dVars) fVars ->
validTypesCmd f Gamma DeltaMapR ->
validTypesCmd f Gamma ->
validRangesCmd f A E (toRTMap (toRExpMap Gamma)).
Proof.
intros ranges_valid; intros.
......
This diff is collapsed.
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