src/Pure/drule.ML
changeset 8365 affb2989d238
parent 8328 efbcec3eb02f
child 8406 a217b0cd304d
equal deleted inserted replaced
8364:0eb9ee70c8f8 8365:affb2989d238
    96   val tvars_of          : thm -> (indexname * sort) list
    96   val tvars_of          : thm -> (indexname * sort) list
    97   val vars_of           : thm -> (indexname * typ) list
    97   val vars_of           : thm -> (indexname * typ) list
    98   val unvarifyT         : thm -> thm
    98   val unvarifyT         : thm -> thm
    99   val unvarify          : thm -> thm
    99   val unvarify          : thm -> thm
   100   val rule_attribute    : ('a -> thm -> thm) -> 'a attribute
   100   val rule_attribute    : ('a -> thm -> thm) -> 'a attribute
       
   101   val tag_rule          : tag -> thm -> thm
       
   102   val untag_rule        : tag -> thm -> thm
   101   val tag               : tag -> 'a attribute
   103   val tag               : tag -> 'a attribute
   102   val untag             : tag -> 'a attribute
   104   val untag             : tag -> 'a attribute
   103   val tag_lemma         : 'a attribute
   105   val tag_lemma         : 'a attribute
   104   val tag_assumption    : 'a attribute
   106   val tag_assumption    : 'a attribute
   105   val tag_internal      : 'a attribute
   107   val tag_internal      : 'a attribute
   747 (* add / delete tags *)
   749 (* add / delete tags *)
   748 
   750 
   749 fun map_tags f thm =
   751 fun map_tags f thm =
   750   Thm.put_name_tags (Thm.name_of_thm thm, f (#2 (Thm.get_name_tags thm))) thm;
   752   Thm.put_name_tags (Thm.name_of_thm thm, f (#2 (Thm.get_name_tags thm))) thm;
   751 
   753 
   752 fun tag tg x = rule_attribute (K (map_tags (fn tgs => if tg mem tgs then tgs else tgs @ [tg]))) x;
   754 fun tag_rule tg = map_tags (fn tgs => if tg mem tgs then tgs else tgs @ [tg]);
   753 fun untag tg x = rule_attribute (K (map_tags (fn tgs => tgs \ tg))) x;
   755 fun untag_rule tg = map_tags (fn tgs => tgs \ tg);
       
   756 
       
   757 fun tag tg x = rule_attribute (K (tag_rule tg)) x;
       
   758 fun untag tg x = rule_attribute (K (untag_rule tg)) x;
   754 
   759 
   755 fun simple_tag name x = tag (name, []) x;
   760 fun simple_tag name x = tag (name, []) x;
   756 
   761 
   757 fun tag_lemma x = simple_tag "lemma" x;
   762 fun tag_lemma x = simple_tag "lemma" x;
   758 fun tag_assumption x = simple_tag "assumption" x;
   763 fun tag_assumption x = simple_tag "assumption" x;