Commit 1a95eddd authored by Heiko Becker's avatar Heiko Becker

Renaming in Coq dev, move attic files to separate folder

parent 9113b954
......@@ -14,7 +14,7 @@ coq/*.vo
coq/.*
coq/*.v.d
coq/*/*.v.d
coq/Makefile
coq/Makefile*
coq/*/*.glob
coq/*/.*
coq/*/*.vo
......
......@@ -3,8 +3,8 @@
used to verify analsysis result in the final theorem of a certificate.
**)
Require Import Coq.Reals.Reals.
Require Import Daisy.Infra.Abbrevs Daisy.Infra.RealConstruction Daisy.Infra.RealSimps.
Require Import Daisy.IntervalArith Daisy.Expressions Daisy.Commands.
Require Import Flover.Infra.Abbrevs Flover.Infra.RealConstruction Flover.Infra.RealSimps.
Require Import Flover.IntervalArith Flover.Expressions Flover.Commands.
Definition abs_env:Type := exp R -> interval -> err -> Prop.
......
(**
Formalization of the Abstract Syntax Tree of a subset used in the Daisy framework
Formalization of the Abstract Syntax Tree of a subset used in the Flover framework
**)
Require Import Coq.Reals.Reals.
Require Import Daisy.Infra.Abbrevs Daisy.Expressions.
Require Import Flover.Infra.Abbrevs Flover.Expressions.
(**
Next define what a program is.
Currently no loops, only conditionals and assignments
......@@ -15,7 +15,7 @@ Let: nat -> exp V -> cmd V -> cmd V
| Nop: cmd V.
(**
Small Step semantics for Daisy language, parametric by evaluation function.
Small Step semantics for Flover language, parametric by evaluation function.
**)
Inductive sstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop :=
let_s x e s env v eps:
......@@ -31,7 +31,7 @@ Inductive sstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop :=
eval_exp eps env e v ->
sstep (Ret R e) env eps (Nop R) (updEnv 0 v env).
(**
Analogously define Big Step semantics for the Daisy language,
Analogously define Big Step semantics for the Flover language,
parametric by the evaluation function
**)
Inductive bstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop :=
......
(**
Formalization of the base expression language for the daisy framework
Formalization of the base expression language for the flover framework
**)
Require Import Coq.Reals.Reals Coq.micromega.Psatz Coq.QArith.QArith Interval.Interval_tactic.
Require Import Daisy.Infra.RealConstruction Daisy.Infra.RealSimps Daisy.Infra.Abbrevs.
Require Import Flover.Infra.RealConstruction Flover.Infra.RealSimps Flover.Infra.Abbrevs.
Set Implicit Arguments.
Module Type Expression.
......
......@@ -2,7 +2,7 @@
Precondition agreement checker and its soundness proof
**)
Require Import Coq.Reals.Reals Coq.Lists.List Coq.QArith.QArith.
Require Import Daisy.Infra.Abbrevs Daisy.Expressions Daisy.Infra.RationalSimps Daisy.Infra.ExpressionAbbrevs Daisy.IntervalArithQ.
Require Import Flover.Infra.Abbrevs Flover.Expressions Flover.Infra.RationalSimps Flover.Infra.ExpressionAbbrevs Flover.IntervalArithQ.
Import Lists.List.ListNotations.
......
Require Import Daisy.CertificateChecker.
Require Import Flover.CertificateChecker.
(*
TODO: update according to:
[ Info ]
......
Require Import Daisy.CertificateChecker.
Require Import Flover.CertificateChecker.
(*
[ Info ]
......
Require Import Coq.Reals.Reals.
Require Import Daisy.Infra.abbrevs Daisy.daisy_lang Daisy.abs_err Daisy.exps.
Require Import Flover.Infra.abbrevs Flover.flover_lang Flover.abs_err Flover.exps.
(**
Notes:
......
Require Import Coq.Reals.Reals.
Require Import Interval.Interval_tactic.
Require Import Daisy.Infra.abbrevs.
Require Import Flover.Infra.abbrevs.
Definition min4 (a:R) (b:R) (c:R) (d:R) := Rmin a (Rmin b (Rmin c d)).
Definition max4 (a:R) (b:R) (c:R) (d:R) := Rmax a (Rmax b (Rmax c d)).
......
......@@ -2,7 +2,7 @@
Toy Example to understand what certificate we will need for a given program
**)
Require Import Coq.Reals.Reals.
Require Import Daisy.daisy_lang Daisy.exps Daisy.abs_err.
Require Import Flover.flover_lang Flover.exps Flover.abs_err.
Definition prg :cmd R :=
Ret R (Binop Mult (Const (3%R)) (Var R 1)).
......
......@@ -2,7 +2,7 @@ open preamble
open machine_ieeeTheory binary_ieeeTheory lift_ieeeTheory realTheory
open MachineTypeTheory ExpressionsTheory RealSimpsTheory DaisyTactics CertificateCheckerTheory
open MachineTypeTheory ExpressionsTheory RealSimpsTheory FloverTactics CertificateCheckerTheory
open FPRangeValidatorTheory IntervalValidationTheory TypingTheory ErrorValidationTheory IntervalArithTheory AbbrevsTheory
......
......@@ -5,15 +5,15 @@
as shown in the soundness theorem.
**)
Require Import Coq.Reals.Reals Coq.QArith.Qreals.
Require Import Daisy.Infra.RealSimps Daisy.Infra.RationalSimps Daisy.Infra.RealRationalProps Daisy.Infra.Ltacs.
Require Import Daisy.IntervalValidation Daisy.ErrorValidation Daisy.Environments Daisy.Typing Daisy.FPRangeValidator.
Require Import Flover.Infra.RealSimps Flover.Infra.RationalSimps Flover.Infra.RealRationalProps Flover.Infra.Ltacs.
Require Import Flover.IntervalValidation Flover.ErrorValidation Flover.Environments Flover.Typing Flover.FPRangeValidator.
Require Export Coq.QArith.QArith.
Require Export Daisy.Infra.ExpressionAbbrevs Daisy.Commands.
Require Export Flover.Infra.ExpressionAbbrevs Flover.Commands.
(** Certificate checking function **)
Definition CertificateChecker (e:exp Q) (absenv:analysisResult) (P:precond) (defVars:nat -> option mType) :=
let tMap := (typeMap defVars e (DaisyMap.empty mType)) in
let tMap := (typeMap defVars e (FloverMap.empty mType)) in
if (typeCheck e defVars tMap)
then
if (validIntervalbounds e absenv P NatSet.empty) && FPRangeValidator e absenv tMap NatSet.empty
......@@ -37,7 +37,7 @@ Theorem Certificate_checking_is_sound (e:exp Q) (absenv:analysisResult) P defVar
defVars v = Some m) ->
CertificateChecker e absenv P defVars = true ->
exists iv err vR vF m,
DaisyMap.find e absenv = Some (iv, err) /\
FloverMap.find e absenv = Some (iv, err) /\
eval_exp E1 (toRMap defVars) (toREval (toRExp e)) vR M0 /\
eval_exp E2 defVars (toRExp e) vF m /\
(forall vF m,
......@@ -67,12 +67,12 @@ Proof.
edestruct (validIntervalbounds_sound e (A:=absenv) (P:=P) (fVars:=usedVars e) (dVars:=NatSet.empty) (Gamma:=defVars) (E:=E1))
as [iv_e [ err_e [vR [ map_e [eval_real real_bounds_e]]]]]; eauto.
destruct iv_e as [elo ehi].
edestruct (validErrorbound_sound e (typeMap defVars e (DaisyMap.empty mType)) L approxE1E2 H0 eval_real R0 L1 H P_valid H1 map_e) as [[vF [mF eval_float]] err_bounded]; auto.
edestruct (validErrorbound_sound e (typeMap defVars e (FloverMap.empty mType)) L approxE1E2 H0 eval_real R0 L1 H P_valid H1 map_e) as [[vF [mF eval_float]] err_bounded]; auto.
exists (elo, ehi), err_e, vR, vF, mF; split; auto.
Qed.
Definition CertificateCheckerCmd (f:cmd Q) (absenv:analysisResult) (P:precond) defVars:=
let tMap := typeMapCmd defVars f (DaisyMap.empty mType) in
let tMap := typeMapCmd defVars f (FloverMap.empty mType) in
if (typeCheckCmd f defVars tMap && validSSA f (freeVars f))
then
if (validIntervalboundsCmd f absenv P NatSet.empty) &&
......@@ -92,7 +92,7 @@ Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P d
defVars v = Some m) ->
CertificateCheckerCmd f absenv P defVars = true ->
exists iv err vR vF m,
DaisyMap.find (getRetExp f) absenv = Some (iv,err) /\
FloverMap.find (getRetExp f) absenv = Some (iv,err) /\
bstep (toREvalCmd (toRCmd f)) E1 (toRMap defVars) vR M0 /\
bstep (toRCmd f) E2 defVars vF m /\
(forall vF m,
......
Require Import Daisy.CertificateChecker Daisy.daisyParser.
Require Import Flover.CertificateChecker Flover.floverParser.
Require Import Coq.extraction.ExtrOcamlString Coq.extraction.ExtrOcamlBasic Coq.extraction.ExtrOcamlNatBigInt Coq.extraction.ExtrOcamlZBigInt.
Extraction Language Ocaml.
......
(**
Formalization of the Abstract Syntax Tree of a subset used in the Daisy framework
Formalization of the Abstract Syntax Tree of a subset used in the Flover framework
**)
Require Import Coq.Reals.Reals Coq.QArith.QArith.
Require Import Daisy.Expressions.
Require Export Daisy.Infra.ExpressionAbbrevs Daisy.Infra.NatSet.
Require Import Flover.Expressions.
Require Export Flover.Infra.ExpressionAbbrevs Flover.Infra.NatSet.
(**
Next define what a program is.
......@@ -35,7 +35,7 @@ Fixpoint toREvalCmd (f:cmd R) :=
(*
UNUSED!
Small Step semantics for Daisy language
Small Step semantics for Flover language
Inductive sstep : cmd R -> env -> R -> cmd R -> env -> Prop :=
let_s x e s E v eps:
eval_exp eps E e v ->
......@@ -46,7 +46,7 @@ Inductive sstep : cmd R -> env -> R -> cmd R -> env -> Prop :=
*)
(**
Define big step semantics for the Daisy language, terminating on a "returned"
Define big step semantics for the Flover language, terminating on a "returned"
result value
**)
Inductive bstep : cmd R -> env -> (nat -> option mType) -> R -> mType -> Prop :=
......
(**
Environment library.
Defines the environment type for the Daisy framework and a simulation relation between environments.
Defines the environment type for the Flover framework and a simulation relation between environments.
**)
Require Import Coq.Reals.Reals Coq.micromega.Psatz Coq.QArith.Qreals.
Require Import Daisy.Infra.ExpressionAbbrevs Daisy.Infra.RationalSimps Daisy.Commands.
Require Import Flover.Infra.ExpressionAbbrevs Flover.Infra.RationalSimps Flover.Commands.
(**
Define an approximation relation between two environments.
......@@ -22,7 +22,7 @@ Inductive approxEnv : env -> (nat -> option mType) -> analysisResult -> NatSet.t
approxEnv (updEnv x v1 E1) (updDefVars x m defVars) A (NatSet.add x fVars) dVars (updEnv x v2 E2)
|approxUpdBound E1 E2 defVars A v1 v2 x fVars dVars m iv err:
approxEnv E1 defVars A fVars dVars E2 ->
DaisyMap.find (Var Q x) A = Some (iv, err) ->
FloverMap.find (Var Q x) A = Some (iv, err) ->
(Rabs (v1 - v2) <= Q2R err)%R ->
NatSet.mem x (NatSet.union fVars dVars) = false ->
approxEnv (updEnv x v1 E1) (updDefVars x m defVars) A fVars (NatSet.add x dVars) (updEnv x v2 E2).
......@@ -102,7 +102,7 @@ Section RelationProperties.
E2 x = Some v2 ->
NatSet.In x dVars ->
Gamma x = Some m ->
DaisyMap.find (Var Q x) A = Some (iv, e) ->
FloverMap.find (Var Q x) A = Some (iv, e) ->
(Rabs (v - v2) <= Q2R e)%R.
Proof.
induction approxEnvs;
......
......@@ -4,8 +4,8 @@ This shortens soundness proofs later.
Bounds are explained in section 5, Deriving Computable Error Bounds
**)
Require Import Coq.Reals.Reals Coq.micromega.Psatz Coq.QArith.QArith Coq.QArith.Qreals.
Require Import Daisy.Infra.Abbrevs Daisy.Infra.RationalSimps Daisy.Infra.RealSimps Daisy.Infra.RealRationalProps.
Require Import Daisy.Environments Daisy.Infra.ExpressionAbbrevs.
Require Import Flover.Infra.Abbrevs Flover.Infra.RationalSimps Flover.Infra.RealSimps Flover.Infra.RealRationalProps.
Require Import Flover.Environments Flover.Infra.ExpressionAbbrevs.
Lemma const_abs_err_bounded (n:R) (nR:R) (nF:R) (E1 E2:env) (m:mType) defVars:
......
......@@ -9,17 +9,17 @@
From Coq
Require Import QArith.QArith QArith.Qminmax QArith.Qabs QArith.Qreals
micromega.Psatz Reals.Reals.
From Daisy
From Flover
Require Import Infra.Abbrevs Infra.RationalSimps Infra.RealRationalProps
Infra.RealSimps Infra.Ltacs Environments IntervalValidation Typing
ErrorBounds.
(** Error bound validator **)
Fixpoint validErrorbound (e:exp Q) (* analyzed expression *)
(typeMap:DaisyMap.t mType) (* derived types for e *)
(A:analysisResult) (* encoded result of Daisy *)
(typeMap:FloverMap.t mType) (* derived types for e *)
(A:analysisResult) (* encoded result of Flover *)
(dVars:NatSet.t) (* let-bound variables encountered previously *):=
match DaisyMap.find e A, DaisyMap.find e typeMap with
match FloverMap.find e A, FloverMap.find e typeMap with
| Some (intv, err), Some m =>
if (Qleb 0 err) (* encoding soundness: errors are positive *)
then
......@@ -33,7 +33,7 @@ Fixpoint validErrorbound (e:exp Q) (* analyzed expression *)
|Unop Neg e1 =>
if (validErrorbound e1 typeMap A dVars)
then
match DaisyMap.find e1 A with
match FloverMap.find e1 A with
| Some (iv_e1, err1) => Qeq_bool err err1
| None => false
end
......@@ -43,7 +43,7 @@ Fixpoint validErrorbound (e:exp Q) (* analyzed expression *)
if ((validErrorbound e1 typeMap A dVars)
&& (validErrorbound e2 typeMap A dVars))
then
match DaisyMap.find e1 A, DaisyMap.find e2 A with
match FloverMap.find e1 A, FloverMap.find e2 A with
| Some (ive1, err1), Some (ive2, err2) =>
let errIve1 := widenIntv ive1 err1 in
let errIve2 := widenIntv ive2 err2 in
......@@ -74,7 +74,7 @@ Fixpoint validErrorbound (e:exp Q) (* analyzed expression *)
&& (validErrorbound e2 typeMap A dVars)
&& (validErrorbound e3 typeMap A dVars))
then
match DaisyMap.find e1 A, DaisyMap.find e2 A, DaisyMap.find e3 A with
match FloverMap.find e1 A, FloverMap.find e2 A, FloverMap.find e3 A with
| Some (ive1, err1), Some (ive2, err2), Some (ive3, err3) =>
let errIve1 := widenIntv ive1 err1 in
let errIve2 := widenIntv ive2 err2 in
......@@ -91,7 +91,7 @@ Fixpoint validErrorbound (e:exp Q) (* analyzed expression *)
|Downcast m1 e1 =>
if validErrorbound e1 typeMap A dVars
then
match DaisyMap.find e1 A with
match FloverMap.find e1 A with
| Some (ive1, err1) =>
let errIve1 := widenIntv ive1 err1 in
(Qleb (err1 + maxAbs errIve1 * (mTypeToQ m1)) err)
......@@ -107,12 +107,12 @@ Fixpoint validErrorbound (e:exp Q) (* analyzed expression *)
(** Error bound command validator **)
Fixpoint validErrorboundCmd (f:cmd Q) (* analyzed cmd with let's *)
typeMap (* inferred types *)
(A:analysisResult) (* Daisy's encoded result *)
(A:analysisResult) (* Flover's encoded result *)
(dVars:NatSet.t) (* defined variables *)
: bool :=
match f with
|Let m x e g =>
match DaisyMap.find e A, DaisyMap.find (Var Q x) A with
match FloverMap.find e A, FloverMap.find (Var Q x) A with
| Some (iv_e, err_e), Some (iv_x, err_x) =>
if ((validErrorbound e typeMap A dVars) && (Qeq_bool err_e err_x))
then validErrorboundCmd g typeMap A (NatSet.add x dVars)
......@@ -132,11 +132,11 @@ Arguments mTypeToQ _ :simpl nomatch.
**)
Lemma err_always_positive e tmap (A:analysisResult) dVars iv err:
validErrorbound e tmap A dVars = true ->
DaisyMap.find e A = Some (iv,err) ->
FloverMap.find e A = Some (iv,err) ->
(0 <= Q2R err)%R.
Proof.
destruct e; cbn; intros;
Daisy_compute; canonize_hyps;
Flover_compute; canonize_hyps;
auto.
Qed.
......@@ -163,7 +163,7 @@ Lemma validErrorboundCorrectVariable_eval E1 E2 A (v:nat) e nR nlo nhi P fVars
dVars_range_valid dVars E1 A ->
fVars_P_sound fVars E1 P ->
vars_typed (NatSet.union fVars dVars) Gamma ->
DaisyMap.find (Var Q v) A = Some ((nlo, nhi), e) ->
FloverMap.find (Var Q v) A = Some ((nlo, nhi), e) ->
exists nF m,
eval_exp E2 Gamma (toRExp (Var Q v)) nF m.
Proof.
......@@ -174,7 +174,7 @@ Proof.
pose proof (meps_0_deterministic _ eval_real eval_real2). subst.
cbn in *.
inversion eval_real; subst.
Daisy_compute; type_conv.
Flover_compute; type_conv.
destruct (approxEnv_gives_value approxCEnv H1); try eauto.
set_tac.
case_eq (NatSet.mem v dVars); intros v_case; set_tac.
......@@ -194,7 +194,7 @@ Lemma validErrorboundCorrectVariable:
dVars_range_valid dVars E1 A ->
fVars_P_sound fVars E1 P ->
vars_typed (NatSet.union fVars dVars) Gamma ->
DaisyMap.find (Var Q v) A = Some ((nlo, nhi), e) ->
FloverMap.find (Var Q v) A = Some ((nlo, nhi), e) ->
(Rabs (nR - nF) <= (Q2R e))%R.
Proof.
intros * eval_real eval_float typing_ok approxCEnv bounds_valid error_valid
......@@ -202,7 +202,7 @@ Proof.
eapply validIntervalbounds_sound in bounds_valid; eauto.
destruct_smart [find_v [eval_real2 bounds_valid]] bounds_valid.
pose proof (meps_0_deterministic _ eval_real eval_real2); subst.
cbn in *; Daisy_compute; type_conv.
cbn in *; Flover_compute; type_conv.
inversion eval_real;
inversion eval_float;
subst.
......@@ -250,11 +250,11 @@ Lemma validErrorboundCorrectConstant E1 E2 A m n nR nF e nlo nhi dVars Gamma def
typeCheck (Const m n) defVars Gamma = true ->
validErrorbound (Const m n) Gamma A dVars = true ->
(Q2R nlo <= nR <= Q2R nhi)%R ->
DaisyMap.find (Const m n) A = Some ((nlo,nhi),e) ->
FloverMap.find (Const m n) A = Some ((nlo,nhi),e) ->
(Rabs (nR - nF) <= (Q2R e))%R.
Proof.
intros eval_real eval_float subexpr_ok error_valid intv_valid A_const.
cbn in *; Daisy_compute; type_conv.
cbn in *; Flover_compute; type_conv.
eapply Rle_trans.
eapply const_abs_err_bounded; eauto.
rename R into error_valid.
......@@ -288,9 +288,9 @@ Lemma validErrorboundCorrectAddition E1 E2 A
validErrorbound (Binop Plus e1 e2) Gamma A dVars = true ->
(Q2R e1lo <= nR1 <= Q2R e1hi)%R ->
(Q2R e2lo <= nR2 <= Q2R e2hi)%R ->
DaisyMap.find e1 A = Some ((e1lo,e1hi),err1) ->
DaisyMap.find e2 A = Some ((e2lo, e2hi),err2) ->
DaisyMap.find (Binop Plus e1 e2) A = Some ((alo,ahi),e)->
FloverMap.find e1 A = Some ((e1lo,e1hi),err1) ->
FloverMap.find e2 A = Some ((e2lo, e2hi),err2) ->
FloverMap.find (Binop Plus e1 e2) A = Some ((alo,ahi),e)->
(Rabs (nR1 - nF1) <= (Q2R err1))%R ->
(Rabs (nR2 - nF2) <= (Q2R err2))%R ->
(Rabs (nR - nF) <= (Q2R e))%R.
......@@ -298,7 +298,7 @@ Proof.
intros mIsJoin e1_real e2_real eval_real e1_float e2_float eval_float
subexpr_ok valid_error valid_intv1 valid_intv2 A_e1 A_e2 A_add
err1_bounded err2_bounded.
cbn in *; Daisy_compute; type_conv.
cbn in *; Flover_compute; type_conv.
eapply Rle_trans.
eapply
(add_abs_err_bounded e1 e2);
......@@ -364,9 +364,9 @@ Lemma validErrorboundCorrectSubtraction E1 E2 A
validErrorbound (Binop Sub e1 e2) Gamma A dVars = true ->
(Q2R e1lo <= nR1 <= Q2R e1hi)%R ->
(Q2R e2lo <= nR2 <= Q2R e2hi)%R ->
DaisyMap.find e1 A = Some ((e1lo,e1hi),err1) ->
DaisyMap.find e2 A = Some ((e2lo, e2hi),err2) ->
DaisyMap.find (Binop Sub e1 e2) A = Some ((alo,ahi),e)->
FloverMap.find e1 A = Some ((e1lo,e1hi),err1) ->
FloverMap.find e2 A = Some ((e2lo, e2hi),err2) ->
FloverMap.find (Binop Sub e1 e2) A = Some ((alo,ahi),e)->
(Rabs (nR1 - nF1) <= (Q2R err1))%R ->
(Rabs (nR2 - nF2) <= (Q2R err2))%R ->
(Rabs (nR - nF) <= (Q2R e))%R.
......@@ -374,7 +374,7 @@ Proof.
intros mIsJoin e1_real e2_real eval_real e1_float e2_float eval_float
subexpr_ok valid_error valid_intv1 valid_intv2 A_e1 A_e2 A_sub
err1_bounded err2_bounded.
cbn in *; Daisy_compute; type_conv.
cbn in *; Flover_compute; type_conv.
eapply Rle_trans.
eapply (subtract_abs_err_bounded e1 e2); try eauto.
pose proof (typingSoundnessExp _ _ R2 e1_float).
......@@ -904,9 +904,9 @@ Lemma validErrorboundCorrectMult E1 E2 A
validErrorbound (Binop Mult e1 e2) Gamma A dVars = true ->
(Q2R e1lo <= nR1 <= Q2R e1hi)%R ->
(Q2R e2lo <= nR2 <= Q2R e2hi)%R ->
DaisyMap.find e1 A = Some ((e1lo,e1hi),err1) ->
DaisyMap.find e2 A = Some ((e2lo, e2hi),err2) ->
DaisyMap.find (Binop Mult e1 e2) A = Some ((alo,ahi),e)->
FloverMap.find e1 A = Some ((e1lo,e1hi),err1) ->
FloverMap.find e2 A = Some ((e2lo, e2hi),err2) ->
FloverMap.find (Binop Mult e1 e2) A = Some ((alo,ahi),e)->
(Rabs (nR1 - nF1) <= (Q2R err1))%R ->
(Rabs (nR2 - nF2) <= (Q2R err2))%R ->
(Rabs (nR - nF) <= (Q2R e))%R.
......@@ -914,7 +914,7 @@ Proof.
intros mIsJoin e1_real e2_real eval_real e1_float e2_float eval_float
subexpr_ok valid_error valid_e1 valid_e2 A_e1 A_e2 A_mult
err1_bounded err2_bounded.
cbn in *; Daisy_compute; type_conv; subst.
cbn in *; Flover_compute; type_conv; subst.
eapply Rle_trans.
eapply (mult_abs_err_bounded e1 e2); eauto.
pose proof (typingSoundnessExp _ _ R2 e1_float).
......@@ -983,9 +983,9 @@ Lemma validErrorboundCorrectDiv E1 E2 A
(Q2R e1lo <= nR1 <= Q2R e1hi)%R ->
(Q2R e2lo <= nR2 <= Q2R e2hi)%R ->
(Qleb e2hi 0 && negb (Qeq_bool e2hi 0) || Qleb 0 e2lo && negb (Qeq_bool e2lo 0) = true) ->
DaisyMap.find e1 A = Some ((e1lo,e1hi),err1) ->
DaisyMap.find e2 A = Some ((e2lo, e2hi),err2) ->
DaisyMap.find (Binop Div e1 e2) A = Some ((alo,ahi),e)->
FloverMap.find e1 A = Some ((e1lo,e1hi),err1) ->
FloverMap.find e2 A = Some ((e2lo, e2hi),err2) ->
FloverMap.find (Binop Div e1 e2) A = Some ((alo,ahi),e)->
(Rabs (nR1 - nF1) <= (Q2R err1))%R ->
(Rabs (nR2 - nF2) <= (Q2R err2))%R ->
(Rabs (nR - nF) <= (Q2R e))%R.
......@@ -993,7 +993,7 @@ Proof.
intros mIsJoin e1_real e2_real eval_real e1_float e2_float eval_float
subexpr_ok valid_error valid_bounds_e1 valid_bounds_e2 no_div_zero_real A_e1
A_e2 A_div err1_bounded err2_bounded.
cbn in *; Daisy_compute; type_conv; subst.
cbn in *; Flover_compute; type_conv; subst.
eapply Rle_trans.
eapply (div_abs_err_bounded e1 e2); eauto.
pose proof (typingSoundnessExp _ _ R2 e1_float).
......@@ -1909,10 +1909,10 @@ Lemma validErrorboundCorrectFma E1 E2 A
(Q2R e1lo <= nR1 <= Q2R e1hi)%R ->
(Q2R e2lo <= nR2 <= Q2R e2hi)%R ->
(Q2R e3lo <= nR3 <= Q2R e3hi)%R ->
DaisyMap.find e1 A = Some ((e1lo,e1hi),err1) ->
DaisyMap.find e2 A = Some ((e2lo, e2hi),err2) ->
DaisyMap.find e3 A = Some ((e3lo, e3hi),err3) ->
DaisyMap.find (Fma e1 e2 e3) A = Some ((alo,ahi),e)->
FloverMap.find e1 A = Some ((e1lo,e1hi),err1) ->
FloverMap.find e2 A = Some ((e2lo, e2hi),err2) ->
FloverMap.find e3 A = Some ((e3lo, e3hi),err3) ->
FloverMap.find (Fma e1 e2 e3) A = Some ((alo,ahi),e)->
(Rabs (nR1 - nF1) <= (Q2R err1))%R ->
(Rabs (nR2 - nF2) <= (Q2R err2))%R ->
(Rabs (nR3 - nF3) <= (Q2R err3))%R ->
......@@ -1921,7 +1921,7 @@ Proof.
intros mIsJoin e1_real e2_real e3_real eval_real e1_float e2_float e3_float eval_float
subexpr_ok valid_error valid_e1 valid_e2 valid_e3 A_e1 A_e2 A_e3 A_fma
err1_bounded err2_bounded err3_bounded.
cbn in *; Daisy_compute; type_conv; subst.
cbn in *; Flover_compute; type_conv; subst.
eapply Rle_trans.
eapply (fma_abs_err_bounded e1 e2 e3); eauto.
pose proof (typingSoundnessExp _ _ R4 e1_float).
......@@ -2002,14 +2002,14 @@ Lemma validErrorboundCorrectRounding E1 E2 A (e: exp Q) (nR nF nF1: R) (err err'
typeCheck (Downcast machineEpsilon e) defVars Gamma = true ->
validErrorbound (Downcast machineEpsilon e) Gamma A dVars = true ->
(Q2R elo <= nR <= Q2R ehi)%R ->
DaisyMap.find e A = Some ((elo, ehi), err) ->
DaisyMap.find (Downcast machineEpsilon e) A = Some ((alo, ahi), err') ->
FloverMap.find e A = Some ((elo, ehi), err) ->
FloverMap.find (Downcast machineEpsilon e) A = Some ((alo, ahi), err') ->
(Rabs (nR - nF1) <= (Q2R err))%R ->
(Rabs (nR - nF) <= (Q2R err'))%R.
Proof.
intros eval_real eval_float eval_float_rnd subexpr_ok valid_error valid_intv
A_e A_rnd err_bounded.
cbn in *; Daisy_compute; type_conv; subst.
cbn in *; Flover_compute; type_conv; subst.
eapply Rle_trans.
eapply round_abs_err_bounded; eauto.
assert (contained nR (Q2R elo, Q2R ehi)) as valid_intv_c by (auto).
......@@ -2054,7 +2054,7 @@ Theorem validErrorbound_sound (e:exp Q):
dVars_range_valid dVars E1 A ->
fVars_P_sound fVars E1 P ->
vars_typed (NatSet.union fVars dVars) defVars ->
DaisyMap.find e A = Some ((elo,ehi),err) ->
FloverMap.find e A = Some ((elo,ehi),err) ->
(exists nF m,
eval_exp E2 defVars (toRExp e) nF m) /\
(forall nF m,
......@@ -2075,13 +2075,13 @@ Proof.
+ intros * eval_float.
eapply validErrorboundCorrectConstant; eauto.
pose proof (typingSoundnessExp _ _ typing_ok eval_float).
cbn in *; Daisy_compute; type_conv; eauto.
cbn in *; Flover_compute; type_conv; eauto.
- simpl in *.
rewrite A_eq in valid_error.
cbn in *; Daisy_compute; try congruence; type_conv; subst.
cbn in *; Flover_compute; try congruence; type_conv; subst.
destruct u; try congruence.
inversion eval_real; subst.
rewrite <- andb_lazy_alt in R0; Daisy_compute.
rewrite <- andb_lazy_alt in R0; Flover_compute.
destruct (IHe E1 E2 fVars dVars A v1 e1 P (fst i0) (snd i0) Gamma defVars) as [[nF [mF eval_float]] valid_bounds_e];
eauto.
+ destruct i0; auto.
......@@ -2094,7 +2094,7 @@ Proof.
canonize_hyps.
rewrite R; eapply valid_bounds_e; eauto.
- cbn in *. rewrite A_eq in *.
Daisy_compute; try congruence; type_conv; subst; simpl in *.
Flover_compute; try congruence; type_conv; subst; simpl in *.
inversion eval_real; subst.
assert (m0 = M0 /\ m3 = M0) as [? ?] by (split; eapply toRMap_eval_M0; eauto); subst.
destruct i as [ivlo1 ivhi1]; destruct i1 as [ivlo2 ivhi2];
......@@ -2148,24 +2148,24 @@ Proof.
inversion Heqo1; subst.
destruct b.
* eapply (validErrorboundCorrectAddition (e1:=e1) A); eauto.
{ cbn. instantiate (1:=Gamma). Daisy_compute.
{ cbn. instantiate (1:=Gamma). Flover_compute.
rewrite mTypeEq_refl, R3, R4; auto. }
{ cbn. instantiate (1:=dVars); Daisy_compute.
{ cbn. instantiate (1:=dVars); Flover_compute.
rewrite L, L2, R1; simpl; auto. }
* eapply (validErrorboundCorrectSubtraction (e1:=e1) A); eauto.
{ cbn; instantiate (1:=Gamma); Daisy_compute; auto.
{ cbn; instantiate (1:=Gamma); Flover_compute; auto.
rewrite mTypeEq_refl, R3, R4; auto. }
{ cbn; instantiate (1:=dVars); Daisy_compute.
{ cbn; instantiate (1:=dVars); Flover_compute.
rewrite L, L2, R1; simpl; auto. }
* eapply (validErrorboundCorrectMult (e1 := e1) A); eauto.
{ cbn; instantiate (1:=Gamma); Daisy_compute; auto.
{ cbn; instantiate (1:=Gamma); Flover_compute; auto.
rewrite mTypeEq_refl, R3, R4; auto. }
{ cbn; instantiate (1:=dVars); Daisy_compute.
{ cbn; instantiate (1:=dVars); Flover_compute.
rewrite L, L2, R1; simpl; auto. }
* eapply (validErrorboundCorrectDiv (e1 := e1) A); eauto.
{ cbn; instantiate (1:=Gamma); Daisy_compute; auto.
{ cbn; instantiate (1:=Gamma); Flover_compute; auto.
rewrite mTypeEq_refl, R3, R4; auto. }
{ cbn; instantiate (1:=dVars); Daisy_compute.
{ cbn; instantiate (1:=dVars); Flover_compute.
rewrite L, L2,L4, R1; simpl; auto. }
{ andb_to_prop R; auto. }
(*- simpl in valid_error.
......@@ -2187,7 +2187,7 @@ Proof.
end.
type_conv.*)
- cbn in *. rewrite A_eq in *.
Daisy_compute; try congruence; type_conv; subst; simpl in *.
Flover_compute; try congruence; type_conv; subst; simpl in *.
inversion eval_real; subst.
assert (m0 = M0 /\ m4 = M0 /\ m5 = M0) as [? [? ?]] by (split; try split; eapply toRMap_eval_M0; eauto); subst.
destruct i as [ivlo1 ivhi1]; destruct i2 as [ivlo2 ivhi2]; destruct i1 as [ivlo3 ivhi3];
......@@ -2242,7 +2242,7 @@ Proof.
inversion Heqo1.
rewrite <- H0.
auto. }
- cbn in *; Daisy_compute; try congruence; type_conv; subst.
- cbn in *; Flover_compute; try congruence; type_conv; subst.
inversion eval_real; subst.
apply M0_least_precision in H1.
subst.
......@@ -2272,9 +2272,9 @@ Proof.
* simpl. eapply Downcast_dist'; eauto.
constructor. unfold updDefVars. rewrite Nat.eqb_refl; auto.
unfold updEnv; simpl; auto.
* cbn; instantiate (1:=Gamma); Daisy_compute.
* cbn; instantiate (1:=Gamma); Flover_compute.
rewrite mTypeEq_refl, R3, R0; eauto.
* cbn; instantiate (1:=dVars); Daisy_compute.
* cbn; instantiate (1:=dVars); Flover_compute.
rewrite L2, L3; auto.
Unshelve.
intros. auto.
......@@ -2292,14 +2292,14 @@ Theorem validErrorboundCmd_gives_eval (f:cmd Q) :
dVars_range_valid dVars E1 A ->
fVars_P_sound fVars E1 P ->
vars_typed (NatSet.union fVars dVars) defVars ->
DaisyMap.find (getRetExp f) A = Some ((elo,ehi),err) ->
FloverMap.find (getRetExp f) A = Some ((elo,ehi),err) ->
(exists vF m,
bstep (toRCmd f) E2 defVars vF m).
Proof.
induction f;
intros * type_f approxc1c2 ssa_f freeVars_subset eval_real valid_bounds
valid_intv fVars_sound P_valid types_defined A_res;
cbn in *; Daisy_compute; try congruence; type_conv; subst.