src/Pure/Isar/local_defs.ML
changeset 51585 fcd5af4aac2b
parent 51584 98029ceda8ce
child 51717 9e7d1c139569
equal deleted inserted replaced
51584:98029ceda8ce 51585:fcd5af4aac2b
   167 
   167 
   168 
   168 
   169 
   169 
   170 (** defived definitions **)
   170 (** defived definitions **)
   171 
   171 
   172 (* transformation rules *)
   172 (* transformation via rewrite rules *)
   173 
   173 
   174 structure Rules = Generic_Data
   174 structure Rules = Generic_Data
   175 (
   175 (
   176   type T = thm list;
   176   type T = thm list;
   177   val empty = [];
   177   val empty = [];
   178   val extend = I;
   178   val extend = I;
   179   val merge = Thm.merge_thms;
   179   val merge = Thm.merge_thms;
   180 );
   180 );
   181 
   181 
   182 fun print_rules ctxt =
   182 fun print_rules ctxt =
   183   Pretty.writeln (Pretty.big_list "definitional transformations:"
   183   Pretty.writeln (Pretty.big_list "definitional rewrite rules:"
   184     (map (Display.pretty_thm_item ctxt) (Rules.get (Context.Proof ctxt))));
   184     (map (Display.pretty_thm_item ctxt) (Rules.get (Context.Proof ctxt))));
   185 
   185 
   186 val defn_add = Thm.declaration_attribute (Rules.map o Thm.add_thm);
   186 val defn_add = Thm.declaration_attribute (Rules.map o Thm.add_thm);
   187 val defn_del = Thm.declaration_attribute (Rules.map o Thm.del_thm);
   187 val defn_del = Thm.declaration_attribute (Rules.map o Thm.del_thm);
   188 
   188