src/Pure/Pure.thy
changeset 61853 fb7756087101
parent 61671 20d4cd2ceab2
child 61890 f6ded81f5690
equal deleted inserted replaced
61852:d273c24b5776 61853:fb7756087101
   126   \<open>Scan.lift Args.name >> Thm.kind\<close>
   126   \<open>Scan.lift Args.name >> Thm.kind\<close>
   127   "theorem kind"
   127   "theorem kind"
   128 
   128 
   129 attribute_setup THEN =
   129 attribute_setup THEN =
   130   \<open>Scan.lift (Scan.optional (Args.bracks Parse.nat) 1) -- Attrib.thm
   130   \<open>Scan.lift (Scan.optional (Args.bracks Parse.nat) 1) -- Attrib.thm
   131     >> (fn (i, B) => Thm.rule_attribute (fn _ => fn A => A RSN (i, B)))\<close>
   131     >> (fn (i, B) => Thm.rule_attribute [B] (fn _ => fn A => A RSN (i, B)))\<close>
   132   "resolution with rule"
   132   "resolution with rule"
   133 
   133 
   134 attribute_setup OF =
   134 attribute_setup OF =
   135   \<open>Attrib.thms >> (fn Bs => Thm.rule_attribute (fn _ => fn A => A OF Bs))\<close>
   135   \<open>Attrib.thms >> (fn Bs => Thm.rule_attribute Bs (fn _ => fn A => A OF Bs))\<close>
   136   "rule resolved with facts"
   136   "rule resolved with facts"
   137 
   137 
   138 attribute_setup rename_abs =
   138 attribute_setup rename_abs =
   139   \<open>Scan.lift (Scan.repeat (Args.maybe Args.name)) >> (fn vs =>
   139   \<open>Scan.lift (Scan.repeat (Args.maybe Args.name)) >> (fn vs =>
   140     Thm.rule_attribute (K (Drule.rename_bvars' vs)))\<close>
   140     Thm.rule_attribute [] (K (Drule.rename_bvars' vs)))\<close>
   141   "rename bound variables in abstractions"
   141   "rename bound variables in abstractions"
   142 
   142 
   143 attribute_setup unfolded =
   143 attribute_setup unfolded =
   144   \<open>Attrib.thms >> (fn ths =>
   144   \<open>Attrib.thms >> (fn ths =>
   145     Thm.rule_attribute (fn context => Local_Defs.unfold (Context.proof_of context) ths))\<close>
   145     Thm.rule_attribute ths (fn context => Local_Defs.unfold (Context.proof_of context) ths))\<close>
   146   "unfolded definitions"
   146   "unfolded definitions"
   147 
   147 
   148 attribute_setup folded =
   148 attribute_setup folded =
   149   \<open>Attrib.thms >> (fn ths =>
   149   \<open>Attrib.thms >> (fn ths =>
   150     Thm.rule_attribute (fn context => Local_Defs.fold (Context.proof_of context) ths))\<close>
   150     Thm.rule_attribute ths (fn context => Local_Defs.fold (Context.proof_of context) ths))\<close>
   151   "folded definitions"
   151   "folded definitions"
   152 
   152 
   153 attribute_setup consumes =
   153 attribute_setup consumes =
   154   \<open>Scan.lift (Scan.optional Parse.int 1) >> Rule_Cases.consumes\<close>
   154   \<open>Scan.lift (Scan.optional Parse.int 1) >> Rule_Cases.consumes\<close>
   155   "number of consumed facts"
   155   "number of consumed facts"
   179   \<open>Scan.lift (Args.mode "no_asm")
   179   \<open>Scan.lift (Args.mode "no_asm")
   180     >> (fn true => Object_Logic.rule_format_no_asm | false => Object_Logic.rule_format)\<close>
   180     >> (fn true => Object_Logic.rule_format_no_asm | false => Object_Logic.rule_format)\<close>
   181   "result put into canonical rule format"
   181   "result put into canonical rule format"
   182 
   182 
   183 attribute_setup elim_format =
   183 attribute_setup elim_format =
   184   \<open>Scan.succeed (Thm.rule_attribute (K Tactic.make_elim))\<close>
   184   \<open>Scan.succeed (Thm.rule_attribute [] (K Tactic.make_elim))\<close>
   185   "destruct rule turned into elimination rule format"
   185   "destruct rule turned into elimination rule format"
   186 
   186 
   187 attribute_setup no_vars =
   187 attribute_setup no_vars =
   188   \<open>Scan.succeed (Thm.rule_attribute (fn context => fn th =>
   188   \<open>Scan.succeed (Thm.rule_attribute [] (fn context => fn th =>
   189     let
   189     let
   190       val ctxt = Variable.set_body false (Context.proof_of context);
   190       val ctxt = Variable.set_body false (Context.proof_of context);
   191       val ((_, [th']), _) = Variable.import true [th] ctxt;
   191       val ((_, [th']), _) = Variable.import true [th] ctxt;
   192     in th' end))\<close>
   192     in th' end))\<close>
   193   "imported schematic variables"
   193   "imported schematic variables"
   200   \<open>Scan.succeed Object_Logic.declare_rulify\<close>
   200   \<open>Scan.succeed Object_Logic.declare_rulify\<close>
   201   "declaration of rulify rule"
   201   "declaration of rulify rule"
   202 
   202 
   203 attribute_setup rotated =
   203 attribute_setup rotated =
   204   \<open>Scan.lift (Scan.optional Parse.int 1
   204   \<open>Scan.lift (Scan.optional Parse.int 1
   205     >> (fn n => Thm.rule_attribute (fn _ => rotate_prems n)))\<close>
   205     >> (fn n => Thm.rule_attribute [] (fn _ => rotate_prems n)))\<close>
   206   "rotated theorem premises"
   206   "rotated theorem premises"
   207 
   207 
   208 attribute_setup defn =
   208 attribute_setup defn =
   209   \<open>Attrib.add_del Local_Defs.defn_add Local_Defs.defn_del\<close>
   209   \<open>Attrib.add_del Local_Defs.defn_add Local_Defs.defn_del\<close>
   210   "declaration of definitional transformations"
   210   "declaration of definitional transformations"
   211 
   211 
   212 attribute_setup abs_def =
   212 attribute_setup abs_def =
   213   \<open>Scan.succeed (Thm.rule_attribute (fn context =>
   213   \<open>Scan.succeed (Thm.rule_attribute [] (fn context =>
   214     Local_Defs.meta_rewrite_rule (Context.proof_of context) #> Drule.abs_def))\<close>
   214     Local_Defs.meta_rewrite_rule (Context.proof_of context) #> Drule.abs_def))\<close>
   215   "abstract over free variables of definitional theorem"
   215   "abstract over free variables of definitional theorem"
   216 
   216 
   217 
   217 
   218 section \<open>Further content for the Pure theory\<close>
   218 section \<open>Further content for the Pure theory\<close>