1 (* Title: Specify/where_-conds.sml
2 Author: Walther Neuper 110226
3 (c) due to copyright terms
8 signature PRE_CONDITIONS =
12 val to_string : T -> string
14 val check: Rule_Set.T -> term list -> I_Model.T -> 'a -> bool * (bool * term) list (**)
16 val eval: Rule_Set.T -> bool * term -> bool * term
21 structure Pre_Conds(**) : PRE_CONDITIONS(**) =
25 (*type unchecked = term list*)
26 (*type checked = Pre_Conds_Def.T;*)
27 type T = Pre_Conds_Def.T; (*= (bool * term) list;*)
28 type input = string list;
30 fun to_str (b, t) = pair2str (bool2str b, UnparseC.term t);
31 fun to_string pres = strs2str' (map (linefeed o to_str) pres);
33 fun eval _ (false, where_) = (false, where_) (*NOT ALL Free's have been substituted*)
34 | eval where_rls (true, where_) =
35 if Rewrite.eval_true (Proof_Context.init_global (ThyC.Isac "")) [where_] where_rls
37 else (false , where_);
39 fun check _ [] _ _ = (true, [])
40 | check where_rls pres pbl (_ (* FIXME.WN0308 re-introduce I_Model.variants *)) =
42 val env = I_Model.environment pbl;
43 val pres' = map (TermC.subst_atomic_all env) pres;
44 val evals = map (eval where_rls) pres';
45 in (foldl and_ (true, map fst evals), evals) end;