| author | hoelzl | 
| Fri, 14 Nov 2014 13:18:33 +0100 | |
| changeset 59002 | 2c8b2fb54b88 | 
| parent 58839 | ccda99401bc8 | 
| child 59058 | a78612c67ec0 | 
| permissions | -rw-r--r-- | 
| 44651 
5d6a11e166cf
renamed "Metis_Tactics" to "Metis_Tactic", now that there is only one Metis tactic ("metisFT" is legacy)
 blanchet parents: 
44634diff
changeset | 1 | (* Title: HOL/Tools/Metis/metis_tactic.ML | 
| 38027 | 2 | Author: Kong W. Susanto, Cambridge University Computer Laboratory | 
| 3 | Author: Lawrence C. Paulson, Cambridge University Computer Laboratory | |
| 4 | Author: Jasmin Blanchette, TU Muenchen | |
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 5 | Copyright Cambridge University 2007 | 
| 23447 | 6 | |
| 29266 | 7 | HOL setup for the Metis prover. | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 8 | *) | 
| 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 9 | |
| 44651 
5d6a11e166cf
renamed "Metis_Tactics" to "Metis_Tactic", now that there is only one Metis tactic ("metisFT" is legacy)
 blanchet parents: 
44634diff
changeset | 10 | signature METIS_TACTIC = | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 11 | sig | 
| 39979 
b13515940b53
added "trace_meson" configuration option, replacing old-fashioned reference
 blanchet parents: 
39978diff
changeset | 12 | val trace : bool Config.T | 
| 40665 
1a65f0c74827
added "verbose" option to Metis to shut up its warnings if necessary
 blanchet parents: 
40262diff
changeset | 13 | val verbose : bool Config.T | 
| 50705 
0e943b33d907
use new skolemizer for reconstructing skolemization steps in Isar proofs (because the old skolemizer messes up the order of the Skolem arguments)
 blanchet parents: 
50694diff
changeset | 14 | val new_skolem : bool Config.T | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 15 | val advisory_simp : bool Config.T | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 16 | val metis_tac_unused : string list -> string -> Proof.context -> thm list -> int -> thm -> | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 17 | thm list * thm Seq.seq | 
| 54756 | 18 | val metis_tac : string list -> string -> Proof.context -> thm list -> int -> tactic | 
| 45521 | 19 | val metis_lam_transs : string list | 
| 45519 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 20 | val parse_metis_options : (string list option * string option) parser | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 21 | end | 
| 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 22 | |
| 44651 
5d6a11e166cf
renamed "Metis_Tactics" to "Metis_Tactic", now that there is only one Metis tactic ("metisFT" is legacy)
 blanchet parents: 
44634diff
changeset | 23 | structure Metis_Tactic : METIS_TACTIC = | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 24 | struct | 
| 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 25 | |
| 46320 | 26 | open ATP_Problem_Generate | 
| 27 | open ATP_Proof_Reconstruct | |
| 28 | open Metis_Generate | |
| 39497 
fa16349939b7
complete refactoring of Metis along the lines of Sledgehammer
 blanchet parents: 
39494diff
changeset | 29 | open Metis_Reconstruct | 
| 35826 | 30 | |
| 54756 | 31 | val new_skolem = Attrib.setup_config_bool @{binding metis_new_skolem} (K false)
 | 
| 32 | val advisory_simp = Attrib.setup_config_bool @{binding metis_advisory_simp} (K true)
 | |
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 33 | |
| 43134 
0c82e00ba63e
make sure no warnings are given for polymorphic facts where we use a monomorphic instance
 blanchet parents: 
43133diff
changeset | 34 | (* Designed to work also with monomorphic instances of polymorphic theorems. *) | 
| 39497 
fa16349939b7
complete refactoring of Metis along the lines of Sledgehammer
 blanchet parents: 
39494diff
changeset | 35 | fun have_common_thm ths1 ths2 = | 
| 54756 | 36 | exists (member (Term.aconv_untyped o pairself prop_of) ths1) (map Meson.make_meta_clause ths2) | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 37 | |
| 32956 | 38 | (*Determining which axiom clauses are actually used*) | 
| 39419 
c9accfd621a5
"Metis." -> "Metis_" to reflect change in "metis.ML"
 blanchet parents: 
