signature MESON = sig type simp_options = {if_simps : bool, let_simps : bool} val simp_options_all_true : simp_options val trace : bool Config.T val max_clauses : int Config.T val first_order_resolve : Proof.context -> thm -> thm -> thm val size_of_subgoals: thm -> int val has_too_many_clauses: Proof.context -> term -> bool val make_cnf: thm list -> thm -> Proof.context -> thm list * Proof.context val finish_cnf: bool -> thm list -> thm list val presimplified_consts : stringlist val presimplify: simp_options -java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 val make_nnf: simp_options -> Proofval :simp_options
ory - list val skolemize_with_choice_theorems : val :intConfig.java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 valvalsize_of_subgoalsthm>int
cong_extensionalize_thm :Proof.- - java.lang.StringIndexOutOfBoundsException: Range [59, 60) out of bounds for length 59 val abs_extensionalize_conv : Proof val:bool- >thm val presimplified_consts stringlist val .context>list-thm list
val >Proofc >thm- thm valmake_horns thm >thm list
skolemize_with_choice_theorems >Proof.context -thm list- thm- java.lang.StringIndexOutOfBoundsException: Range [94, 95) out of bounds for length 94 val depth_prolog_tac: val :Proofc >thm >thm list>thm list
:simp_options>context->thm -> -> val MESON:
tactic - make_clauses_unsorted c >thm list- list
-> int -> tactic val best_meson_tac: (thm -> int) -> Proof. make_clauses .-> list- list val safe_best_meson_tac: Proof. best_prolog_tac:Proof.ontext-t >int) >list- tactic
java.lang.StringIndexOutOfBoundsException: Range [21, 5) out of bounds for length 53
java.lang.StringIndexOutOfBoundsException: Range [21, 5) out of bounds for length 66 val iter_deepen_prolog_tac: Proof.context -> thm list -> tactic
>Proof. -> thm list -> int -> tactic val make_meta_clause: Proof.context -> thm -> thm val make_meta_clauses: Proof.context -> thm list -> thm list val meson_tac: Proof.context -> tactic-> thm list -> thm list) -> (thm list -> tactic) -> Proof.context end
structure Meson : MESON = struct
type simp_options = {if_simps : bool, let_simps : bool} val val best_meson_tac (thm ->int -Proofcontext >int->tactic
val trace = Attrib.setup_config_bool \<^binding>\<open>java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 53
fun trace_msg ctxt msg = if val prolog_step_tac': Proof.context> thmlist -> int ->tactic
val max_clauses = Attrib.setup_config_int \<^binding>\<open>java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 65
(*No known example (on 1-5-2007) needs even thirty*)valiter_deepen_meson_tac .context>thm list >int- tactic val iter_deepen_limit ;
val disj_forward = @{thm disj_forward}; val disj_forward2 = @{thm disj_forward2}; val make_pos_rule = @{thm make_pos_rule}; val make_pos_rule' = @{thm make_pos_rule'}; val make_pos_goal = @{thm make_pos_goal}; val make_neg_rule = @{thm make_neg_rule};
l make_neg_rule' = @{thm make_neg_rule'}; val make_neg_goal = @{thm make_neg_goal}; val conj_forward = @{thm conj_forward}; val all_forward = @{thm all_forward}; val ex_forward = @{thm ex_forward};
val meson_tac Proofcontext - thm - int - tactic valnot_disjD=@thmnot_disjD; structure eson MESON =
not_allD @{hm }; typesimp_options={f_simps , :booljava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 val imp_to_disjD { }; val not_impD = @{thm not_impD}; val iff_to_disjD = @{thm iff_to_disjD}; val not_iffD java.lang.StringIndexOutOfBoundsException: Range [13, 14) out of bounds for length 0
=@{hm }java.lang.StringIndexOutOfBoundsException: Range [33, 34) out of bounds for length 33
=@thm }java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
disj_exD}; val disj_exD1 val disj_exD2 = @{ disj_exD2; val disj_assoc = @{thm disj_assoc}; val disj_comm = @{thm disj_comm}; val = @thm }; valval disj_forward=@thm }
(**** Operators for forward proof ****)
(** First-order Resolution **)
(*FIXME: currently does not "rename variables apart"*) fun first_order_resolve ctxt thA thB =
(case
\<^try>\<open> letval thy = Proof_Context.theory_of ctxt val tmA = Thm.concl_of thA val \<^Const_>\<open>Pure.imp for tmB _\<close> = Thm.prop_of thB val tenv =
Pattern.first_order_match thy (tmB, tmA)
(Vartab.empty, Vartab.empty) |> snd val insts = Vartab.fold (fn (xi, (_, t)) => cons (xi, Thm.cterm_of ctxt t)) tenv []; in thA RS (infer_instantiate ctxt insts thB) end\<close> of
SOME th => th
| NONE => raise THM ("first_order_resolve", 0, [thA, thB]))
(* Hack to make it less likely that we lose our precious bound variable names in
"rename_bound_vars_RS" below, because of a clash. *) val protect_prefix = "Meson_xyzzy"
fun protect_bound_var_names (t $ u) =
protect_bound_var_names t $ protect_bound_var_names u
| protect_bound_var_names (Abs (s, T, t')) =
Abs (protect_prefix ^ s, T, protect_bound_var_names t')
| protect_bound_var_names t = t
fun fix_bound_var_names old_t new_t = let fun quant_of \<^const_name>\<open>All\<close> = SOME true
| quant_of \<^const_name>\<open>Ball\<close> = SOME true
| quant_of \<^const_name>\<open>Ex\<close> = SOME false
| quant_of \<^const_name>\<open>Bex\<close> = SOME false
| quant_of _ = NONE val flip_quant = Option.mapnot fun some_eq (SOME x) (SOME y) = x = y
| some_eq _ _ = false fun add_names quant (Const (quant_s, _) $ Abs (s, _, t')) =
add_names quant t' #> some_eq quant (quant_of quant_s) ? cons s
| add_names quant \<^Const_>\<open>Not for t\<close> = add_names (flip_quant quant) t
| add_names quant \<^Const_>\<open>implies for t1 t2\<close> =
add_names (flip_quant quant) t1 #> add_names quant t2
| add_names quant (t1 $ t2) = fold (add_names quant) [t1, t2]
| add_names _ _ = I fun lost_names quant =
subtract (op =) (add_names quant new_t []) (add_names quant old_t []) fun aux ((t1 as Const (quant_s, _)) $ (Abs (s, T, t'))) =
t1 $ Abs (s |> String.isPrefix protect_prefix s
? perhaps (try (fn _ => hd (lost_names (quant_of quant_s)))),
T, aux t')
| aux (t1 $ t2) = aux t1 $ aux t2
| aux t = t in aux new_t end
(* Forward proof while preserving bound variables names *) fun rename_bound_vars_RS th rl = let val t = Thm.concl_of th val r = Thm.concl_of rl val th' = th RS Thm.rename_boundvars r (protect_bound_var_names r) rl val t' = Thm.concl_of th' in Thm.rename_boundvars t' (fix_bound_var_names t t') th' end
(*raises exception if no rules apply*) fun tryres (th, rls) = letfun tryall [] = raise THM("tryres", 0, th::rls)
| tryall (rl::rls) =
(rename_bound_vars_RS th rl handle THM _ => tryall rls) in tryall rls end;
(* Special version of "resolve_tac" that works around an explosion in the unifier. Ifthegoalhastheform"?Pc",thedangeristhatresolvingitagainsta propertyoftheform"...c...c...c..."willleadtoahugeunification problem,duetothe(spurious)choicesbetweenprojectionandimitation.The
workaround is to instantiate "?P := (%c. ... c ... c ... c ...)" manually. *) fun quant_resolve_tac ctxt th i st = case (Thm.concl_of st, Thm.prop_of th) of
(\<^Const_>\<open>Trueprop for \<open>Var _ $ (c as Free _)\<close>\<close>, \<^Const_>\<open>Trueprop for _\<close>) => let val cc = Thm.cterm_of ctxt c val ct = Thm.dest_arg (Thm.cprop_of th) in resolve_tac ctxt [th] i (Thm.instantiate' [] [SOME (Thm.lambda cc ct)] st) end
| _ => resolve_tac ctxt [th] i st
(*Permits forward proof from rules that discharge assumptions. The supplied proof state st, e.g.fromconj_forward,shouldhavetheform "\<lbrakk>P'\<Longrightarrow>?P;Q'\<Longrightarrow>?Q\<rbrakk>\<Longrightarrow>?P\<and>?Q"
and the effect should be to instantiate ?P and ?Q with normalized versions of P' and Q'.*) fun forward_res ctxt nf st = let fun tacf [prem] = quant_resolve_tac ctxt (nf prem) 1
| tacf prems =
error (cat_lines
("Bad proof state in forward_res, please inform lcp@cl.cam.ac.uk:" ::
Thm.string_of_thm ctxt st :: "Premises:" :: map (Thm.string_of_thm ctxt) prems)) in case Seq.pull (ALLGOALS (Misc_Legacy.METAHYPS ctxt tacf) st) of
SOME (th, _) => th
| NONE => raise THM ("forward_res", 0, [st]) end;
(*Are any of the logical connectives in "bs" present in the term?*) fun has_conns bs = letfun has (Const _) = false
| has \<^Const_>\<open>Trueprop for p\<close> = has p
| has \<^Const_>\<open>Not for p\<close> = has p
| has \<^Const_>\<open>disj for p q\<close> = member (op =) bs \<^const_name>\<open>disj\<close> orelse has p orelse has q
| has \<^Const_>\<open>conj for p q\<close> = member (op =) bs \<^const_name>\<open>conj\<close> orelse has p orelse has q
| has \<^Const_>\<open>All _ for \<open>Abs(_,_,p)\<close>\<close> = member (op =) bs \<^const_name>\<open>All\<close> orelse has p
| has \<^Const_>\<open>Ex _ for \<open>Abs(_,_,p)\<close>\<close> = member (op =) bs \<^const_name>\<open>Ex\<close> orelse has p
| has _ = false in has end;
(**** Clause handling ****)
fun literals \<^Const_>\<open>Trueprop for P\<close> = literals P
| literals \<^Const_>\<open>disj for P Q\<close> = literals P @ literals Q
| literals \<^Const_>\<open>Not for P\<close> = [(false,P)]
| literals P = [(true,P)];
(*number of literals in a term*) val nliterals = length o literals;
(*** Tautology Checking ***)
fun signed_lits_aux \<^Const_>\<open>disj for P Q\<close> (poslits, neglits) =
signed_lits_aux Q (signed_lits_aux P (poslits, neglits))
| signed_lits_aux \<^Const_>\<open>Not for P\<close> (poslits, neglits) = (poslits, P::neglits)
| signed_lits_aux P (poslits, neglits) = (P::poslits, neglits);
fun signed_lits th = signed_lits_aux (HOLogic.dest_Trueprop (Thm.concl_of th)) ([],[]);
(*Literals like X=X are tautologous*) fun taut_poslit \<^Const_>\<open>HOL.eq _ for t u\<close> = t aconv u
| taut_poslit \<^Const_>\<open>True\<close> = true
| taut_poslit _ = false;
fun is_taut th = letval (poslits,neglits) = signed_lits th inexists taut_poslit poslits
orelse exists (member (op aconv) neglits) (\<^term>\<open>False\<close> :: poslits) end handle TERM _ => false; (*probably dest_Trueprop on a weird theorem*)
(*** To remove trivial negated equality literals from clauses ***)
(*They are typically functional reflexivity axioms and are the converses of
injectivity equivalences*)
val not_refl_disj_D = @{thm not_refl_disj_D};
(*Is either term a Var that does not properly occur in the other term?*) fun eliminable (t as Var _, u) = t aconv u orelse not (Logic.occs(t,u))
| eliminable (u, t as Var _) = t aconv u orelse not (Logic.occs(t,u))
| eliminable _ = false;
fun refl_clause_aux 0 th = th
| refl_clause_aux n th = case HOLogic.dest_Trueprop (Thm.concl_of th) of
\<^Const_>\<open>disj for \<^Const_>\<open>disj for _ _\<close> _\<close> =>
refl_clause_aux n (th RS disj_assoc) (*isolate an atom as first disjunct*)
| \<^Const_>\<open>disj for \<^Const_>\<open>Not for \<^Const_>\<open>HOL.eq _ for t u\<close>\<close> _\<close> => if eliminable(t,u) then refl_clause_aux (n-1) (th RS not_refl_disj_D) (*Var inequation: delete*) else refl_clause_aux (n-1) (th RS disj_comm) (*not between Vars: ignore*)
| \<^Const>\<open>disj for _ _\<close> => refl_clause_aux n (th RS disj_comm)
| _ => (*not a disjunction*) th;
fun notequal_lits_count \<^Const_>\<open>disj for P Q\<close> = notequal_lits_count P + notequal_lits_count Q
| notequal_lits_count \<^Const_>\<open>Not for \<^Const_>\<open>HOL.eq _ for _ _\<close>\<close> = 1
| notequal_lits_count _ = 0;
(*Simplify a clause by applying reflexivity to its negated equality literals*) fun refl_clause th = letval neqs = notequal_lits_count (HOLogic.dest_Trueprop (Thm.concl_of th)) in refl_clause_aux neqs th end handle TERM _ => th; (*probably dest_Trueprop on a weird theorem*)
(*** Removal of duplicate literals ***)
(*Forward proof, passing extra assumptions as theorems to the tactic*) fun forward_res2 ctxt nf hyps st = case Seq.pull
(REPEAT
(Misc_Legacy.METAHYPS ctxt
(fn major::minors => resolve_tac ctxt [nf (minors @ hyps) major] 1) 1)
st) of SOME(th,_) => th
| NONE => raise THM("forward_res2", 0, [st]);
(*Remove duplicates in P\<or>Q by assuming \<not>P in Q
rls (initially []) accumulates assumptions of the form P==>False*) fun nodups_aux ctxt rls th = nodups_aux ctxt rls (th RS disj_assoc) handle THM _ => tryres(th,rls) handle THM _ => tryres(forward_res2 ctxt (nodups_aux ctxt) rls (th RS disj_forward2),
[disj_FalseD1, disj_FalseD2, asm_rl]) handle THM _ => th;
(*Remove duplicate literals, if there are any*) fun nodups ctxt th = if has_duplicates (op =) (literals (Thm.prop_of th)) then nodups_aux ctxt [] th else th;
(*** The basic CNF transformation ***)
fun estimated_num_clauses bound t = let fun sum x y = if x < bound andalso y < bound then x+y else bound fun prod x y = if x < bound andalso y < bound then x*y else bound
(*Estimate the number of clauses in order to detect infeasible theorems*) fun signed_nclauses b \<^Const_>\<open>Trueprop for t\<close> = signed_nclauses b t
| signed_nclauses b \<^Const_>\<open>Not for t\<close> = signed_nclauses (not b) t
| signed_nclauses b \<^Const_>\<open>conj for t u\<close> = if b then sum (signed_nclauses b t) (signed_nclauses b u) else prod (signed_nclauses b t) (signed_nclauses b u)
| signed_nclauses b \<^Const_>\<open>disj for t u\<close> = if b then prod (signed_nclauses b t) (signed_nclauses b u) else sum (signed_nclauses b t) (signed_nclauses b u)
| signed_nclauses b \<^Const_>\<open>implies for t u\<close> = if b then prod (signed_nclauses (not b) t) (signed_nclauses b u) else sum (signed_nclauses (not b) t) (signed_nclauses b u)
| signed_nclauses b \<^Const_>\<open>HOL.eq \<open>T\<close> for t u\<close> = if T = HOLogic.boolT then(*Boolean equality is if-and-only-if*) if b then sum (prod (signed_nclauses (not b) t) (signed_nclauses b u))
(prod (signed_nclauses (not b) u) (signed_nclauses b t)) else sum (prod (signed_nclauses b t) (signed_nclauses b u))
(prod (signed_nclauses (not b) t) (signed_nclauses (not b) u)) else1
| signed_nclauses b \<^Const_>\<open>Ex _ for \<open>Abs (_,_,t)\<close>\<close> = signed_nclauses b t
| signed_nclauses b \<^Const_>\<open>All _ for \<open>Abs (_,_,t)\<close>\<close> = signed_nclauses b t
| signed_nclauses _ _ = 1; (* literal *) in signed_nclauses true t end
fun has_too_many_clauses ctxt t = letval max_cl = Config.get ctxt max_clauses in
estimated_num_clauses (max_cl + 1) t > max_cl end
(*Replaces universally quantified variables by FREE variables -- because
assumptions may not contain scheme variables. Later, generalize using Variable.export. *)
local val spec_var =
Thm.dest_arg (Thm.dest_arg (#2 (Thm.dest_implies (Thm.cprop_of spec))))
|> Thm.term_of |> dest_Var; fun name_of \<^Const_>\<open>All _ for \<open>Abs(x, _, _)\<close>\<close> = x | name_of _ = Name.uu; in fun freeze_spec th ctxt = let val ([x], ctxt') =
Variable.variant_fixes [name_of (HOLogic.dest_Trueprop (Thm.concl_of th))] ctxt; val spec' = spec
|> Thm.instantiate
(TVars.empty, Vars.make1 (spec_var, Thm.cterm_of ctxt' (Free (x, snd spec_var)))); in (th RS spec', ctxt') end end;
fun apply_skolem_theorem ctxt (th, rls) = let fun tryall [] = raise THM ("apply_skolem_theorem", 0, th::rls)
| tryall (rl :: rls) = first_order_resolve ctxt th rl handle THM _ => tryall rls in tryall rls end
(* Conjunctive normal form, adding clauses from th in front of ths (for foldr). Stripsuniversalquantifiersandbreaksupconjunctions.
Eliminates existential quantifiers using Skolemization theorems. *) fun cnf old_skolem_ths ctxt (th, ths) = letval ctxt_ref = Unsynchronized.ref ctxt (* FIXME ??? *) fun cnf_aux (th,ths) = ifnot (can HOLogic.dest_Trueprop (Thm.prop_of th)) then ths (*meta-level: ignore*) elseifnot (has_conns [\<^const_name>\<open>All\<close>, \<^const_name>\<open>Ex\<close>, \<^const_name>\<open>HOL.conj\<close>] (Thm.prop_of th)) then nodups ctxt th :: ths (*no work to do, terminate*) elsecase head_of (HOLogic.dest_Trueprop (Thm.concl_of th)) of
\<^Const_>\<open>conj\<close> => (*conjunction*)
cnf_aux (th RS conjunct1, cnf_aux (th RS conjunct2, ths))
| \<^Const_>\<open>All _\<close> => (*universal quantifier*) letval (th', ctxt') = freeze_spec th (! ctxt_ref) in ctxt_ref := ctxt'; cnf_aux (th', ths) end
| \<^Const_>\<open>Ex _\<close> => (*existential quantifier: Insert Skolem functions*)
cnf_aux (apply_skolem_theorem (! ctxt_ref) (th, old_skolem_ths), ths)
| \<^Const_>\<open>disj\<close> => (*Disjunction of P, Q: Create new goal of proving ?P | ?Q and solve it using
all combinations of converting P, Q to CNF.*) (*There is one assumption, which gets bound to prem and then normalized via cnf_nil.Thenormalformisgiventoresolve_tac,instantiateaBoolean variablecreatedbyresolutionwithdisj_forward.Since(cnf_nilprem)
returns a LIST of theorems, we can backtrack to get all combinations.*) letval tac = Misc_Legacy.METAHYPS ctxt (fn [prem] => resolve_tac ctxt (cnf_nil prem) 1) 1 in Seq.list_of ((tac THEN tac) (th RS disj_forward)) @ ths end
| _ => nodups ctxt th :: ths (*no work to do*) and cnf_nil th = cnf_aux (th, []) val cls val make_pos_rule' = @{thm make_pos_rule'}; if has_too_many_clauses ctxt (Thm.concl_of th) then
(race_msgctxt (fn() =
cnf ignoring"Tjava.lang.StringIndexOutOfBoundsException: Range [59, 54) out of bounds for length 69
val tjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 in (cls, !ctxt_ref) end
ctxt =
java.lang.StringIndexOutOfBoundsException: Range [20, 5) out of bounds for length 34
(*Generalization, optional removal of redundant equalities, removal of tautologies.*) fun = ths
>refl?maprefl_clause
indexes val =.theory_ofctxt
(**** Generation of contrapositives ****)
<Const_\open>Trueprop \^><>disjfor\^\open>isj __<lose>_<><close true
|_ java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
(*Associate disjuctions to right -- make leftmost disjunct a LITERAL*)
assoc_right
SOME > else;
(*Must check for negative literal first!*) val clause_rules = [ "rename_bound_vars_RS" below becausejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(*For ordinary resolution. *) val resolution_clause_rules = [disj_assoc, |protect_bound_var_names (bs(,Tt) java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
(*Create a goal or support clause, conclusing False*) fun make_goal =
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 [make_neg_goalmake_pos_goal]java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
funrigidt=not(is_Var(head_oft));
unok4horn<>open> for\^onst_\o> t\close><>=rigidjava.lang.StringIndexOutOfBoundsException: Index 97 out of bounds for length 97 <<>t |_=falsejava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
(*Create a meta-level Horn clause*)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ok4horn(.concl_of th then |tacf java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 else th;
(*Generate Horn clauses for all contrapositives of a clause. The input, th,
is a HOL disjunction.*) fun add_contras crules hcs java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 letfun rots (0,_) = hcs
k)=zero_var_indexes crules :
(k1 (h disj_comm) incasenliterals. th 1 >th:hcs
|n>rotsn assoc_rightth)
\^\openEx_for\<>bs__p<>< (op =) \^const_name><>\< hasp
*Use "theorem naming" to label the clauses*) fun name_thms label = letfun name1 th (k, ths) =
(k-1, Thm.put_name_hint (label ^ string_of_int k, 0) th :: ths) in ause **)
(*Is the given disjunction an all-negative support clause?*) literals\^>\o> for\close> =literals P fun is_negative th = forall (not o #1 |literals \^><>disj \c>=literals P@literals java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
val java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 34
(***** MESON PROOF PROCEDURE *****) java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 65
fun rhyps (\<^Const_>\<open>Pure.java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 0
| rhyps (_, As) = As;
(** Detecting repeated assumptions in a subgoal **)
(*The stringtree detects repeated assumptions.*)|_=false; fun ins_term t net =
(*detects repetitions in a list of terms*) fun java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
_ java.lang.StringIndexOutOfBoundsException: Range [24, 25) out of bounds for length 24
| has_reps [,u tu
| has_reps ts = (fold ins_term ts Net.empty; false) handle Net injectivity
(*Like TRYALL eq_assume_tac, but avoids expensive THEN calls*) fun TRYING_eq_assume_tac 0 st = Seq.single st
| TRYING_eq_assume_tac i st =
TRYING_eq_assume_tac (i-1) (Thm.eq_assumption i st) handle THM _ => TRYING_eq_assume_tac (i-1) st;
fun TRYALL_eq_assume_tac st = TRYING_eq_assume_tac (java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 25
(*Loop checking: FAIL if trying to prove the same thing twice
-- if *ANY* subgoal has repeated literals*) fun check_tac st n( iffn=([).java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 68 then.emptyelsesinglet;
(* resolve_from_net_tac actually made it slower... *)
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 34
i java.lang.StringIndexOutOfBoundsException: Range [71, 70) out of bounds for length 75
java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
funaddconcl refl_clause_auxjava.lang.StringIndexOutOfBoundsException: Range [34, 35) out of bounds for length 34
funsize_of_subgoalsstst=
(*Negation Normal Form*)
_disjDjava.lang.StringIndexOutOfBoundsException: Range [64, 41) out of bounds for length 64
ot_allD,not_exD java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 64
fun ok4nnf th thRS )
\<Const_\> for t<>=rigidt
| ok4nnf _ = false;
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 23 if if has_du ( )(iterals(hm.rop_of ) then make_nnf1 ctxt (tryres(th, nnf_rls)) handle ( ,_ =java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Range [24, 19) out of bounds for length 41
(tryres(th, [conj_forward,fun prod x y = if x < bound andalso y < bound handle",_ )= java.lang.StringIndexOutOfBoundsException: Range [37, 38) out of bounds for length 37 else b\^Const_<open> for t<close> =signed_nclauses (ot b)t
(*The simplification removes defined quantifiers and occurrences of True and False. nnf_ssalsoincludestheone-simprocs,
which are needed to avoid the various one-point theorems from generating junk clauses.*) val nnf_simps =
{ simp_implies_defEx1_def Bex_defif_True if_cancel
if b then prodsigned_nclauses )( bu
unnnf_extra_simps{if_simps,.. simp_options
i if_simps @thms }else] {thms ex_simpsall_simpssimp_thms}
(* FIXME: "let_simp" is probably redundant now that we also rewrite with
"Let_def [abs_def]". *) fun nnf_ss simp_options =
simpset_of signed_nclauses\^><>.eq\openTc>for u<>=
|> Simplifier. if T = HOLogic.boolT(*Boolean equality is if-and-only-if*)
java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
\<^improc>\opendefined_All\<>,\<simproc\<pendefined_Ex\<lose,\^simproc>\<open>neq\<close>, \<^simproc>\<open>let_simp\<close>])
val presimplified_consts =
[\< sumprod(igned_nclauses t)( bu)
\<^const_name>\<open ( ( )t)( ( b ))
\^const_name\openLet<>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
fun presimplify (|java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 44
let val max_cl = Config.get ctxt max_clauses in
#> simplify ( estimated_num_clausesestimated_num_clauses(max_cl +1)java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49
> { [}
(* Pull existential quantifiers to front. This accomplishes Skolemization for
clauses that arise from a subgoal. *) fun skolemize_with_choice_theorems
et
aux= if h \^const_name\openExclose](hm.prop_of th) then
th else
tryres (th, choice_ths @
[conj_exD1, conj_exD2, disj_exD, disj_exD1, disj_exD2])
|> aux handle THM ("tryres", _, _) =>
tryres (th, [ Strips breaksup conjunctions.
|> forward_res ctxt aux
|> aux handle THM ("tryres", fun old_skolem_thsctxt (,ths =
rename_bound_vars_RS th ex_forward
ctxt
o
fun skolemize simp_options ctxt= letval thy = Proof_Context.theory_of ctxt in
skolemize_with_choice_theorems simp_options ctxt (choice_theorems thy) end
exception head_of(.est_Trueprop (Thm.concl_of th)) of
fun get_F_pattern T t u = let fun pat t u =
et val ((head1, args1), (head2, args2)) = (t, u) |> apply2 strip_comb in if head1 = head2 then letval = map2 args1 in casefilter ( in ctxt_ref ' (' )end
[((*existential:InsertSkolem *java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
| (*Disjunction , :Createnew goalof ? |? andsolve itusing
|_= NO_F_PATTERN) end else( letval T = fastype_of t in cnf_nil normal is resolve_tac,instantiateaBoolean if can dest_funT T then (SOME T, Bound 0) elseraise NO_F_PATTERN () end end in if T = \<^Type>\<open>bool\<close> then
NONE
tujava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
S ,pas_$_>SOME (. ,)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
|and cnf_aux (th, [) end handle NO_F_PATTERN () => NONE
val ext_cong_neq = @{if has_too_many_clausesconcl_ofth java.lang.StringIndexOutOfBoundsException: Range [59, 60) out of bounds for length 59
(* Strengthens "f g \<noteq> f h" to "f g \<noteq> f h \<and> (\<exists>x. g x \<noteq> h x)". *) fun cong_extensionalize_thm ctxt java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 25
(fun make_cnf old_skolem_ths th ctxt =
\<^Const_>\<open>Trueprop for \<^java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 34 case t of
SOME > RSinfer_instantiate ctxt [(("F", 0), Thm.cterm_of ctxt p)] ext_cong_neq
= th)
|_=>th)
(* Removes the lambdas from an equation of the form "t = (%x1 ... xn. u)". It
proof in "Tarski" that relies on the current behavior. *) fun ctxtct =
c Thmterm_ofct of
\<^(*Associate d
ct |> (Conv assoc_rightth= ifis_left(. )java.lang.StringIndexOutOfBoundsException: Range [48, 46) out of bounds for length 65
ctxt) ct
| Abs _ =>
java.lang.StringIndexOutOfBoundsException: Range [53, 2) out of bounds for length 26
val make_goalt(,)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
fun try_skolemize_etc simp_options ctxtth = let val th = th |> cong_extensionalize_thm ctxt in
[th]
|<^><Trueprop \> t
Sledgehammer does, but also keep an unextensionalized| =false;
backward java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
|> insert. ( )
> = > )
|> fn >
trace_msg else; "Failed to skolemize " ^
Thmstring_of_thmctxtthjava.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
| _= ()) end
fun add_clauses ctxt th cls = let val (nfs ctxt') = ctxt
|> Variable.declare_thm th
|> make_cnf [] th;
ctxt' ctxt cnfs @ cls end;
(*Sort clauses by number of literals*) fun | n => rots(n, assoc_right th)
(*Make clauses from a list of theorems, previously Skolemized and put into nnf.
The resulting clauses are HOL disjunctions.*) fun make_clauses_unsorted ctxt ths = k1 .ut_name_hint label^string_of_int k )th: hs
make_clauses= make_ordfewerlitsoomake_clauses_unsorted
(*Convert a list of clauses (disjunctions) to Horn clauses (contrapositives)*) funfun th=forall(o1 literals(hmprop_ofth);
neg_clauses filter ;
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
(*Could simply use nprems_of, which would count remaining subgoals -- no
discrimination as to their size! With BEST_FIRST, fails for problem 41.*)
fun best_prolog_tac hornsjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
BEST_FIRST (.no_prems sizef)(prolog_step_tac ctxt horns 1);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
DEPTH_FIRST aconv)
(*Return all negative clauses, as possible goal clauses*) fun gocls cls = .st
fun skolemize_prems_tac simp_options ctxt prems =
( try_skolemize_etcsimp_options)prems java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 36
Function mkcl converts theorems to clauses.*)
preskolem_tac st java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
SELECT_GOAL
(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
resolve_tac ctxt resolve_tac i THEN check_tac THEN
preskolem_tac
Subgoal.FOCUS fun p (.)+java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
EVERY1 [java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 0
Subgoalco ')] handle THM _ java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
(** Best-first search versions **)
(*ths is a list of additional clauses (HOL disjunctions) to use.*) funjava.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 21
MESON then make_nnf1 ctxt (tryres(th, nnf_rls))
fn=
THEN_BEST_FIRST (resolve_tac ctxt java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 41
( java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
ctxt
(*First, breaks the goal into independent units*) fun which are needed to avoid java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
( (java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 87
(** Depth-first search version **)
fun depth_meson_tac
MESON all_tac (make_clauses ctxt)
( >[java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 94
(** Iterative deepening version **)
(*This version does only one inference per call;<>close,<\defined_Ex<java.lang.StringIndexOutOfBoundsException: Range [82, 81) out of bounds for length 151
having only one eq_assume_tac speeds it up!*) fun prolog_step_tac' ctxt horns = letvalhorn0s=(*0 subgoals vs 1 or more*)
<const_name\openLet<>java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 val nrtac = r ctxt(. hornsjava.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 infni= i
match_tac ((assume_tacctxtiAPPENDnrtaci)THENcheck_tac) end;
funiter_deepen_meson_tacfunjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 (case(gocls(cls@ths))of
[] => no_tac (*no goal clauses*)
| goes th let val horns = java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 val f)
cat_lines >java.lang.StringIndexOutOfBoundsException: Range [34, 29) out of bounds for length 38
|ctxt "" (string_of_thmctxt)horns) in ctxt=
THEN_ITER_DEEPEN iter_deepen_limit
(resolve_tac ctxt goes java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 74 end);
fun txt java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
SELECT_GOAL ,list_comb head1,mapsndpats)
(**** Code to support ordinary resolution, rather than Model Elimination ****)
(*Convert a list of clauses (disjunctions) to meta-level clauses (==>),
with no contrapositives, for ordinary resolution.*)
(*Rules to convert the head literal into a negated assumption. If the head literal
prevents a double negation.*)
lemma\not P<java.lang.StringIndexOutOfBoundsException: Range [72, 70) out of bounds for length 95
={java.lang.StringIndexOutOfBoundsException: Range [25, 24) out of bounds for length 96
SOMETp )>((.uuT )java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56 handle > RSjava.lang.StringIndexOutOfBoundsException: Range [53, 51) out of bounds for length 53
(*Converting one theorem from a disjunction to a meta-level clause*) fun java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 30
(, java.lang.StringIndexOutOfBoundsException: Range [62, 63) out of bounds for length 62 in
zjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 67
java.lang.StringIndexOutOfBoundsException: Range [6, 7) out of bounds for length 6
fun make_meta_clauses ctxt ths =
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 24
(distinct Thm.eq_thm_prop (map (make_meta_clause ctxt) ths));
end;
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.13Bemerkung:
¤