Commit 583f101f authored by Heiko Becker's avatar Heiko Becker

WIP for finite maps port

parent 369a1703
......@@ -230,12 +230,8 @@ Proof.
apply RmaxAbs; eauto.
Qed.
Lemma validErrorboundCorrectConstant_eval E1 E2 A m n nR e nlo nhi dVars Gamma defVars:
Lemma validErrorboundCorrectConstant_eval E1 E2 A m n nR Gamma:
eval_exp E1 (toRMap defVars) (toREval (toRExp (Const m n))) nR M0 ->
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) ->
exists nF m',
eval_exp E2 defVars (toRExp (Const m n)) nF m'.
Proof.
......
This diff is collapsed.
......@@ -60,17 +60,15 @@ val _ = Datatype `
Errors are added on the expression evaluation level later
**)
val evalFma_def = Define `
evalFma v1 v2 v3 = evalBinop Plus v1 (evalBinop Mult v2 v3)`
evalFma v1 v2 v3 = evalBinop Plus v1 (evalBinop Mult v2 v3)`;
val toREval_def = Define `
toREval e :real exp =
case e of
| (Var n) => Var n
| (Const m n) => Const M0 n
| (Unop u e1) => Unop u (toREval e1)
| (Binop bop e1 e2) => Binop bop (toREval e1) (toREval e2)
| (Fma e1 e2 e3) => Fma (toREval e1) (toREval e2) (toREval e3)
| (Downcast m e1) => (toREval e1)`;
(toREval (Var n) = Var n) /\
(toREval (Const m n) = Const M0 n) /\
(toREval (Unop u e1) = Unop u (toREval e1)) /\
(toREval (Binop b e1 e2) = Binop b (toREval e1) (toREval e2)) /\
(toREval (Fma e1 e2 e3) = Fma (toREval e1) (toREval e2) (toREval e3)) /\
(toREval (Downcast m e1) = toREval e1)`;
(**
Define a perturbation function to ease writing of basic definitions
......@@ -245,7 +243,7 @@ val toRMap_eval_M0 = store_thm (
"toRMap_eval_M0",
``!f v E Gamma m.
eval_exp E (toRMap Gamma) (toREval f) v m ==> m = M0``,
Induct \\ simp[Once toREval_def] \\ fs[eval_exp_cases, toRMap_def]
Induct \\ fs[toREval_def] \\ fs[eval_exp_cases, toRMap_def]
\\ rpt strip_tac \\ fs[]
>- (every_case_tac \\ fs[])
>- (rveq \\ first_x_assum drule \\ strip_tac \\ fs[])
......
......@@ -152,12 +152,21 @@ end;
(* This variable is supposed to hold all defined functions *)
val eval_funs:term list ref = ref [];
open TextIO;
val t = TextIO.openIn("/home/hbecker/Downloads/test.txt");
inputLine(t);
closeIn(t);
val t2 = openIn("./test.txt");
inputLine(t2);
output(t2, "ABC\n");
closeOut(t2);
fun add_unevaluated_function (t:term) :unit =
eval_funs := t :: (!eval_funs);
fun Daisy_compute t =
let
val eval_thm = DB.theorem ((term_to_string t)^"_def");
val eval_thm = fst (snd (hd (DB.find ((term_to_string t)^"_def"))));
val (pat,_) = getPatTerm t in
TRY (
Tactical.PAT_X_ASSUM
......
Subproject commit 4273d509b99f86716a40d18895a091bbd043f24d
Subproject commit c760e35a371970c83a07a154bb67d4b842115a1f
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