39376diff
changeset | 39 | fun used_axioms axioms (th, Metis_Proof.Axiom _) = SOME (lookth axioms th) | 
| 43128 | 40 | | used_axioms _ _ = NONE | 
| 24855 | 41 | |
| 43129 | 42 | (* Lightweight predicate type information comes in two flavors, "t = t'" and | 
| 43 | "t => t'", where "t" and "t'" are the same term modulo type tags. | |
| 44 | In Isabelle, type tags are stripped away, so we are left with "t = t" or | |
| 43159 
29b55f292e0b
added support for helpers in new Metis, so far only for polymorphic type encodings
 blanchet parents: 
43136diff
changeset | 45 | "t => t". Type tag idempotence is also handled this way. *) | 
| 52031 
9a9238342963
tuning -- renamed '_from_' to '_of_' in Sledgehammer
 blanchet parents: 
51717diff
changeset | 46 | fun reflexive_or_trivial_of_metis ctxt type_enc sym_tab concealed mth = | 
| 43136 
cf5cda219058
handle lightweight tags sym theorems gracefully in the presence of TVars with interesting type classes
 blanchet parents: 
43135diff
changeset | 47 | let val thy = Proof_Context.theory_of ctxt in | 
| 57408 | 48 | (case hol_clause_of_metis ctxt type_enc sym_tab concealed mth of | 
| 43136 
cf5cda219058
handle lightweight tags sym theorems gracefully in the presence of TVars with interesting type classes
 blanchet parents: 
43135diff
changeset | 49 |       Const (@{const_name HOL.eq}, _) $ _ $ t =>
 | 
| 44408 
30ea62ab4f16
made reconstruction of type tag equalities "\?x = \?x" reliable
 blanchet parents: 
44402diff
changeset | 50 | let | 
| 
30ea62ab4f16
made reconstruction of type tag equalities "\?x = \?x" reliable
 blanchet parents: 
44402diff
changeset | 51 | val ct = cterm_of thy t | 
| 
30ea62ab4f16
made reconstruction of type tag equalities "\?x = \?x" reliable
 blanchet parents: 
44402diff
changeset | 52 | val cT = ctyp_of_term ct | 
| 
30ea62ab4f16
made reconstruction of type tag equalities "\?x = \?x" reliable
 blanchet parents: 
44402diff
changeset | 53 | in refl |> Drule.instantiate' [SOME cT] [SOME ct] end | 
| 43136 
cf5cda219058
handle lightweight tags sym theorems gracefully in the presence of TVars with interesting type classes
 blanchet parents: 
43135diff
changeset | 54 |     | Const (@{const_name disj}, _) $ t1 $ t2 =>
 | 
| 
cf5cda219058
handle lightweight tags sym theorems gracefully in the presence of TVars with interesting type classes
 blanchet parents: 
43135diff
changeset | 55 | (if can HOLogic.dest_not t1 then t2 else t1) | 
| 
cf5cda219058
handle lightweight tags sym theorems gracefully in the presence of TVars with interesting type classes
 blanchet parents: 
43135diff
changeset | 56 | |> HOLogic.mk_Trueprop |> cterm_of thy |> Thm.trivial | 
| 57408 | 57 | | _ => raise Fail "expected reflexive or trivial clause") | 
| 43136 
cf5cda219058
handle lightweight tags sym theorems gracefully in the presence of TVars with interesting type classes
 blanchet parents: 
43135diff
changeset | 58 | end | 
| 43129 | 59 | |> Meson.make_meta_clause | 
| 60 | ||
| 52031 
9a9238342963
tuning -- renamed '_from_' to '_of_' in Sledgehammer
 blanchet parents: 
51717diff
changeset | 61 | fun lam_lifted_of_metis ctxt type_enc sym_tab concealed mth = | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 62 | let | 
| 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 63 | val thy = Proof_Context.theory_of ctxt | 
| 58839 | 64 |     val tac = rewrite_goals_tac ctxt @{thms lambda_def [abs_def]} THEN resolve_tac [refl] 1
 | 
