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 ...@@ -14,7 +14,7 @@ coq/*.vo
coq/.* coq/.*
coq/*.v.d coq/*.v.d
coq/*/*.v.d coq/*/*.v.d
coq/Makefile coq/Makefile*
coq/*/*.glob coq/*/*.glob
coq/*/.* coq/*/.*
coq/*/*.vo coq/*/*.vo
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
used to verify analsysis result in the final theorem of a certificate. used to verify analsysis result in the final theorem of a certificate.
**) **)
Require Import Coq.Reals.Reals. Require Import Coq.Reals.Reals.
Require Import Daisy.Infra.Abbrevs Daisy.Infra.RealConstruction Daisy.Infra.RealSimps. Require Import Flover.Infra.Abbrevs Flover.Infra.RealConstruction Flover.Infra.RealSimps.
Require Import Daisy.IntervalArith Daisy.Expressions Daisy.Commands. Require Import Flover.IntervalArith Flover.Expressions Flover.Commands.
Definition abs_env:Type := exp R -> interval -> err -> Prop. 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 Coq.Reals.Reals.
Require Import Daisy.Infra.Abbrevs Daisy.Expressions. Require Import Flover.Infra.Abbrevs Flover.Expressions.
(** (**
Next define what a program is. Next define what a program is.
Currently no loops, only conditionals and assignments Currently no loops, only conditionals and assignments
...@@ -15,7 +15,7 @@ Let: nat -> exp V -> cmd V -> cmd V ...@@ -15,7 +15,7 @@ Let: nat -> exp V -> cmd V -> cmd V
| Nop: 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 := Inductive sstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop :=
let_s x e s env v eps: let_s x e s env v eps:
...@@ -31,7 +31,7 @@ Inductive sstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop := ...@@ -31,7 +31,7 @@ Inductive sstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop :=
eval_exp eps env e v -> eval_exp eps env e v ->
sstep (Ret R e) env eps (Nop R) (updEnv 0 v env). 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 parametric by the evaluation function
**) **)
Inductive bstep : cmd R -> env_ty -> R -> cmd R -> env_ty -> Prop := 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 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. Set Implicit Arguments.
Module Type Expression. Module Type Expression.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Precondition agreement checker and its soundness proof Precondition agreement checker and its soundness proof
**) **)
Require Import Coq.Reals.Reals Coq.Lists.List Coq.QArith.QArith. 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. Import Lists.List.ListNotations.
......
Require Import Daisy.CertificateChecker. Require Import Flover.CertificateChecker.
(* (*
TODO: update according to: TODO: update according to:
[ Info ] [ Info ]
......
Require Import Daisy.CertificateChecker. Require Import Flover.CertificateChecker.
(* (*
[ Info ] [ Info ]
......
Require Import Coq.Reals.Reals. 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: Notes:
......
Require Import Coq.Reals.Reals. Require Import Coq.Reals.Reals.
Require Import Interval.Interval_tactic. 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 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)). Definition max4 (a:R) (b:R) (c:R) (d:R) := Rmax a (Rmax b (Rmax c d)).
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Toy Example to understand what certificate we will need for a given program Toy Example to understand what certificate we will need for a given program
**) **)
Require Import Coq.Reals.Reals. 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 := Definition prg :cmd R :=
Ret R (Binop Mult (Const (3%R)) (Var R 1)). Ret R (Binop Mult (Const (3%R)) (Var R 1)).
......
...@@ -2,7 +2,7 @@ open preamble ...@@ -2,7 +2,7 @@ open preamble
open machine_ieeeTheory binary_ieeeTheory lift_ieeeTheory realTheory 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 open FPRangeValidatorTheory IntervalValidationTheory TypingTheory ErrorValidationTheory IntervalArithTheory AbbrevsTheory
......
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
as shown in the soundness theorem. as shown in the soundness theorem.
**) **)
Require Import Coq.Reals.Reals Coq.QArith.Qreals. Require Import Coq.Reals.Reals Coq.QArith.Qreals.
Require Import Daisy.Infra.RealSimps Daisy.Infra.RationalSimps Daisy.Infra.RealRationalProps Daisy.Infra.Ltacs. Require Import Flover.Infra.RealSimps Flover.Infra.RationalSimps Flover.Infra.RealRationalProps Flover.Infra.Ltacs.
Require Import Daisy.IntervalValidation Daisy.ErrorValidation Daisy.Environments Daisy.Typing Daisy.FPRangeValidator. Require Import Flover.IntervalValidation Flover.ErrorValidation Flover.Environments Flover.Typing Flover.FPRangeValidator.
Require Export Coq.QArith.QArith. Require Export Coq.QArith.QArith.
Require Export Daisy.Infra.ExpressionAbbrevs Daisy.Commands. Require Export Flover.Infra.ExpressionAbbrevs Flover.Commands.
(** Certificate checking function **) (** Certificate checking function **)
Definition CertificateChecker (e:exp Q) (absenv:analysisResult) (P:precond) (defVars:nat -> option mType) := 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) if (typeCheck e defVars tMap)
then then
if (validIntervalbounds e absenv P NatSet.empty) && FPRangeValidator e absenv tMap NatSet.empty 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 ...@@ -37,7 +37,7 @@ Theorem Certificate_checking_is_sound (e:exp Q) (absenv:analysisResult) P defVar
defVars v = Some m) -> defVars v = Some m) ->
CertificateChecker e absenv P defVars = true -> CertificateChecker e absenv P defVars = true ->
exists iv err vR vF m, 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 E1 (toRMap defVars) (toREval (toRExp e)) vR M0 /\
eval_exp E2 defVars (toRExp e) vF m /\ eval_exp E2 defVars (toRExp e) vF m /\
(forall vF m, (forall vF m,
...@@ -67,12 +67,12 @@ Proof. ...@@ -67,12 +67,12 @@ Proof.
edestruct (validIntervalbounds_sound e (A:=absenv) (P:=P) (fVars:=usedVars e) (dVars:=NatSet.empty) (Gamma:=defVars) (E:=E1)) 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. as [iv_e [ err_e [vR [ map_e [eval_real real_bounds_e]]]]]; eauto.
destruct iv_e as [elo ehi]. 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. exists (elo, ehi), err_e, vR, vF, mF; split; auto.
Qed. Qed.
Definition CertificateCheckerCmd (f:cmd Q) (absenv:analysisResult) (P:precond) defVars:= 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)) if (typeCheckCmd f defVars tMap && validSSA f (freeVars f))
then then
if (validIntervalboundsCmd f absenv P NatSet.empty) && if (validIntervalboundsCmd f absenv P NatSet.empty) &&
...@@ -92,7 +92,7 @@ Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P d ...@@ -92,7 +92,7 @@ Theorem Certificate_checking_cmds_is_sound (f:cmd Q) (absenv:analysisResult) P d
defVars v = Some m) -> defVars v = Some m) ->
CertificateCheckerCmd f absenv P defVars = true -> CertificateCheckerCmd f absenv P defVars = true ->
exists iv err vR vF m, 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 (toREvalCmd (toRCmd f)) E1 (toRMap defVars) vR M0 /\
bstep (toRCmd f) E2 defVars vF m /\ bstep (toRCmd f) E2 defVars vF m /\
(forall 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. Require Import Coq.extraction.ExtrOcamlString Coq.extraction.ExtrOcamlBasic Coq.extraction.ExtrOcamlNatBigInt Coq.extraction.ExtrOcamlZBigInt.
Extraction Language Ocaml. 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 Coq.Reals.Reals Coq.QArith.QArith.
Require Import Daisy.Expressions. Require Import Flover.Expressions.
Require Export Daisy.Infra.ExpressionAbbrevs Daisy.Infra.NatSet. Require Export Flover.Infra.ExpressionAbbrevs Flover.Infra.NatSet.
(** (**
Next define what a program is. Next define what a program is.
...@@ -35,7 +35,7 @@ Fixpoint toREvalCmd (f:cmd R) := ...@@ -35,7 +35,7 @@ Fixpoint toREvalCmd (f:cmd R) :=
(* (*
UNUSED! UNUSED!
Small Step semantics for Daisy language Small Step semantics for Flover language
Inductive sstep : cmd R -> env -> R -> cmd R -> env -> Prop := Inductive sstep : cmd R -> env -> R -> cmd R -> env -> Prop :=
let_s x e s E v eps: let_s x e s E v eps:
eval_exp eps E e v -> eval_exp eps E e v ->
...@@ -46,7 +46,7 @@ Inductive sstep : cmd R -> env -> R -> cmd R -> env -> Prop := ...@@ -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 result value
**) **)
Inductive bstep : cmd R -> env -> (nat -> option mType) -> R -> mType -> Prop := Inductive bstep : cmd R -> env -> (nat -> option mType) -> R -> mType -> Prop :=
......
(** (**
Environment library. 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 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. Define an approximation relation between two environments.
...@@ -22,7 +22,7 @@ Inductive approxEnv : env -> (nat -> option mType) -> analysisResult -> NatSet.t ...@@ -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) 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: |approxUpdBound E1 E2 defVars A v1 v2 x fVars dVars m iv err:
approxEnv E1 defVars A fVars dVars E2 -> 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 -> (Rabs (v1 - v2) <= Q2R err)%R ->
NatSet.mem x (NatSet.union fVars dVars) = false -> 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). 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. ...@@ -102,7 +102,7 @@ Section RelationProperties.
E2 x = Some v2 -> E2 x = Some v2 ->
NatSet.In x dVars -> NatSet.In x dVars ->
Gamma x = Some m -> 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. (Rabs (v - v2) <= Q2R e)%R.
Proof. Proof.
induction approxEnvs; induction approxEnvs;
......
...@@ -4,8 +4,8 @@ This shortens soundness proofs later. ...@@ -4,8 +4,8 @@ This shortens soundness proofs later.
Bounds are explained in section 5, Deriving Computable Error Bounds 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 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 Flover.Infra.Abbrevs Flover.Infra.RationalSimps Flover.Infra.RealSimps Flover.Infra.RealRationalProps.
Require Import Daisy.Environments Daisy.Infra.ExpressionAbbrevs. Require Import Flover.Environments Flover.Infra.ExpressionAbbrevs.
Lemma const_abs_err_bounded (n:R) (nR:R) (nF:R) (E1 E2:env) (m:mType) defVars: Lemma const_abs_err_bounded (n:R) (nR:R) (nF:R) (E1 E2:env) (m:mType) defVars:
......
This diff is collapsed.
(** (**
Formalization of the base expression language for the daisy framework Formalization of the base expression language for the flover framework
**) **)
From Coq From Coq
Require Import Reals.Reals micromega.Psatz QArith.QArith QArith.Qreals Require Import Reals.Reals micromega.Psatz QArith.QArith QArith.Qreals
Structures.Orders. Structures.Orders.
Require Import Daisy.Infra.RealRationalProps Daisy.Infra.RationalSimps Require Import Flover.Infra.RealRationalProps Flover.Infra.RationalSimps
Daisy.Infra.Ltacs. Flover.Infra.Ltacs.
Require Export Daisy.Infra.Abbrevs Daisy.Infra.RealSimps Daisy.Infra.NatSet Require Export Flover.Infra.Abbrevs Flover.Infra.RealSimps Flover.Infra.NatSet
Daisy.IntervalArithQ Daisy.IntervalArith Daisy.Infra.MachineType. Flover.IntervalArithQ Flover.IntervalArith Flover.Infra.MachineType.
(** (**
Expressions will use binary operators. Expressions will use binary operators.
...@@ -180,7 +180,7 @@ Proof. ...@@ -180,7 +180,7 @@ Proof.
destruct f; intros g eq1 eq2; destruct f; intros g eq1 eq2;
destruct g; cbn in *; destruct g; cbn in *;
try rewrite Nat.eqb_eq in *; try rewrite Nat.eqb_eq in *;
Daisy_compute; try congruence; type_conv; subst; try auto. Flover_compute; try congruence; type_conv; subst; try auto.
- rewrite mTypeEq_refl; simpl. - rewrite mTypeEq_refl; simpl.
rewrite Qeq_bool_iff in *; lra. rewrite Qeq_bool_iff in *; lra.
- rewrite unopEq_compat_eq in *; subst. - rewrite unopEq_compat_eq in *; subst.
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
Require Import Coq.QArith.QArith Coq.QArith.Qreals Coq.Reals.Reals Coq.micromega.Psatz. Require Import Coq.QArith.QArith Coq.QArith.Qreals Coq.Reals.Reals Coq.micromega.Psatz.
Require Import Daisy.Infra.MachineType Daisy.Typing Daisy.Infra.RealSimps Daisy.IntervalValidation Daisy.ErrorValidation Daisy.Commands Daisy.Environments Daisy.ssaPrgs Daisy.Infra.Ltacs Daisy.Infra.RealRationalProps. Require Import Flover.Infra.MachineType Flover.Typing Flover.Infra.RealSimps Flover.IntervalValidation Flover.ErrorValidation Flover.Commands Flover.Environments Flover.ssaPrgs Flover.Infra.Ltacs Flover.Infra.RealRationalProps.
Fixpoint FPRangeValidator (e:exp Q) (A:analysisResult) typeMap dVars {struct e} : bool := Fixpoint FPRangeValidator (e:exp Q) (A:analysisResult) typeMap dVars {struct e} : bool :=
match DaisyMap.find e typeMap, DaisyMap.find e A with match FloverMap.find e typeMap, FloverMap.find e A with
|Some m, Some (iv_e, err_e) => |Some m, Some (iv_e, err_e) =>
let iv_e_float := widenIntv iv_e err_e in let iv_e_float := widenIntv iv_e err_e in
let recRes := let recRes :=
...@@ -84,13 +84,13 @@ Theorem FPRangeValidator_sound: ...@@ -84,13 +84,13 @@ Theorem FPRangeValidator_sound:
fVars_P_sound fVars E1 P -> fVars_P_sound fVars E1 P ->
vars_typed (NatSet.union fVars dVars) Gamma -> vars_typed (NatSet.union fVars dVars) Gamma ->
(forall v, NatSet.In v dVars -> (forall v, NatSet.In v dVars ->
exists vF m, E2 v = Some vF /\ DaisyMap.find (Var Q v) tMap = Some m /\ validFloatValue vF m) -> exists vF m, E2 v = Some vF /\ FloverMap.find (Var Q v) tMap = Some m /\ validFloatValue vF m) ->
validFloatValue v m. validFloatValue v m.
Proof. Proof.
intros *. intros *.
unfold FPRangeValidator. unfold FPRangeValidator.
intros. intros.
assert (DaisyMap.find e tMap = Some m) assert (FloverMap.find e tMap = Some m)
as type_e as type_e
by (eapply typingSoundnessExp; eauto). by (eapply typingSoundnessExp; eauto).
unfold validFloatValue. unfold validFloatValue.
...@@ -116,20 +116,20 @@ Proof. ...@@ -116,20 +116,20 @@ Proof.
inversion H0; subst. inversion H0; subst.
rewrite env_eq in H14; inversion H14; subst. rewrite env_eq in H14; inversion H14; subst.
rewrite map_eq in type_e; inversion type_e; subst; auto. rewrite map_eq in type_e; inversion type_e; subst; auto.
+ Daisy_compute. + Flover_compute.
prove_fprangeval m v L1 R. prove_fprangeval m v L1 R.
- Daisy_compute. - Flover_compute.
prove_fprangeval m v L1 R. prove_fprangeval m v L1 R.
- Daisy_compute; try congruence. - Flover_compute; try congruence.
type_conv; subst. type_conv; subst.
prove_fprangeval m0 v L1 R. prove_fprangeval m0 v L1 R.
- Daisy_compute; try congruence. - Flover_compute; try congruence.
type_conv; subst. type_conv; subst.
prove_fprangeval (join m0 m1) v L1 R. prove_fprangeval (join m0 m1) v L1 R.
- Daisy_compute; try congruence. - Flover_compute; try congruence.
type_conv; subst. type_conv; subst.
prove_fprangeval (join3 m0 m1 m2) v L1 R. prove_fprangeval (join3 m0 m1 m2) v L1 R.
- Daisy_compute; try congruence. - Flover_compute; try congruence.
type_conv; subst. type_conv; subst.
prove_fprangeval m v L1 R. prove_fprangeval m v L1 R.
Qed. Qed.
...@@ -149,7 +149,7 @@ Lemma FPRangeValidatorCmd_sound (f:cmd Q): ...@@ -149,7 +149,7 @@ Lemma FPRangeValidatorCmd_sound (f:cmd Q):
fVars_P_sound fVars E1 P -> fVars_P_sound fVars E1 P ->
vars_typed (NatSet.union fVars dVars) Gamma -> vars_typed (NatSet.union fVars dVars) Gamma ->
(forall v, NatSet.In v dVars -> (forall v, NatSet.In v dVars ->
exists vF m, E2 v = Some vF /\ DaisyMap.find (Var Q v) tMap = Some m /\ validFloatValue vF m) -> exists vF m, E2 v = Some vF /\ FloverMap.find (Var Q v) tMap = Some m /\ validFloatValue vF m) ->
validFloatValue v m. validFloatValue v m.
Proof. Proof.
induction f; intros; induction f; intros;
...@@ -159,10 +159,10 @@ Proof. ...@@ -159,10 +159,10 @@ Proof.
repeat match goal with repeat match goal with
| H : _ = true |- _ => andb_to_prop H | H : _ = true |- _ => andb_to_prop H
end. end.
- assert (DaisyMap.find e tMap = Some m) - assert (FloverMap.find e tMap = Some m)
by(eapply typingSoundnessExp; eauto). by(eapply typingSoundnessExp; eauto).
match_pat (ssa _ _ _) (fun H => inversion H; subst; simpl in *). match_pat (ssa _ _ _) (fun H => inversion H; subst; simpl in *).
Daisy_compute. Flover_compute.
edestruct (validIntervalbounds_sound e L1 (Gamma := Gamma)(P:= P) (A:=A) edestruct (validIntervalbounds_sound e L1 (Gamma := Gamma)(P:= P) (A:=A)
(fVars:=fVars) (dVars:=dVars) (fVars:=fVars) (dVars:=dVars)
(E:=E1)) (E:=E1))
......
This diff is collapsed.
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
This file contains some type abbreviations, to ease writing. This file contains some type abbreviations, to ease writing.
**) **)
Require Import Coq.Reals.Reals Coq.QArith.QArith Coq.QArith.Qreals. Require Import Coq.Reals.Reals Coq.QArith.QArith Coq.QArith.Qreals.
Require Import Daisy.Infra.MachineType. Require Import Flover.Infra.MachineType.
Global Set Implicit Arguments. Global Set Implicit Arguments.
(** (**
......
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
If we would put them in the Abbrevs file, this would create a circular dependency which Coq cannot resolve. If we would put them in the Abbrevs file, this would create a circular dependency which Coq cannot resolve.
**) **)
Require Import Coq.QArith.QArith Coq.Reals.Reals Coq.QArith.Qreals Coq.QArith.QOrderedType Coq.FSets.FMapAVL Coq.FSets.FMapFacts. Require Import Coq.QArith.QArith Coq.Reals.Reals Coq.QArith.Qreals Coq.QArith.QOrderedType Coq.FSets.FMapAVL Coq.FSets.FMapFacts.
Require Export Daisy.Infra.Abbrevs Daisy.Expressions. Require Export Flover.Infra.Abbrevs Flover.Expressions.
Module Q_orderedExps := ExpOrderedType (Q_as_OT). Module Q_orderedExps := ExpOrderedType (Q_as_OT).
Module legacy_OrderedQExps := Structures.OrdersAlt.Backport_OT (Q_orderedExps). Module legacy_OrderedQExps := Structures.OrdersAlt.Backport_OT (Q_orderedExps).
Module DaisyMap := FMapAVL.Make(legacy_OrderedQExps). Module FloverMap := FMapAVL.Make(legacy_OrderedQExps).
Module DaisyMapFacts := OrdProperties (DaisyMap). Module FloverMapFacts := OrdProperties (FloverMap).
Definition analysisResult :Type := DaisyMap.t (intv * error). Definition analysisResult :Type := FloverMap.t (intv * error).
(** (**
We treat a function mapping an expression arguing on fractions as value type We treat a function mapping an expression arguing on fractions as value type
......
(** Ltac definitions **) (** Ltac definitions **)
Require Import Coq.Bool.Bool Coq.Reals.Reals Coq.QArith.QArith Coq.QArith.Qreals. Require Import Coq.Bool.Bool Coq.Reals.Reals Coq.QArith.QArith Coq.QArith.Qreals.
Require Import Daisy.Infra.RealSimps Daisy.Infra.NatSet Daisy.Infra.RationalSimps Daisy.Infra.RealRationalProps. Require Import Flover.Infra.RealSimps Flover.Infra.NatSet Flover.Infra.RationalSimps Flover.Infra.RealRationalProps.
Ltac iv_assert iv name:= Ltac iv_assert iv name:=
assert (exists ivlo ivhi, iv = (ivlo, ivhi)) as name by (destruct iv; repeat eexists; auto). assert (exists ivlo ivhi, iv = (ivlo, ivhi)) as name by (destruct iv; repeat eexists; auto).
...@@ -109,7 +109,7 @@ Ltac bool_factorize := ...@@ -109,7 +109,7 @@ Ltac bool_factorize :=
| [H: _ = true |- _] => andb_to_prop H | [H: _ = true |- _] => andb_to_prop H
end. end.
Ltac Daisy_compute_asm := Ltac Flover_compute_asm :=
repeat ( repeat (
(try remove_conds; (try remove_conds;
try remove_matches; try remove_matches;
...@@ -117,7 +117,7 @@ Ltac Daisy_compute_asm := ...@@ -117,7 +117,7 @@ Ltac Daisy_compute_asm :=
try pair_factorize) || try pair_factorize) ||
bool_factorize). bool_factorize).
Ltac Daisy_compute := Ltac Flover_compute :=
repeat ( repeat (
(try remove_conds; (try remove_conds;
try remove_matches; try remove_matches;
...@@ -143,8 +143,8 @@ Ltac Daisy_compute := ...@@ -143,8 +143,8 @@ Ltac Daisy_compute :=
(* Ltac match_destr t:= *) (* Ltac match_destr t:= *)
(* match goal with *) (* match goal with *)
(* | H: context [optionLift (DaisyMap.find ?k ?M) _ _] |- _ => *) (* | H: context [optionLift (FloverMap.find ?k ?M) _ _] |- _ => *)
(* destruct (DaisyMap.find (elt:=intv * error) k M); idtac H *) (* destruct (FloverMap.find (elt:=intv * error) k M); idtac H *)
(* end. *) (* end. *)
Tactic Notation "match_pat" open_constr(pat) tactic(t) := Tactic Notation "match_pat" open_constr(pat) tactic(t) :=
......