| author | nipkow | 
| Mon, 01 Sep 2008 22:10:42 +0200 | |
| changeset 28072 | a45e8c872dc1 | 
| parent 27809 | a1e409db516b | 
| child 28083 | 103d9282a946 | 
| permissions | -rw-r--r-- | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 1 | (* ID: $Id$ | 
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 2 | Author: Christian Urban and Makarius | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 3 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 4 | The nominal induct proof method. | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 5 | *) | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 6 | |
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 7 | structure NominalInduct: | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 8 | sig | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 9 | val nominal_induct_tac: Proof.context -> (string option * term) option list list -> | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 10 | (string * typ) list -> (string * typ) list list -> thm list -> | 
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 11 | thm list -> int -> RuleCases.cases_tactic | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 12 | val nominal_induct_method: Method.src -> Proof.context -> Method.method | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 13 | end = | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 14 | struct | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 15 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 16 | (* proper tuples -- nested left *) | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 17 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 18 | fun tupleT Ts = HOLogic.unitT |> fold (fn T => fn U => HOLogic.mk_prodT (U, T)) Ts; | 
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 19 | fun tuple ts = HOLogic.unit |> fold (fn t => fn u => HOLogic.mk_prod (u, t)) ts; | 
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 20 | |
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 21 | fun tuple_fun Ts (xi, T) = | 
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 22 | Library.funpow (length Ts) HOLogic.mk_split | 
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 23 | (Var (xi, (HOLogic.unitT :: Ts) ---> Term.range_type T)); | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 24 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 25 | val split_all_tuples = | 
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 26 | Simplifier.full_simplify (HOL_basic_ss addsimps | 
| 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 27 | [split_conv, split_paired_all, unit_all_eq1, thm "fresh_unit_elim", thm "fresh_prod_elim"]); | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 28 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 29 | |
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 30 | (* prepare rule *) | 
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 31 | |
| 19903 | 32 | fun inst_mutual_rule ctxt insts avoiding rules = | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 33 | let | 
| 22072 | 34 | |
| 35 | val (nconcls, joined_rule) = RuleCases.strict_mutual_rule ctxt rules; | |
| 36 | val concls = Logic.dest_conjunctions (Thm.concl_of joined_rule); | |
| 37 | val (cases, consumes) = RuleCases.get joined_rule; | |
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 38 | |
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 39 | val l = length rules; | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 40 | val _ = | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 41 | if length insts = l then () | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 42 |       else error ("Bad number of instantiations for " ^ string_of_int l ^ " rules");
 | 
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 43 | |
| 22072 | 44 | fun subst inst concl = | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 45 | let | 
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 46 | val vars = Induct.vars_of concl; | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 47 | val m = length vars and n = length inst; | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 48 | val _ = if m >= n + 2 then () else error "Too few variables in conclusion of rule"; | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 49 | val P :: x :: ys = vars; | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 50 | val zs = Library.drop (m - n - 2, ys); | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 51 | in | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 52 | (P, tuple_fun (map #2 avoiding) (Term.dest_Var P)) :: | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 53 | (x, tuple (map Free avoiding)) :: | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 54 | List.mapPartial (fn (z, SOME t) => SOME (z, t) | _ => NONE) (zs ~~ inst) | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 55 | end; | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 56 | val substs = | 
| 22072 | 57 | map2 subst insts concls |> List.concat |> distinct (op =) | 
| 19903 | 58 | |> map (pairself (Thm.cterm_of (ProofContext.theory_of ctxt))); | 
| 22072 | 59 | in | 
| 60 | (((cases, nconcls), consumes), Drule.cterm_instantiate substs joined_rule) | |
| 61 | end; | |
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 62 | |
| 18299 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 63 | fun rename_params_rule internal xs rule = | 
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 64 | let | 
| 18299 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 65 | val tune = | 
| 20072 | 66 | if internal then Name.internal | 
| 67 | else fn x => the_default x (try Name.dest_internal x); | |
| 18299 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 68 | val n = length xs; | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 69 | fun rename prem = | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 70 | let | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 71 | val ps = Logic.strip_params prem; | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 72 | val p = length ps; | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 73 | val ys = | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 74 | if p < n then [] | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 75 | else map (tune o #1) (Library.take (p - n, ps)) @ xs; | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 76 | in Logic.list_rename_params (ys, prem) end; | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 77 | fun rename_prems prop = | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 78 | let val (As, C) = Logic.strip_horn (Thm.prop_of rule) | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 79 | in Logic.list_implies (map rename As, C) end; | 
| 
af72dfc4b9f9
added rename_params_rule: recover orginal fresh names in subgoals/cases;
 wenzelm parents: 
18297diff
changeset | 80 | in Thm.equal_elim (Thm.reflexive (Drule.cterm_fun rename_prems (Thm.cprop_of rule))) rule end; | 
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 81 | |
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 82 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 83 | (* nominal_induct_tac *) | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 84 | |
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 85 | fun nominal_induct_tac ctxt def_insts avoiding fixings rules facts = | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 86 | let | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 87 | val thy = ProofContext.theory_of ctxt; | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 88 | val cert = Thm.cterm_of thy; | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 89 | |
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 90 | val ((insts, defs), defs_ctxt) = fold_map Induct.add_defs def_insts ctxt |>> split_list; | 
| 23591 | 91 | val atomized_defs = map (map (Conv.fconv_rule ObjectLogic.atomize)) defs; | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 92 | |
| 19115 | 93 | val finish_rule = | 
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 94 | split_all_tuples | 
| 26712 
e2dcda7b0401
adapted to ProofContext.revert_skolem: extra Name.clean required;
 wenzelm parents: 
25985diff
changeset | 95 | #> rename_params_rule true | 
| 
e2dcda7b0401
adapted to ProofContext.revert_skolem: extra Name.clean required;
 wenzelm parents: 
25985diff
changeset | 96 | (map (Name.clean o ProofContext.revert_skolem defs_ctxt o fst) avoiding); | 
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 97 | fun rule_cases r = RuleCases.make_nested true (Thm.prop_of r) (Induct.rulified_term r); | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 98 | in | 
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 99 | (fn i => fn st => | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 100 | rules | 
| 19903 | 101 | |> inst_mutual_rule ctxt insts avoiding | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 102 | |> RuleCases.consume (List.concat defs) facts | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 103 | |> Seq.maps (fn (((cases, concls), (more_consumes, more_facts)), rule) => | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 104 | (PRECISE_CONJUNCTS (length concls) (ALLGOALS (fn j => | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 105 | (CONJUNCTS (ALLGOALS | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 106 | (Method.insert_tac (more_facts @ nth_list atomized_defs (j - 1)) | 
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 107 | THEN' Induct.fix_tac defs_ctxt | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 108 | (nth concls (j - 1) + more_consumes) | 
| 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 109 | (nth_list fixings (j - 1)))) | 
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 110 | THEN' Induct.inner_atomize_tac) j)) | 
| 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 111 | THEN' Induct.atomize_tac) i st |> Seq.maps (fn st' => | 
| 26940 | 112 | Induct.guess_instance ctxt | 
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 113 | (finish_rule (Induct.internalize more_consumes rule)) i st' | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 114 | |> Seq.maps (fn rule' => | 
| 19115 | 115 | CASES (rule_cases rule' cases) | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 116 | (Tactic.rtac (rename_params_rule false [] rule') i THEN | 
| 20288 | 117 | PRIMITIVE (singleton (ProofContext.export defs_ctxt ctxt))) st')))) | 
| 24830 
a7b3ab44d993
moved Pure/Isar/induct_attrib.ML and Provers/induct_method.ML to Tools/induct.ML;
 wenzelm parents: 
23591diff
changeset | 118 | THEN_ALL_NEW_CASES Induct.rulify_tac | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 119 | end; | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 120 | |
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 121 | |
| 18288 
feb79a6b274b
proper treatment of tuple/tuple_fun -- nest to the left!
 wenzelm parents: 
18283diff
changeset | 122 | (* concrete syntax *) | 
| 17870 | 123 | |
| 124 | local | |
| 125 | ||
| 27809 
a1e409db516b
unified Args.T with OuterLex.token, renamed some operations;
 wenzelm parents: 
27370diff
changeset | 126 | structure P = OuterParse; | 
| 
a1e409db516b
unified Args.T with OuterLex.token, renamed some operations;
 wenzelm parents: 
27370diff
changeset | 127 | |
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 128 | val avoidingN = "avoiding"; | 
| 20998 
714a08286899
To be consistent with "induct", I renamed "fixing" to "arbitrary".
 urbanc parents: 
20288diff
changeset | 129 | val fixingN = "arbitrary"; (* to be consistent with induct; hopefully this changes again *) | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 130 | val ruleN = "rule"; | 
| 17870 | 131 | |
| 19036 | 132 | val inst = Scan.lift (Args.$$$ "_") >> K NONE || Args.term >> SOME; | 
| 17870 | 133 | |
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 134 | val def_inst = | 
| 25985 | 135 | ((Scan.lift (Args.name --| (Args.$$$ "\<equiv>" || Args.$$$ "==")) >> SOME) | 
| 19036 | 136 | -- Args.term) >> SOME || | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 137 | inst >> Option.map (pair NONE); | 
| 18099 | 138 | |
| 27370 | 139 | val free = Args.context -- Args.term >> (fn (_, Free v) => v | (ctxt, t) => | 
| 140 |   error ("Bad free variable: " ^ Syntax.string_of_term ctxt t));
 | |
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 141 | |
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 142 | fun unless_more_args scan = Scan.unless (Scan.lift | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 143 | ((Args.$$$ avoidingN || Args.$$$ fixingN || Args.$$$ ruleN) -- Args.colon)) scan; | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 144 | |
| 17870 | 145 | |
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 146 | val avoiding = Scan.optional (Scan.lift (Args.$$$ avoidingN -- Args.colon) |-- | 
| 18297 
116fe71fad51
fresh: frees instead of terms, rename corresponding params in rule;
 wenzelm parents: 
18288diff
changeset | 147 | Scan.repeat (unless_more_args free)) []; | 
| 17870 | 148 | |
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 149 | val fixing = Scan.optional (Scan.lift (Args.$$$ fixingN -- Args.colon) |-- | 
| 27809 
a1e409db516b
unified Args.T with OuterLex.token, renamed some operations;
 wenzelm parents: 
27370diff
changeset | 150 | P.and_list' (Scan.repeat (unless_more_args free))) []; | 
| 17870 | 151 | |
| 19036 | 152 | val rule_spec = Scan.lift (Args.$$$ "rule" -- Args.colon) |-- Attrib.thms; | 
| 17870 | 153 | |
| 154 | in | |
| 155 | ||
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 156 | fun nominal_induct_method src = | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 157 | Method.syntax | 
| 27809 
a1e409db516b
unified Args.T with OuterLex.token, renamed some operations;
 wenzelm parents: 
27370diff
changeset | 158 | (P.and_list' (Scan.repeat (unless_more_args def_inst)) -- | 
| 18583 
96e1ef2f806f
proper handling of simultaneous goals and mutual rules;
 wenzelm parents: 
18311diff
changeset | 159 | avoiding -- fixing -- rule_spec) src | 
| 21879 | 160 | #> (fn ((((x, y), z), w), ctxt) => | 
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 161 | Method.RAW_METHOD_CASES (fn facts => | 
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 162 | HEADGOAL (nominal_induct_tac ctxt x y z w facts))); | 
| 17870 | 163 | |
| 164 | end; | |
| 18283 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 165 | |
| 
f8a49f09a202
reworked version with proper support for defs, fixes, fresh specification;
 wenzelm parents: 
18265diff
changeset | 166 | end; |