src/Provers/induct_method.ML
changeset 24022 ab76c73b3b58
parent 23591 d32a85385e17
equal deleted inserted replaced
24021:491c68f40bc4 24022:ab76c73b3b58
   474 
   474 
   475 fun single_rule [rule] = rule
   475 fun single_rule [rule] = rule
   476   | single_rule _ = error "Single rule expected";
   476   | single_rule _ = error "Single rule expected";
   477 
   477 
   478 fun named_rule k arg get =
   478 fun named_rule k arg get =
   479   Scan.lift (Args.$$$ k -- Args.colon) |-- Scan.repeat arg :--
   479   Scan.lift (Args.$$$ k -- Args.colon) |-- Scan.repeat arg :|--
   480     (fn names => Scan.peek (fn context => Scan.succeed (names |> map (fn name =>
   480     (fn names => Scan.peek (fn context => Scan.succeed (names |> map (fn name =>
   481       (case get (Context.proof_of context) name of SOME x => x
   481       (case get (Context.proof_of context) name of SOME x => x
   482       | NONE => error ("No rule for " ^ k ^ " " ^ quote name)))))) >> #2;
   482       | NONE => error ("No rule for " ^ k ^ " " ^ quote name))))));
   483 
   483 
   484 fun rule get_type get_set =
   484 fun rule get_type get_set =
   485   named_rule InductAttrib.typeN Args.tyname get_type ||
   485   named_rule InductAttrib.typeN Args.tyname get_type ||
   486   named_rule InductAttrib.setN Args.const get_set ||
   486   named_rule InductAttrib.setN Args.const get_set ||
   487   Scan.lift (Args.$$$ ruleN -- Args.colon) |-- Attrib.thms;
   487   Scan.lift (Args.$$$ ruleN -- Args.colon) |-- Attrib.thms;