Commit c7fc112c authored by Nikita Zyuzin's avatar Nikita Zyuzin

Make the proofs compile at the costs of admits

parent 51a00b83
...@@ -106,8 +106,10 @@ Definition CertificateCheckerCmd (f:cmd Q) (absenv:analysisResult) (P:precond) ...@@ -106,8 +106,10 @@ Definition CertificateCheckerCmd (f:cmd Q) (absenv:analysisResult) (P:precond)
end. end.
Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P
defVars: defVars DeltaMap:
forall (E1 E2:env), forall (E1 E2:env),
(forall (e' : expr R) (m' : mType),
exists d : R, DeltaMap e' m' = Some d /\ (Rabs d <= mTypeToR m')%R) ->
(forall v, NatSet.In v (freeVars f) -> (forall v, NatSet.In v (freeVars f) ->
exists vR, E1 v = Some vR /\ exists vR, E1 v = Some vR /\
(Q2R (fst (P v)) <= vR <= Q2R (snd (P v)))%R) -> (Q2R (fst (P v)) <= vR <= Q2R (snd (P v)))%R) ->
...@@ -117,21 +119,24 @@ Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P ...@@ -117,21 +119,24 @@ Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P
exists iv err vR vF m, exists iv err vR vF m,
FloverMap.find (getRetExp f) absenv = Some (iv,err) /\ FloverMap.find (getRetExp f) absenv = Some (iv,err) /\
bstep (toREvalCmd (toRCmd f)) E1 (toRTMap (toRExpMap Gamma)) DeltaMapR vR REAL /\ bstep (toREvalCmd (toRCmd f)) E1 (toRTMap (toRExpMap Gamma)) DeltaMapR vR REAL /\
bstep (toRCmd f) E2 (toRExpMap Gamma) vF m /\ bstep (toRCmd f) E2 (toRExpMap Gamma) DeltaMap vF m /\
(forall vF m, (forall vF m,
bstep (toRCmd f) E2 (toRExpMap Gamma) vF m -> bstep (toRCmd f) E2 (toRExpMap Gamma) DeltaMap vF m ->
(Rabs (vR - vF) <= Q2R (err))%R). (Rabs (vR - vF) <= Q2R (err))%R).
(** (**
The proofs is a simple composition of the soundness proofs for the range The proofs is a simple composition of the soundness proofs for the range
validator and the error bound validator. validator and the error bound validator.
**) **)
Proof. Proof.
intros * P_valid certificate_valid. intros * deltas_matched P_valid certificate_valid.
unfold CertificateCheckerCmd in certificate_valid. unfold CertificateCheckerCmd in certificate_valid.
destruct (getValidMapCmd defVars f (FloverMap.empty mType)) eqn:?; destruct (getValidMapCmd defVars f (FloverMap.empty mType)) eqn:?;
try congruence. try congruence.
rename t into Gamma. rename t into Gamma.
assert (validTypesCmd f Gamma). assert (validTypesCmd f Gamma DeltaMap).
{ eapply getValidMapCmd_correct; try eauto.
intros; cbn in *; congruence. }
assert (validTypesCmd f Gamma DeltaMapR).
{ eapply getValidMapCmd_correct; try eauto. { eapply getValidMapCmd_correct; try eauto.
intros; cbn in *; congruence. } intros; cbn in *; congruence. }
exists Gamma; intros approxE1E2. exists Gamma; intros approxE1E2.
......
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