| 52031 
9a9238342963
tuning -- renamed '_from_' to '_of_' in Sledgehammer
 blanchet parents: 
51717diff
changeset | 65 | val t = hol_clause_of_metis ctxt type_enc sym_tab concealed mth | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 66 | val ct = cterm_of thy (HOLogic.mk_Trueprop t) | 
| 54883 
dd04a8b654fc
proper context for norm_hhf and derived operations;
 wenzelm parents: 
54756diff
changeset | 67 | in Goal.prove_internal ctxt [] ct (K tac) |> Meson.make_meta_clause end | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 68 | |
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 69 | fun add_vars_and_frees (t $ u) = fold (add_vars_and_frees) [t, u] | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 70 | | add_vars_and_frees (Abs (_, _, t)) = add_vars_and_frees t | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 71 | | add_vars_and_frees (t as Var _) = insert (op =) t | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 72 | | add_vars_and_frees (t as Free _) = insert (op =) t | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 73 | | add_vars_and_frees _ = I | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 74 | |
| 45569 
eb30a5490543
wrap lambdas earlier, to get more control over beta/eta
 blanchet parents: 
45568diff
changeset | 75 | fun introduce_lam_wrappers ctxt th = | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 76 | if Meson_Clausify.is_quasi_lambda_free (prop_of th) then | 
| 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 77 | th | 
| 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 78 | else | 
| 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 79 | let | 
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 80 | val thy = Proof_Context.theory_of ctxt | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 81 | fun conv first ctxt ct = | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 82 | if Meson_Clausify.is_quasi_lambda_free (term_of ct) then | 
| 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 83 | Thm.reflexive ct | 
| 57408 | 84 | else | 
| 85 | (case term_of ct of | |
| 86 | Abs (_, _, u) => | |
| 87 | if first then | |
| 88 | (case add_vars_and_frees u [] of | |
| 89 | [] => | |
| 90 | Conv.abs_conv (conv false o snd) ctxt ct | |
| 91 |                 |> (fn th => Meson.first_order_resolve th @{thm Metis.eq_lambdaI})
 | |
| 92 | | v :: _ => | |
| 93 | Abs (Name.uu, fastype_of v, abstract_over (v, term_of ct)) $ v | |
| 94 | |> cterm_of thy | |
| 95 | |> Conv.comb_conv (conv true ctxt)) | |
| 96 | else | |
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 97 | Conv.abs_conv (conv false o snd) ctxt ct | 
| 57408 | 98 |           | Const (@{const_name Meson.skolem}, _) $ _ => Thm.reflexive ct
 | 
| 99 | | _ => Conv.comb_conv (conv true ctxt) ct) | |
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 100 | val eq_th = conv true ctxt (cprop_of th) | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 101 | (* We replace the equation's left-hand side with a beta-equivalent term | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 102 | so that "Thm.equal_elim" works below. *) | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 103 | val t0 $ _ $ t2 = prop_of eq_th | 
| 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 104 | val eq_ct = t0 $ prop_of th $ t2 |> cterm_of thy | 
| 58839 | 105 | val eq_th' = Goal.prove_internal ctxt [] eq_ct (K (resolve_tac [eq_th] 1)) | 
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 106 | in Thm.equal_elim eq_th' th end | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 107 | |
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 108 | fun clause_params ordering = | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 109 |   {ordering = ordering,
 | 
| 44492 
a330c0608da8
avoid using ":" for anything but systematic type tag annotations, because Hurd's Metis gives it that special semantics
 blanchet parents: 
44411diff
changeset | 110 | orderLiterals = Metis_Clause.UnsignedLiteralOrder, | 
| 39450 
7e9879fbb7c5
supply the Metis parameter defaults as argument, instead of patching the Metis sources;
 blanchet parents: 
39419diff
changeset | 111 | orderTerms = true} | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 112 | fun active_params ordering = | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 113 |   {clause = clause_params ordering,
 | 
| 39450 
7e9879fbb7c5
supply the Metis parameter defaults as argument, instead of patching the Metis sources;
 blanchet parents: 
39419diff
changeset | 114 | prefactor = #prefactor Metis_Active.default, | 
| 
7e9879fbb7c5
supply the Metis parameter defaults as argument, instead of patching the Metis sources;
 blanchet parents: 
39419diff
changeset | 115 | postfactor = #postfactor Metis_Active.default} | 
| 
7e9879fbb7c5
supply the Metis parameter defaults as argument, instead of patching the Metis sources;
 blanchet parents: 
39419diff
changeset | 116 | val waiting_params = | 
| 
7e9879fbb7c5
supply the Metis parameter defaults as argument, instead of patching the Metis sources;
 blanchet parents: 
39419diff
changeset | 117 |   {symbolsWeight = 1.0,
 | 
| 47047 
10bece4ac87e
more conservative Metis defaults, for backward compatiblity (as illustrated by one "metis" call in "Auth/KerberosV")
 blanchet parents: 
47045diff
changeset | 118 | variablesWeight = 0.05, | 
| 
10bece4ac87e
more conservative Metis defaults, for backward compatiblity (as illustrated by one "metis" call in "Auth/KerberosV")
 blanchet parents: 
47045diff
changeset | 119 | literalsWeight = 0.01, | 
| 39450 
7e9879fbb7c5
supply the Metis parameter defaults as argument, instead of patching the Metis sources;
 blanchet parents: 
39419diff
changeset | 120 | models = []} | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 121 | fun resolution_params ordering = | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 122 |   {active = active_params ordering, waiting = waiting_params}
 | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 123 | |
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 124 | fun kbo_advisory_simp_ordering ord_info = | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 125 | let | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 126 | fun weight (m, _) = | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 127 | AList.lookup (op =) ord_info (Metis_Name.toString m) |> the_default 1 | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 128 | fun precedence p = | 
| 57408 | 129 | (case int_ord (pairself weight p) of | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 130 | EQUAL => #precedence Metis_KnuthBendixOrder.default p | 
| 57408 | 131 | | ord => ord) | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 132 |   in {weight = weight, precedence = precedence} end
 | 
| 37573 | 133 | |
| 55285 | 134 | fun metis_call type_enc lam_trans = | 
| 135 | let | |
| 136 | val type_enc = | |
| 137 | (case AList.find (fn (enc, encs) => enc = hd encs) type_enc_aliases type_enc of | |
| 138 | [alias] => alias | |
| 139 | | _ => type_enc) | |
| 140 | val opts = | |
| 141 | [] |> type_enc <> partial_typesN ? cons type_enc | |
| 142 | |> lam_trans <> default_metis_lam_trans ? cons lam_trans | |
| 143 |   in metisN ^ (if null opts then "" else " (" ^ commas opts ^ ")") end
 | |
| 144 | ||
| 50875 
bfb626265782
less brutal Metis failure -- the brutality was accidentally introduced by df8ae0590be2
 blanchet parents: 
50705diff
changeset | 145 | exception METIS_UNPROVABLE of unit | 
| 
bfb626265782
less brutal Metis failure -- the brutality was accidentally introduced by df8ae0590be2
 blanchet parents: 
50705diff
changeset | 146 | |
| 37516 
c81c86bfc18a
have "metis" method and "metis_tac" fall back on "metisFT" upon failure, following a suggestion by Larry
 blanchet parents: 
37509diff
changeset | 147 | (* Main function to start Metis proof and reconstruction *) | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 148 | fun FOL_SOLVE unused (type_enc :: fallback_type_encs) lam_trans ctxt cls ths0 = | 
| 42361 | 149 | let val thy = Proof_Context.theory_of ctxt | 
| 50705 
0e943b33d907
use new skolemizer for reconstructing skolemization steps in Isar proofs (because the old skolemizer messes up the order of the Skolem arguments)
 blanchet parents: 
50694diff
changeset | 150 | val new_skolem = | 
| 
0e943b33d907
use new skolemizer for reconstructing skolemization steps in Isar proofs (because the old skolemizer messes up the order of the Skolem arguments)
 blanchet parents: 
50694diff
changeset | 151 | Config.get ctxt new_skolem orelse null (Meson.choice_theorems thy) | 
| 46365 | 152 | val do_lams = | 
| 153 | (lam_trans = liftingN orelse lam_trans = lam_liftingN) | |
| 154 | ? introduce_lam_wrappers ctxt | |
| 35826 | 155 | val th_cls_pairs = | 
| 39894 
35ae5cf8c96a
encode number of skolem assumptions in them, for more efficient retrieval later
 blanchet parents: 
39892diff
changeset | 156 | map2 (fn j => fn th => | 
| 
35ae5cf8c96a
encode number of skolem assumptions in them, for more efficient retrieval later
 blanchet parents: 
39892diff
changeset | 157 | (Thm.get_name_hint th, | 
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 158 | th |> Drule.eta_contraction_rule | 
| 57263 | 159 | |> Meson_Clausify.cnf_axiom ctxt new_skolem (lam_trans = combsN) j | 
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 160 | ||> map do_lams)) | 
| 39894 
35ae5cf8c96a
encode number of skolem assumptions in them, for more efficient retrieval later
 blanchet parents: 
39892diff
changeset | 161 | (0 upto length ths0 - 1) ths0 | 
| 43092 
93ec303e1917
more work on new metis that exploits the powerful new type encodings
 blanchet parents: 
43091diff
changeset | 162 | val ths = maps (snd o snd) th_cls_pairs | 
| 39938 
0a2091f86eb4
fixed two bugs in new skolemizer: instantiations now take types into consideration, and rotate_tac is given the proper offset
 blanchet parents: 
39937diff
changeset | 163 | val dischargers = map (fst o snd) th_cls_pairs | 
| 45570 
6d95a66cce00
pull variables (Var) out of lambdas, so that the Isabelle theorems closely mirror the Metis lambda-lifted ones
 blanchet parents: 
45569diff
changeset | 164 | val cls = cls |> map (Drule.eta_contraction_rule #> do_lams) | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 165 | val _ = trace_msg ctxt (K "FOL_SOLVE: CONJECTURE CLAUSES") | 
| 39978 
11bfb7e7cc86
added "trace_metis" configuration option, replacing old-fashioned references
 blanchet parents: 
39964diff
changeset | 166 | val _ = app (fn th => trace_msg ctxt (fn () => Display.string_of_thm ctxt th)) cls | 
| 44411 
e3629929b171
change Metis's default settings if type information axioms are generated
 blanchet parents: 
44408diff
changeset | 167 | val _ = trace_msg ctxt (fn () => "type_enc = " ^ type_enc) | 
| 52031 
9a9238342963
tuning -- renamed '_from_' to '_of_' in Sledgehammer
 blanchet parents: 
51717diff
changeset | 168 | val type_enc = type_enc_of_string Strict type_enc | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 169 | val (sym_tab, axioms, ord_info, concealed) = | 
| 57263 | 170 | generate_metis_problem ctxt type_enc lam_trans cls ths | 
| 43159 
29b55f292e0b
added support for helpers in new Metis, so far only for polymorphic type encodings
 blanchet parents: 
43136diff
changeset | 171 | fun get_isa_thm mth Isa_Reflexive_or_Trivial = | 
| 52031 
9a9238342963
tuning -- renamed '_from_' to '_of_' in Sledgehammer
 blanchet parents: 
51717diff
changeset | 172 | reflexive_or_trivial_of_metis ctxt type_enc sym_tab concealed mth | 
| 45511 
9b0f8ca4388e
continued implementation of lambda-lifting in Metis
 blanchet parents: 
45508diff
changeset | 173 | | get_isa_thm mth Isa_Lambda_Lifted = | 
| 52031 
9a9238342963
tuning -- renamed '_from_' to '_of_' in Sledgehammer
 blanchet parents: 
51717diff
changeset | 174 | lam_lifted_of_metis ctxt type_enc sym_tab concealed mth | 
| 45569 
eb30a5490543
wrap lambdas earlier, to get more control over beta/eta
 blanchet parents: 
45568diff
changeset | 175 | | get_isa_thm _ (Isa_Raw ith) = ith | 
| 
eb30a5490543
wrap lambdas earlier, to get more control over beta/eta
 blanchet parents: 
45568diff
changeset | 176 | val axioms = axioms |> map (fn (mth, ith) => (mth, get_isa_thm mth ith)) | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 177 | val _ = trace_msg ctxt (K "ISABELLE CLAUSES") | 
| 45559 | 178 | val _ = app (fn (_, ith) => trace_msg ctxt (fn () => Display.string_of_thm ctxt ith)) axioms | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 179 | val _ = trace_msg ctxt (K "METIS CLAUSES") | 
| 45559 | 180 | val _ = app (fn (mth, _) => trace_msg ctxt (fn () => Metis_Thm.toString mth)) axioms | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 181 | val _ = trace_msg ctxt (K "START METIS PROVE PROCESS") | 
| 47039 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 182 | val ordering = | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 183 | if Config.get ctxt advisory_simp then | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 184 | kbo_advisory_simp_ordering (ord_info ()) | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 185 | else | 
| 
1b36a05a070d
added "metis_advisory_simp" option to orient as many equations as possible in Metis the right way (cf. "More SPASS with Isabelle")
 blanchet parents: 
47015diff
changeset | 186 | Metis_KnuthBendixOrder.default | 
| 50875 
bfb626265782
less brutal Metis failure -- the brutality was accidentally introduced by df8ae0590be2
 blanchet parents: 
50705diff
changeset | 187 | fun fall_back () = | 
| 
bfb626265782
less brutal Metis failure -- the brutality was accidentally introduced by df8ae0590be2
 blanchet parents: 
50705diff
changeset | 188 | (verbose_warning ctxt | 
| 55257 | 189 |            ("Falling back on " ^ quote (metis_call (hd fallback_type_encs) lam_trans) ^ "...");
 | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 190 | FOL_SOLVE unused fallback_type_encs lam_trans ctxt cls ths0) | 
| 32956 | 191 | in | 
| 50875 
bfb626265782
less brutal Metis failure -- the brutality was accidentally introduced by df8ae0590be2
 blanchet parents: 
50705diff
changeset | 192 |     (case filter (fn t => prop_of t aconv @{prop False}) cls of
 | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 193 |        false_th :: _ => [false_th RS @{thm FalseE}]
 | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 194 | | [] => | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 195 | (case Metis_Resolution.loop (Metis_Resolution.new (resolution_params ordering) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 196 |          {axioms = axioms |> map fst, conjecture = []}) of
 | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 197 | Metis_Resolution.Contradiction mth => | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 198 | let | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 199 | val _ = trace_msg ctxt (fn () => "METIS RECONSTRUCTION START: " ^ Metis_Thm.toString mth) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 200 | val ctxt' = fold Variable.declare_constraints (map prop_of cls) ctxt | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 201 | (*add constraints arising from converting goal to clause form*) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 202 | val proof = Metis_Proof.proof mth | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 203 | val result = fold (replay_one_inference ctxt' type_enc concealed sym_tab) proof axioms | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 204 | val used = map_filter (used_axioms axioms) proof | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 205 | val _ = trace_msg ctxt (K "METIS COMPLETED; clauses actually used:") | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 206 | val _ = app (fn th => trace_msg ctxt (fn () => Display.string_of_thm ctxt th)) used | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 207 | val (used_th_cls_pairs, unused_th_cls_pairs) = | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 208 | List.partition (have_common_thm used o snd o snd) th_cls_pairs | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 209 | val unused_ths = maps (snd o snd) unused_th_cls_pairs | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 210 | val unused_names = map fst unused_th_cls_pairs | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 211 | in | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 212 | unused := unused_ths; | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 213 | if not (null unused_names) then | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 214 |            verbose_warning ctxt ("Unused theorems: " ^ commas_quote unused_names)
 | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 215 | else | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 216 | (); | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 217 | if not (null cls) andalso not (have_common_thm used cls) then | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 218 | verbose_warning ctxt "The assumptions are inconsistent" | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 219 | else | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 220 | (); | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 221 | (case result of | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 222 | (_, ith) :: _ => | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 223 | (trace_msg ctxt (fn () => "Success: " ^ Display.string_of_thm ctxt ith); | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 224 | [discharge_skolem_premises ctxt dischargers ith]) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 225 | | _ => (trace_msg ctxt (K "Metis: No result"); [])) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 226 | end | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 227 | | Metis_Resolution.Satisfiable _ => | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 228 | (trace_msg ctxt (K "Metis: No first-order proof with the supplied lemmas"); | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 229 | raise METIS_UNPROVABLE ())) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 230 | handle METIS_UNPROVABLE () => if null fallback_type_encs then [] else fall_back () | 
| 50875 
bfb626265782
less brutal Metis failure -- the brutality was accidentally introduced by df8ae0590be2
 blanchet parents: 
50705diff
changeset | 231 | | METIS_RECONSTRUCT (loc, msg) => | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 232 | if null fallback_type_encs then | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 233 |              (verbose_warning ctxt ("Failed to replay Metis proof\n" ^ loc ^ ": " ^ msg); [])
 | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 234 | else | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 235 | fall_back ()) | 
| 42733 
01ef1c3d9cfd
more robust exception handling in Metis (also works if there are several subgoals)
 blanchet parents: 
42650diff
changeset | 236 | end | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 237 | |
| 45508 | 238 | fun neg_clausify ctxt combinators = | 
| 38028 | 239 | single | 
| 43964 
9338aa218f09
thread proper context through, to make sure that "using [[meson_max_clauses = 200]]" is not ignored when clausifying the conjecture
 blanchet parents: 
43963diff
changeset | 240 | #> Meson.make_clauses_unsorted ctxt | 
| 55236 | 241 | #> combinators ? map (Meson_Clausify.introduce_combinators_in_theorem ctxt) | 
| 38028 | 242 | #> Meson.finish_cnf | 
| 243 | ||
| 39269 
c2795d8a2461
use definitional CNF for the goal if at least one of the premisses would lead to too many clauses in Meson
 blanchet parents: 
39267diff
changeset | 244 | fun preskolem_tac ctxt st0 = | 
| 
c2795d8a2461
use definitional CNF for the goal if at least one of the premisses would lead to too many clauses in Meson
 blanchet parents: 
39267diff
changeset | 245 | (if exists (Meson.has_too_many_clauses ctxt) | 
| 
c2795d8a2461
use definitional CNF for the goal if at least one of the premisses would lead to too many clauses in Meson
 blanchet parents: 
39267diff
changeset | 246 | (Logic.prems_of_goal (prop_of st0) 1) then | 
| 51717 
9e7d1c139569
simplifier uses proper Proof.context instead of historic type simpset;
 wenzelm parents: 
50875diff
changeset | 247 |      Simplifier.full_simp_tac (Meson_Clausify.ss_only @{thms not_all not_ex} ctxt) 1
 | 
| 55239 | 248 | THEN CNF.cnfx_rewrite_tac ctxt 1 | 
| 39269 
c2795d8a2461
use definitional CNF for the goal if at least one of the premisses would lead to too many clauses in Meson
 blanchet parents: 
39267diff
changeset | 249 | else | 
| 
c2795d8a2461
use definitional CNF for the goal if at least one of the premisses would lead to too many clauses in Meson
 blanchet parents: 
39267diff
changeset | 250 | all_tac) st0 | 
| 
c2795d8a2461
use definitional CNF for the goal if at least one of the premisses would lead to too many clauses in Meson
 blanchet parents: 
39267diff
changeset | 251 | |
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 252 | fun metis_tac_unused type_encs0 lam_trans ctxt ths i st0 = | 
| 37926 
e6ff246c0cdb
renamings + only need second component of name pool to reconstruct proofs
 blanchet parents: 
37925diff
changeset | 253 | let | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 254 | val unused = Unsynchronized.ref [] | 
| 55520 | 255 | val type_encs = if null type_encs0 then partial_type_encs else type_encs0 | 
| 39978 
11bfb7e7cc86
added "trace_metis" configuration option, replacing old-fashioned references
 blanchet parents: 
39964diff
changeset | 256 | val _ = trace_msg ctxt (fn () => | 
| 55315 | 257 | "Metis called with theorems\n" ^ cat_lines (map (Display.string_of_thm ctxt) ths)) | 
| 45519 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 258 | val type_encs = type_encs |> maps unalias_type_enc | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 259 | val combs = (lam_trans = combsN) | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 260 | fun tac clause = resolve_tac (FOL_SOLVE unused type_encs lam_trans ctxt clause ths) 1 | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 261 | val seq = Meson.MESON (preskolem_tac ctxt) (maps (neg_clausify ctxt combs)) tac ctxt i st0 | 
| 32956 | 262 | in | 
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 263 | (!unused, seq) | 
| 32956 | 264 | end | 
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 265 | |
| 55521 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 266 | fun metis_tac type_encs lam_trans ctxt ths i = snd o metis_tac_unused type_encs lam_trans ctxt ths i | 
| 
241c6a2fdda1
added a version of the Metis tactic that returns the unused facts
 blanchet parents: 
55520diff
changeset | 267 | |
| 55520 | 268 | (* Whenever "X" has schematic type variables, we treat "using X by metis" as "by (metis X)" to | 
| 269 | prevent "Subgoal.FOCUS" from freezing the type variables. We don't do it for nonschematic facts | |
| 270 | "X" because this breaks a few proofs (in the rare and subtle case where a proof relied on | |
| 271 | extensionality not being applied) and brings few benefits. *) | |
| 272 | val has_tvar = exists_type (exists_subtype (fn TVar _ => true | _ => false)) o prop_of | |
| 43034 
18259246abb5
try both "metis" and (on failure) "metisFT" in replay
 blanchet parents: 
42847diff
changeset | 273 | |
| 55315 | 274 | fun metis_method ((override_type_encs, lam_trans), ths) ctxt facts = | 
| 55520 | 275 | let val (schem_facts, nonschem_facts) = List.partition has_tvar facts in | 
| 43099 | 276 | HEADGOAL (Method.insert_tac nonschem_facts THEN' | 
| 55520 | 277 | CHANGED_PROP o metis_tac (these override_type_encs) | 
| 278 | (the_default default_metis_lam_trans lam_trans) ctxt (schem_facts @ ths)) | |
| 43099 | 279 | end | 
| 43100 | 280 | |
| 46365 | 281 | val metis_lam_transs = [hide_lamsN, liftingN, combsN] | 
| 45519 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 282 | |
| 45578 | 283 | fun set_opt _ x NONE = SOME x | 
| 284 | | set_opt get x (SOME x0) = | |
| 55523 
9429e7b5b827
removed final periods in messages for proof methods
 blanchet parents: 
55521diff
changeset | 285 |     error ("Cannot specify both " ^ quote (get x0) ^ " and " ^ quote (get x))
 | 
| 54756 | 286 | |
| 45519 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 287 | fun consider_opt s = | 
| 54756 | 288 | if member (op =) metis_lam_transs s then apsnd (set_opt I s) else apfst (set_opt hd [s]) | 
| 45514 | 289 | |
| 45519 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 290 | val parse_metis_options = | 
| 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 291 | Scan.optional | 
| 58831 
aa8cf5eed06e
proper syntax categery "name" -- as usual and as documented;
 wenzelm parents: 
58818diff
changeset | 292 |       (Args.parens (Args.name -- Scan.option (@{keyword ","} |-- Args.name))
 | 
| 45519 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 293 | >> (fn (s, s') => | 
| 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 294 | (NONE, NONE) |> consider_opt s | 
| 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 295 | |> (case s' of SOME s' => consider_opt s' | _ => I))) | 
| 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 296 | (NONE, NONE) | 
| 
cd6e78cb6ee8
make metis reconstruction handling more flexible
 blanchet parents: 
45514diff
changeset | 297 | |
| 58818 | 298 | val _ = | 
| 299 | Theory.setup | |
| 300 |     (Method.setup @{binding metis}
 | |
| 301 | (Scan.lift parse_metis_options -- Attrib.thms >> (METHOD oo metis_method)) | |
| 302 | "Metis for FOL and HOL problems") | |
| 23442 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 303 | |
| 
028e39e5e8f3
The Metis prover (slightly modified version from Larry);
 wenzelm parents: diff
changeset | 304 | end; |