src/HOL/Eisbach/eisbach_rule_insts.ML
changeset 62162 dca35981c8fb
parent 62135 fcf3bb1b54e1
child 69593 3dda49e08b9d
equal deleted inserted replaced
62161:9aa4012fc45d 62162:dca35981c8fb
   202     (Attrib.setup @{binding "where"}
   202     (Attrib.setup @{binding "where"}
   203       (Scan.lift
   203       (Scan.lift
   204         (Parse.and_list1 (Args.var -- (Args.$$$ "=" |-- Parse_Tools.name_term)) -- Parse.for_fixes)
   204         (Parse.and_list1 (Args.var -- (Args.$$$ "=" |-- Parse_Tools.name_term)) -- Parse.for_fixes)
   205         >> (fn args =>
   205         >> (fn args =>
   206             let val args' = read_where_insts args in
   206             let val args' = read_where_insts args in
   207               Thm.mixed_attribute (fn (context, thm) =>
   207               fn (context, thm) =>
   208                 (context, read_instantiate_closed (Context.proof_of context) args' thm))
   208                 (NONE, SOME (read_instantiate_closed (Context.proof_of context) args' thm))
   209             end))
   209             end))
   210       "named instantiation of theorem");
   210       "named instantiation of theorem");
   211 
   211 
   212 val _ =
   212 val _ =
   213   Theory.setup
   213   Theory.setup
   219             Parse.for_fixes)) -- Scan.state >>
   219             Parse.for_fixes)) -- Scan.state >>
   220       (fn ((unchecked, args), context) =>
   220       (fn ((unchecked, args), context) =>
   221         let
   221         let
   222           val read_insts = read_of_insts (not unchecked) context args;
   222           val read_insts = read_of_insts (not unchecked) context args;
   223         in
   223         in
   224           Thm.mixed_attribute (fn (context, thm) =>
   224           fn (context, thm) =>
   225             let val thm' =
   225             let val thm' =
   226               if Thm.is_free_dummy thm andalso unchecked
   226               if Thm.is_free_dummy thm andalso unchecked
   227               then Drule.free_dummy_thm
   227               then Drule.free_dummy_thm
   228               else read_instantiate_closed (Context.proof_of context) (read_insts thm) thm
   228               else read_instantiate_closed (Context.proof_of context) (read_insts thm) thm
   229             in (context, thm') end)
   229             in (NONE, SOME thm') end
   230         end))
   230         end))
   231       "positional instantiation of theorem");
   231       "positional instantiation of theorem");
   232 
   232 
   233 end;
   233 end;