1414(* *)
1515(*********************************************************************** *)
1616
17- From Stdlib Require Export micromega_formula micromega_witness.
17+ From Stdlib Require Export micromega_formula micromega_witness micromega_eval .
1818From Stdlib Require Export micromega_checker.
1919From Stdlib Require Import List.
2020From Stdlib Require Import Refl.
@@ -29,6 +29,9 @@ Inductive Trace (A : Type) :=
2929| merge : Trace A -> Trace A -> Trace A
3030.
3131
32+ #[local] Notation eIFF := (eIFF eqb).
33+ #[local] Notation eval_f := (GFeval eqb).
34+
3235Section S.
3336 Context {TA : Type}. (* type of interpreted atoms *)
3437 Context {TX : kind -> Type}. (* type of uninterpreted terms (Prop) *)
@@ -105,45 +108,7 @@ Section S.
105108
106109 Variable ea : forall (k: kind), TA -> eKind k.
107110
108- Definition eTT (k: kind) : eKind k :=
109- if k as k' return eKind k' then True else true.
110-
111- Definition eFF (k: kind) : eKind k :=
112- if k as k' return eKind k' then False else false.
113-
114- Definition eAND (k: kind) : eKind k -> eKind k -> eKind k :=
115- if k as k' return eKind k' -> eKind k' -> eKind k'
116- then and else andb.
117-
118- Definition eOR (k: kind) : eKind k -> eKind k -> eKind k :=
119- if k as k' return eKind k' -> eKind k' -> eKind k'
120- then or else orb.
121-
122- Definition eIMPL (k: kind) : eKind k -> eKind k -> eKind k :=
123- if k as k' return eKind k' -> eKind k' -> eKind k'
124- then (fun x y => x -> y) else implb.
125-
126- Definition eIFF (k: kind) : eKind k -> eKind k -> eKind k :=
127- if k as k' return eKind k' -> eKind k' -> eKind k'
128- then iff else eqb.
129-
130- Definition eNOT (k: kind) : eKind k -> eKind k :=
131- if k as k' return eKind k' -> eKind k'
132- then not else negb.
133-
134- Fixpoint eval_f (k: kind) (f:GFormula k) {struct f}: eKind k :=
135- match f in micromega_formula.GFormula k' return eKind k' with
136- | TT tk => eTT tk
137- | FF tk => eFF tk
138- | A k a _ => ea k a
139- | X k p => ex p
140- | @AND _ _ _ _ k e1 e2 => eAND k (eval_f e1) (eval_f e2)
141- | @OR _ _ _ _ k e1 e2 => eOR k (eval_f e1) (eval_f e2)
142- | @NOT _ _ _ _ k e => eNOT k (eval_f e)
143- | @IMPL _ _ _ _ k f1 _ f2 => eIMPL k (eval_f f1) (eval_f f2)
144- | @IFF _ _ _ _ k f1 f2 => eIFF k (eval_f f1) (eval_f f2)
145- | EQ f1 f2 => (eval_f f1) = (eval_f f2)
146- end .
111+ #[local] Notation eval_f := (eval_f ex ea).
147112
148113 Lemma eval_f_rew : forall k (f:GFormula k),
149114 eval_f f =
@@ -164,7 +129,7 @@ Section S.
164129 Qed .
165130
166131 End EVAL.
167-
132+ #[local] Notation eval_f := (eval_f ex).
168133
169134 Definition hold (k: kind) : eKind k -> Prop :=
170135 if k as k0 return (eKind k0 -> Prop ) then fun x => x else is_true.
@@ -259,37 +224,6 @@ Section S.
259224
260225End S.
261226
262- Section MAPATOMS.
263- Context {TA TA':Type}.
264- Context {TX : kind -> Type}.
265- Context {AA : Type}.
266- Context {AF : Type}.
267-
268- Fixpoint map_bformula (k: kind)(fct : TA -> TA') (f : @GFormula TA TX AA AF k) : @GFormula TA' TX AA AF k:=
269- match f with
270- | TT k => TT k
271- | FF k => FF k
272- | X k p => X k p
273- | A k a t => A k (fct a) t
274- | AND f1 f2 => AND (map_bformula fct f1) (map_bformula fct f2)
275- | OR f1 f2 => OR (map_bformula fct f1) (map_bformula fct f2)
276- | NOT f => NOT (map_bformula fct f)
277- | IMPL f1 a f2 => IMPL (map_bformula fct f1) a (map_bformula fct f2)
278- | IFF f1 f2 => IFF (map_bformula fct f1) (map_bformula fct f2)
279- | EQ f1 f2 => EQ (map_bformula fct f1) (map_bformula fct f2)
280- end .
281-
282- End MAPATOMS.
283-
284- Lemma map_simpl : forall A B f l, @map A B f l = match l with
285- | nil => nil
286- | a :: l=> (f a) :: (@map A B f l)
287- end .
288- Proof .
289- intros A B f l; destruct l ; reflexivity.
290- Qed .
291-
292-
293227Section S.
294228 (** A cnf tracking annotations of atoms. *)
295229
@@ -1871,7 +1805,7 @@ Section S.
18711805 tauto.
18721806 Qed .
18731807
1874- Lemma tauto_checker_sound : forall t w, tauto_checker (@xcnf true isProp t) w = true -> forall env, @eval_f _ _ _ unit e_eKind (eval env) _ t.
1808+ Lemma tauto_checker_sound : forall t w, tauto_checker (@xcnf true isProp t) w = true -> forall env, @GFeval eqb _ _ _ unit e_eKind (eval env) _ t.
18751809 Proof .
18761810 unfold tauto_checker.
18771811 intros t w H env.
@@ -1880,10 +1814,10 @@ Section S.
18801814 eapply cnf_checker_sound ; eauto.
18811815 Qed .
18821816
1883- Definition eval_bf {A : Type} (ea : forall (k: kind), A -> eKind k) (k: kind) (f: BFormula A k) := eval_f e_eKind ea f .
1817+ #[local] Notation eval_bf := (BFeval eqb) .
18841818
18851819 Lemma eval_bf_map : forall T U (fct: T-> U) env (k: kind) (f:BFormula T k) ,
1886- eval_bf env (map_bformula fct f) = eval_bf (fun b x => env b (fct x)) f.
1820+ eval_bf env (GFmap fct f) = eval_bf (fun b x => env b (fct x)) f.
18871821 Proof .
18881822 intros T U fct env k f;
18891823 induction f as [| | | |? ? IHf1 ? IHf2|? ? IHf1 ? IHf2|? ? IHf
@@ -1894,6 +1828,7 @@ Section S.
18941828
18951829
18961830End S.
1831+ Notation eval_bf := (BFeval eqb).
18971832
18981833Notation tauto_checker :=
18991834 (fun term term' annot unsat deduce normalise negate witness check f =>
0 commit comments