Commit 36ce0269 authored by Heiko Becker's avatar Heiko Becker

Merge branch 'master' into 'master'

Add Interval Subdivision support

See merge request AVA/FloVer!19
parents 72bb2be1 66883af7
......@@ -11,7 +11,7 @@ Require Export Flover.Infra.ExpressionAbbrevs Flover.Infra.NatSet.
Only assignments and return statement
**)
Inductive cmd (V:Type) :Type :=
Let: mType -> nat -> expr V -> cmd V -> cmd V
Let: mType -> nat -> cmd V -> cmd V -> cmd V
| Ret: expr V -> cmd V.
Fixpoint getRetExp (V:Type) (f:cmd V) :=
......@@ -22,13 +22,13 @@ Fixpoint getRetExp (V:Type) (f:cmd V) :=
Fixpoint toRCmd (f:cmd Q) :=
match f with
|Let m x e g => Let m x (toRExp e) (toRCmd g)
|Let m x e g => Let m x (toRCmd e) (toRCmd g)
|Ret e => Ret (toRExp e)
end.
Fixpoint toREvalCmd (f:cmd R) :=
match f with
|Let m x e g => Let REAL x (toREval e) (toREvalCmd g)
|Let m x e g => Let REAL x (toREvalCmd e) (toREvalCmd g)
|Ret e => Ret (toREval e)
end.
......@@ -51,7 +51,7 @@ Inductive sstep : cmd R -> env -> R -> cmd R -> env -> Prop :=
Inductive bstep : cmd R -> env -> (expr R -> option mType) -> (R -> mType -> option R) ->
R -> mType -> Prop :=
let_b m m' x e s E v res defVars DeltaMap:
eval_expr E defVars DeltaMap e v m ->
bstep e E defVars DeltaMap v m ->
bstep s (updEnv x v E) defVars DeltaMap res m' -> (* (updDefVars (Var R x) m defVars) res m' -> *)
bstep (Let m x e s) E defVars DeltaMap res m'
|ret_b m e E v defVars DeltaMap:
......@@ -64,7 +64,7 @@ Inductive bstep : cmd R -> env -> (expr R -> option mType) -> (R -> mType -> opt
**)
Fixpoint freeVars V (f:cmd V) :NatSet.t :=
match f with
| Let _ x e1 g => NatSet.remove x (NatSet.union (Expressions.usedVars e1) (freeVars g))
| Let _ x e1 g => (freeVars e1 ) (NatSet.remove x (freeVars g))
| Ret e => Expressions.usedVars e
end.
......@@ -83,7 +83,7 @@ Fixpoint definedVars V (f:cmd V) :NatSet.t :=
**)
Fixpoint liveVars V (f:cmd V) :NatSet.t :=
match f with
| Let _ _ e g => NatSet.union (usedVars e) (liveVars g)
| Let _ _ e g => NatSet.union (liveVars e) (liveVars g)
| Ret e => usedVars e
end.
......@@ -95,11 +95,10 @@ Lemma bstep_eq_env f:
Proof.
induction f; intros * eq_envs bstep_E1;
inversion bstep_E1; subst; simpl in *.
- eapply eval_eq_env in H8; eauto. eapply let_b; eauto.
eapply IHf. instantiate (1:=(updEnv n v0 E1)).
+ intros; unfold updEnv.
destruct (x=? n); auto.
+ auto.
- econstructor; eauto.
apply (IHf2 (updEnv n v0 E1)); auto.
intros; unfold updEnv.
destruct (x=? n); auto.
- apply ret_b. eapply eval_eq_env; eauto.
Qed.
......@@ -108,11 +107,10 @@ Lemma swap_Gamma_bstep f E vR m Gamma1 Gamma2 DeltaMap:
bstep f E Gamma1 DeltaMap vR m ->
bstep f E Gamma2 DeltaMap vR m.
Proof.
revert E Gamma1 Gamma2 DeltaMap;
revert E Gamma1 Gamma2 DeltaMap vR m;
induction f; intros * Gamma_eq eval_f.
- inversion eval_f; subst.
econstructor; try eauto.
eapply swap_Gamma_eval_expr; eauto.
- inversion eval_f; subst.
econstructor; try eauto.
eapply swap_Gamma_eval_expr; eauto.
......@@ -127,7 +125,7 @@ Proof.
induction f; intros * eval_f1 eval_f2;
inversion eval_f1; subst;
inversion eval_f2; subst; try auto.
- eapply IHf; eauto.
- eapply IHf2; eauto.
- eapply Gamma_det; eauto.
Qed.
......@@ -141,6 +139,6 @@ Proof.
inversion eval_f1; subst;
inversion eval_f2; subst; try auto.
- replace v with v0 in * by eauto using eval_expr_functional.
eapply IHf; eauto.
eapply IHf2; eauto.
- eapply eval_expr_functional; eauto.
Qed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@ From Coq
Require Import Reals.Reals micromega.Psatz QArith.Qreals.
From Flover
Require Import Infra.ExpressionAbbrevs Infra.RationalSimps Commands.
Require Import Infra.ExpressionAbbrevs Infra.RationalSimps.
(**
Define an approximation relation between two environments.
......
......@@ -2,7 +2,7 @@ From Coq
Require Import Reals.Reals QArith.Qreals.
From Flover
Require Import Commands ExpressionSemantics Environments RealRangeArith TypeValidator.
Require Import ExpressionSemantics Environments RealRangeArith TypeValidator.
Fixpoint validErrorBoundsRec (e:expr Q) E1 E2 A Gamma DeltaMap :Prop :=
(match e with
......@@ -15,6 +15,18 @@ Fixpoint validErrorBoundsRec (e:expr Q) E1 E2 A Gamma DeltaMap :Prop :=
validErrorBoundsRec e1 E1 E2 A Gamma DeltaMap /\
validErrorBoundsRec e2 E1 E2 A Gamma DeltaMap /\
validErrorBoundsRec e3 E1 E2 A Gamma DeltaMap
| Let m x e1 e2 =>
validErrorBoundsRec e1 E1 E2 A Gamma DeltaMap /\
(forall v__R v__FP,
eval_expr E1 (toRTMap (toRExpMap Gamma)) DeltaMapR (toREval (toRExp e1)) v__R REAL ->
eval_expr E2 (toRExpMap Gamma) DeltaMap (toRExp e1) v__FP m ->
validErrorBoundsRec e2 (updEnv x v__R E1) (updEnv x v__FP E2) A Gamma DeltaMap)
(*
| Cond e1 e2 e3 =>
validErrorBounds e1 E1 E2 A Gamma DeltaMap /\
validErrorBounds e2 E1 E2 A Gamma DeltaMap /\
validErrorBounds e3 E1 E2 A Gamma DeltaMap
*)
| _ => True
end) /\
forall v__R (iv: intv) (err: error),
......@@ -48,7 +60,8 @@ Proof.
edestruct validError_e as (? & ? & ?); eauto.
Qed.
Fixpoint validErrorBoundsCmdRec (c: cmd Q) E1 E2 A Gamma DeltaMap: Prop :=
(*
Fixpoint validErrorBoundsCmd (c: cmd Q) E1 E2 A Gamma DeltaMap: Prop :=
match c with
| Let m x e k =>
validErrorBoundsRec e E1 E2 A Gamma DeltaMap /\
......@@ -92,3 +105,4 @@ Proof.
intros; destruct c; cbn in *; split;
edestruct validError_e as (? & ? & ?); eauto.
Qed.
*)
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
From Flover
Require Import Expressions Commands Environments ssaPrgs TypeValidator
Require Import Expressions Environments ssaPrgs TypeValidator
IntervalValidation RoundoffErrorValidator Infra.Ltacs Infra.RealRationalProps.
Fixpoint FPRangeValidator (e:expr Q) (A:analysisResult) typeMap dVars {struct e}
......@@ -19,6 +19,15 @@ Fixpoint FPRangeValidator (e:expr Q) (A:analysisResult) typeMap dVars {struct e}
| Unop u e =>
FPRangeValidator e A typeMap dVars
| Downcast m e => FPRangeValidator e A typeMap dVars
| Let _ x e1 e2 =>
FPRangeValidator e1 A typeMap dVars &&
FPRangeValidator e2 A typeMap (NatSet.add x dVars)
(*
| Cond e1 e2 e3 =>
FPRangeValidator e1 A typeMap dVars &&
FPRangeValidator e2 A typeMap dVars &&
FPRangeValidator e3 A typeMap dVars
*)
| _ => true
end
in
......@@ -44,6 +53,7 @@ Fixpoint FPRangeValidator (e:expr Q) (A:analysisResult) typeMap dVars {struct e}
| _, _ => false
end.
(*
Fixpoint FPRangeValidatorCmd (f:cmd Q) (A:analysisResult) typeMap dVars :=
match f with
| Let m n e g =>
......@@ -52,6 +62,7 @@ Fixpoint FPRangeValidatorCmd (f:cmd Q) (A:analysisResult) typeMap dVars :=
else false
| Ret e => FPRangeValidator e A typeMap dVars
end.
*)
Ltac prove_fprangeval m v :=
destruct m eqn:?; try auto;
......@@ -87,6 +98,8 @@ Fixpoint validFPRanges (e:expr Q) (E2:env) Gamma A :Prop :=
validFPRanges e2 E2 Gamma A /\
validFPRanges e3 E2 Gamma A
| Downcast m e => validFPRanges e E2 Gamma A
(* FIXME *)
| Let _ _ _ _ => False
end) /\
forall E1 DeltaMap v m fVars dVars,
(forall (v : R) (m' : mType),
......@@ -116,7 +129,7 @@ Qed.
Theorem FPRangeValidator_sound e:
forall E2 A Gamma dVars fVars,
FPRangeValidator e A Gamma dVars = true ->
NatSet.Subset (NatSet.diff (usedVars e) dVars) fVars ->
NatSet.Subset (NatSet.diff (freeVars e) dVars) fVars ->
(forall v, NatSet.In v dVars ->
exists vF m, E2 v = Some vF /\
FloverMap.find (Var Q v) Gamma = Some m /\
......@@ -149,6 +162,8 @@ Proof.
unfold FPRangeValidator in *.
Flover_compute.
destruct (n mem dVars) eqn:?.
(*
<<<<<<< HEAD
+ set_tac. edestruct dVars_valid as [? [? [? [? ?]]]]; eauto.
rewrite type_e in *. inversion H2; subst.
inversion eval_float; subst.
......@@ -288,8 +303,95 @@ Proof.
unfold FPRangeValidator in *.
Flover_compute.
prove_fprangeval m0 v.
||||||| merged common ancestors
+ set_tac. edestruct H7 as [? [? [? [? ?]]]]; eauto.
rewrite H11 in type_e; inversion type_e; subst.
inversion H1; subst.
rewrite H15 in H10; inversion H10; subst.
auto.
+ Flover_compute. prove_fprangeval m v L1 R.
- Flover_compute; try congruence.
type_conv; subst.
prove_fprangeval m v L1 R.
- Flover_compute; try congruence.
type_conv; subst.
prove_fprangeval m v L1 R.
- inversion H1; subst.
destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [m_e1 [m_e2 [find_m1 [find_m2 join_valid]]]]]] _ ]]].
assert (m_e1 = m1) by (eapply validTypes_exec in find_m1; eauto).
assert (m_e2 = m2) by (eapply validTypes_exec in find_m2; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m (perturb (evalBinop b v1 v2) m delta) L1 R.
- inversion H1; subst.
destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [validt_e3 [m_e1 [m_e2 [m_e3 [find_m1 [find_m2 [find_m3 join_valid]]]]]]]]] _ ]]].
assert (m_e1 = m1) by (eapply validTypes_exec in find_m1; eauto).
assert (m_e2 = m2) by (eapply validTypes_exec in find_m2; eauto).
assert (m_e3 = m3) by (eapply validTypes_exec in find_m3; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m (perturb (evalFma v1 v2 v3) m delta) L1 R.
- Flover_compute; try congruence.
type_conv; subst.
prove_fprangeval m v L1 R.
=======
+ set_tac. edestruct H7 as [? [? [? [? ?]]]]; eauto.
rewrite H11 in type_e; inversion type_e; subst.
inversion H1; subst.
rewrite H15 in H10; inversion H10; subst.
auto.
+ Flover_compute. prove_fprangeval m v L1 R.
- Flover_compute; try congruence.
type_conv; subst.
prove_fprangeval m v L1 R.
- Flover_compute; try congruence.
type_conv; subst.
prove_fprangeval m v L1 R.
- inversion H1; subst.
destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [m_e1 [m_e2 [find_m1 [find_m2 join_valid]]]]]] _ ]]].
assert (m_e1 = m1) by (eapply validTypes_exec in find_m1; eauto).
assert (m_e2 = m2) by (eapply validTypes_exec in find_m2; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m (perturb (evalBinop b v1 v2) m delta) L1 R.
- inversion H1; subst.
destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [validt_e3 [m_e1 [m_e2 [m_e3 [find_m1 [find_m2 [find_m3 join_valid]]]]]]]]] _ ]]].
assert (m_e1 = m1) by (eapply validTypes_exec in find_m1; eauto).
assert (m_e2 = m2) by (eapply validTypes_exec in find_m2; eauto).
assert (m_e3 = m3) by (eapply validTypes_exec in find_m3; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m (perturb (evalFma v1 v2 v3) m delta) L1 R.
- Flover_compute; try congruence.
type_conv; subst.
prove_fprangeval m v L1 R.
- inversion H1; subst.
destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [m_e2 [find_e1 [find_var [find_m2 join_valid]]]]]] _ ]]].
assert (m_e2 = m2) by (eapply validTypes_exec in find_m2; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m v L1 R.
(*
- inversion H1; subst.
+ destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [validt_e3 [m_e1 [m_e2 [m_e3 [find_m1 [find_m2 [find_m3 join_valid]]]]]]]]] _ ]]].
assert (m_e1 = m1) by (eapply validTypes_exec in find_m1; eauto).
assert (m_e2 = m2) by (eapply validTypes_exec in find_m2; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m v L1 R.
+ destruct H2 as [mE [find_mE [[validt_e1 [validt_e2 [validt_e3 [m_e1 [m_e2 [m_e3 [find_m1 [find_m2 [find_m3 join_valid]]]]]]]]] _ ]]].
assert (m_e1 = m1) by (eapply validTypes_exec in find_m1; eauto).
assert (m_e3 = m3) by (eapply validTypes_exec in find_m3; eauto).
subst.
Flover_compute; try congruence.
prove_fprangeval m v L1 R.
*)
>>>>>>> exprMerge
Qed.
*)
Admitted.
(*
Lemma FPRangeValidatorCmd_sound (f:cmd Q):
forall E1 E2 Gamma DeltaMap v vR m A fVars dVars outVars,
(forall (v : R) (m' : mType),
......@@ -351,6 +453,7 @@ Proof.
{ intros x; unfold toRMap, updDefVars.
destruct (x =? n) eqn:?; auto. }
{ eapply valid_rec. auto. } *)
<<<<<<< HEAD
* destruct validerr_rec; auto.
* set_tac; split.
{ split; try auto.
......@@ -381,3 +484,64 @@ Proof.
{ eapply H15; try eauto. }
eapply validFPRanges_single in H16; eauto.
Qed.
||||||| merged common ancestors
* set_tac; split.
{ split; try auto.
hnf; intros; subst.
apply H6; rewrite NatSet.add_spec; auto. }
{ hnf; intros.
apply H6; rewrite NatSet.add_spec; auto. }
(*
* unfold vars_typed. intros.
unfold updDefVars.
destruct (v2 =? n) eqn:?; eauto.
apply H8. rewrite NatSet.union_spec in *.
destruct H4; try auto.
rewrite NatSet.add_spec in H4.
rewrite Nat.eqb_neq in *.
destruct H4; subst; try congruence; auto. *)
* intros. unfold updEnv.
type_conv; subst.
destruct (v2 =? n) eqn:?; try rewrite Nat.eqb_eq in *;
try rewrite Nat.eqb_neq in *.
{ exists v1; subst. exists m; repeat split; try auto.
eapply FPRangeValidator_sound; eauto.
set_tac. split; try auto.
split; try auto.
hnf; intros; subst; set_tac. }
{ apply H9.
rewrite NatSet.add_spec in H5; destruct H5;
auto; subst; congruence. }
- destruct H5. destruct H4. destruct H6. eapply FPRangeValidator_sound; eauto.
Admitted.
=======
* set_tac; split.
{ split; try auto.
hnf; intros; subst.
apply H6; rewrite NatSet.add_spec; auto. }
{ hnf; intros.
apply H6; rewrite NatSet.add_spec; auto. }
(*
* unfold vars_typed. intros.
unfold updDefVars.
destruct (v2 =? n) eqn:?; eauto.
apply H8. rewrite NatSet.union_spec in *.
destruct H4; try auto.
rewrite NatSet.add_spec in H4.
rewrite Nat.eqb_neq in *.
destruct H4; subst; try congruence; auto. *)
* intros. unfold updEnv.
type_conv; subst.
destruct (v2 =? n) eqn:?; try rewrite Nat.eqb_eq in *;
try rewrite Nat.eqb_neq in *.
{ exists v1; subst. exists m; repeat split; try auto.
eapply FPRangeValidator_sound; eauto.
set_tac. split; try auto.
split; try auto.
hnf; intros; subst; set_tac. }
{ apply H9.
rewrite NatSet.add_spec in H5; destruct H5;
auto; subst; congruence. }
- destruct H5. destruct H4. destruct H6. eapply FPRangeValidator_sound; eauto.
Abort.
*)
This diff is collapsed.
This diff is collapsed.
......@@ -3,7 +3,8 @@
Used in soundness proofs for error bound validator.
**)
Require Import Coq.Reals.Reals Coq.micromega.Psatz Coq.QArith.Qreals.
Require Import Flover.Infra.Abbrevs Flover.Infra.RealSimps.
Require Import Flover.Infra.Abbrevs Flover.Infra.RealSimps Flover.IntervalArithQ
Flover.Infra.RealRationalProps.
(**
Define validity of an interval, requiring that the lower bound is less than or equal to the upper bound.
......@@ -103,6 +104,18 @@ Proof.
+ apply (Rle_trans _ (Rmax b (Rmax c d)) _); auto. apply Rmax_r.
Qed.
Corollary Q2R_max4 a b c d:
Q2R (IntervalArithQ.max4 a b c d) = max4 (Q2R a) (Q2R b) (Q2R c) (Q2R d).
Proof.
unfold IntervalArithQ.max4, max4; repeat rewrite Q2R_max; auto.
Qed.
Corollary Q2R_min4 a b c d:
Q2R (IntervalArithQ.min4 a b c d) = min4 (Q2R a) (Q2R b) (Q2R c) (Q2R d).
Proof.
unfold IntervalArithQ.min4, min4; repeat rewrite Q2R_min; auto.
Qed.
(**
Asbtract interval update function, parametric by actual operator applied.
**)
......
......@@ -93,6 +93,24 @@ Proof.
- apply (Qle_antisym (ivhi iv1) (ivhi iv2)); auto.
Qed.
Definition unionIntv (iv1 iv2: intv) := mkIntv (Qmin (ivlo iv1) (ivlo iv2)) (Qmax (ivhi iv1) (ivhi iv2)).
Lemma subset_union_left iv1 iv2 : isSupersetIntv iv1 (unionIntv iv1 iv2) = true.
Proof.
destruct iv1, iv2. unfold unionIntv, isSupersetIntv; cbn.
apply Is_true_eq_true. apply andb_prop_intro. split.
- apply Is_true_eq_left. apply Qle_bool_iff. apply Q.le_min_l.
- apply Is_true_eq_left. apply Qle_bool_iff. apply Q.le_max_l.
Qed.
Lemma subset_union_right iv1 iv2 : isSupersetIntv iv2 (unionIntv iv1 iv2) = true.
Proof.
destruct iv1, iv2. unfold unionIntv, isSupersetIntv; cbn.
apply Is_true_eq_true. apply andb_prop_intro. split.
- apply Is_true_eq_left. apply Qle_bool_iff. apply Q.le_min_r.
- apply Is_true_eq_left. apply Qle_bool_iff. apply Q.le_max_r.
Qed.
(**
Definition of validity conditions for intv operations, Addition, Subtraction, Multiplication and Division
**)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -8,28 +8,44 @@ From Flover
From Coq Require Export QArith.QArith.
From Flover
Require Export IntervalValidation AffineValidation SMTArith SMTValidation
RealRangeArith Infra.ExpressionAbbrevs Commands.
Require Export IntervalValidation SMTArith SMTValidation
RealRangeArith Infra.ExpressionAbbrevs.
Definition RangeValidator e A P Qmap dVars :=
Definition RangeValidator e A (P: precond) (Qmap: usedQueries) dVars :=
if
validIntervalbounds e A (fst P) dVars
then true
else validSMTIntervalbounds e A P Qmap (fun _ => None) dVars.
(*
else match validAffineBounds e A (fst P) dVars (FloverMap.empty (affine_form Q)) 1 with
| Some _ => true
| None => validSMTIntervalbounds e A P Qmap (fun _ => None) dVars
end.
*)
Theorem RangeValidator_sound (e : expr Q) (A : analysisResult) (P : precond)
Qmap dVars (E : env) (Gamma : FloverMap.t mType):
Qmap fVars dVars outVars (E : env) (Gamma : FloverMap.t mType):
RangeValidator e A P Qmap dVars = true ->
ssa e (NatSet.union fVars dVars) outVars ->
dVars_range_valid dVars E A ->
affine_dVars_range_valid dVars E A 1 (FloverMap.empty (affine_form Q)) (fun _: nat => None) ->
(* affine_dVars_range_valid dVars E A 1 (FloverMap.empty (affine_form Q)) (fun _: nat => None) -> *)
validTypes e Gamma ->
eval_precond E P ->
NatSet.Subset (preVars P) fVars ->
NatSet.Subset (freeVars e -- dVars) fVars ->
unsat_queries Qmap ->
validRanges e A E (toRTMap (toRExpMap Gamma)).
Proof.
intros range_valid ssa_e dVars_valid types_valid pre_valid preVars_free ? unsat_qs.
unfold RangeValidator in *.
destruct P as [Piv C].
destruct (validIntervalbounds e A Piv dVars) eqn: Hivcheck.
- destruct pre_valid. eapply validIntervalbounds_sound; eauto.
revert preVars_free. apply NatSetProps.subset_trans.
unfold preVars. apply NatSetProps.union_subset_1.
- cbn in *. rewrite Hivcheck in range_valid.
eapply validSMTIntervalbounds_sound; eauto; congruence.
(*
intros range_valid dVars_valid affine_dVars_valid types_valid pre_valid unsat_qs.
unfold RangeValidator in *.
destruct P as [Piv C].
......@@ -59,17 +75,10 @@ Proof.
inoise imap Hchecked Hinoise Himap Hafcheck
affine_dVars_valid Hsubset Hpre)
as [map2 [af [vR [aiv [aerr sound_affine]]]]]; intuition.
*)
Qed.
Definition RangeValidatorCmd e A P Qmap dVars:=
if
validIntervalboundsCmd e A (fst P) dVars
then true
else match validAffineBoundsCmd e A (fst P) dVars (FloverMap.empty (affine_form Q)) 1 with
| Some _ => true
| None => validSMTIntervalboundsCmd e A P Qmap (fun _ => None) dVars
end.
(*
Theorem RangeValidatorCmd_sound (f : cmd Q) (A : analysisResult) (P : precond)
(Qmap: usedQueries) dVars
(E : env) Gamma fVars outVars:
......@@ -116,3 +125,4 @@ Proof.
revert preVars_free. eapply NatSetProps.subset_trans.
apply NatSetProps.union_subset_1.
Qed.
*)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -5,6 +5,7 @@ Require Import CertificateChecker Infra.MachineType.
Import Coq.Lists.List.ListNotations.
(*
Inductive Token:Type :=
| DLET
| DRET
......@@ -490,3 +491,4 @@ Definition runChecker (input:string) :=
| DCONST n :: DCONST m :: tokRest => check_all (N.to_nat m) (N.to_nat n) tokRest (List.length tokList * 100)
| _ => "failure no num of functions"
end.
*)
\ No newline at end of file
This diff is collapsed.
......@@ -16,7 +16,7 @@ TIMECMD=""
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) TIMECMD=/usr/bin/time;;
Darwin*) machine=/usr/local/bin/time;;
Darwin*) TIMECMD=/usr/local/bin/time;;
# CYGWIN*) machine=Cygwin;;
# MINGW*) machine=MinGw;;
# *) machine="UNKNOWN:${unameOut}"
......
......@@ -11,7 +11,16 @@
# #
##############################################################################
TIMECMD=/usr/local/bin/time
TIMECMD=""
unameOut="$(uname -s)"
case "${unameOut}" in
Linux*) TIMECMD=/usr/bin/time;;
Darwin*) TIMECMD=/usr/local/bin/time;;
# CYGWIN*) machine=Cygwin;;
# MINGW*) machine=MinGw;;
# *) machine="UNKNOWN:${unameOut}"
esac
#PROVERS=(coq hol4 binary)
PROVERS=(coq)
......
This diff is collapsed.
This diff is collapsed.
import daisy.lang._
import Real._
object BallBeam {
// s1 <1, 16, 14>, s2, s3, s4: <1, 16, 15>
def ballbeam(s1: Real, s2: Real, s3: Real, s4: Real) = {
require(0 <= s1 && s1 <= 1 && -0.5 <= s2 && s2 <= 0.5 && 0 <= s3 && s3 <= 0.5 && 0 <= s4 && s4 <= 0.5)
(-1828.6) * s1 + (-1028.6) * s2 + (-2008.0) * s3 + (-104.0) * s4
}
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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