src/Pure/Isar/attrib.ML
changeset 11770 b6bb7a853dd2
parent 11763 41ae2eb50bbf
child 11775 e7eeca372b7c
equal deleted inserted replaced
11769:1fcf1eb51608 11770:b6bb7a853dd2
   276 fun consumes x = syntax (Scan.lift (Scan.optional Args.nat 1) >> RuleCases.consumes) x;
   276 fun consumes x = syntax (Scan.lift (Scan.optional Args.nat 1) >> RuleCases.consumes) x;
   277 fun case_names x = syntax (Scan.lift (Scan.repeat1 Args.name) >> RuleCases.case_names) x;
   277 fun case_names x = syntax (Scan.lift (Scan.repeat1 Args.name) >> RuleCases.case_names) x;
   278 fun params x = syntax (Args.and_list1 (Scan.lift (Scan.repeat Args.name)) >> RuleCases.params) x;
   278 fun params x = syntax (Args.and_list1 (Scan.lift (Scan.repeat Args.name)) >> RuleCases.params) x;
   279 
   279 
   280 
   280 
       
   281 (* rule_format *)
       
   282 
       
   283 fun rule_format_att x = syntax
       
   284   (Scan.lift (Args.parens (Args.$$$ "no_asm")
       
   285   >> K ObjectLogic.rule_format_no_asm || Scan.succeed ObjectLogic.rule_format)) x;
       
   286 
       
   287 
   281 (* misc rules *)
   288 (* misc rules *)
   282 
   289 
   283 fun standard x = no_args (Drule.rule_attribute (K Drule.standard)) x;
   290 fun standard x = no_args (Drule.rule_attribute (K Drule.standard)) x;
   284 fun elim_format x = no_args (Drule.rule_attribute (K Tactic.make_elim)) x;
   291 fun elim_format x = no_args (Drule.rule_attribute (K Tactic.make_elim)) x;
   285 fun no_vars x = no_args (Drule.rule_attribute (K (#1 o Drule.freeze_thaw))) x;
   292 fun no_vars x = no_args (Drule.rule_attribute (K (#1 o Drule.freeze_thaw))) x;
   286 
   293 
   287 fun exported_global x = no_args (Drule.rule_attribute (Proof.export_thm o ProofContext.init)) x;
   294 fun exported_global x = no_args (Drule.rule_attribute (Proof.export_thm o ProofContext.init)) x;
   288 fun exported_local x = no_args (Drule.rule_attribute Proof.export_thm) x;
   295 fun exported_local x = no_args (Drule.rule_attribute Proof.export_thm) x;
       
   296 
   289 
   297 
   290 
   298 
   291 (** theory setup **)
   299 (** theory setup **)
   292 
   300 
   293 (* pure_attributes *)
   301 (* pure_attributes *)
   307   ("no_vars", (no_vars, no_vars), "frozen schematic vars"),
   315   ("no_vars", (no_vars, no_vars), "frozen schematic vars"),
   308   ("consumes", (consumes, consumes), "number of consumed facts"),
   316   ("consumes", (consumes, consumes), "number of consumed facts"),
   309   ("case_names", (case_names, case_names), "named rule cases"),
   317   ("case_names", (case_names, case_names), "named rule cases"),
   310   ("params", (params, params), "named rule parameters"),
   318   ("params", (params, params), "named rule parameters"),
   311   ("exported", (exported_global, exported_local), "theorem exported from context"),
   319   ("exported", (exported_global, exported_local), "theorem exported from context"),
   312   ("atomize", (no_args ObjectLogic.atomize, no_args undef_local_attribute),
   320   ("atomize", (no_args ObjectLogic.declare_atomize, no_args undef_local_attribute),
   313     "declaration of atomize rule")];
   321     "declaration of atomize rule"),
       
   322   ("rulify", (no_args ObjectLogic.declare_rulify, no_args undef_local_attribute),
       
   323     "declaration of rulify rule"),
       
   324   ("rule_format", (rule_format_att, rule_format_att), "result put into standard rule format")];
   314 
   325 
   315 
   326 
   316 (* setup *)
   327 (* setup *)
   317 
   328 
   318 val setup = [AttributesData.init, add_attributes pure_attributes];
   329 val setup = [AttributesData.init, add_attributes pure_attributes];