src/Pure/attribute.ML
changeset 5835 5b79fbf1a65f
parent 5559 95e8692fda23
child 5872 df19e1de5c8a
equal deleted inserted replaced
5834:c6fea8488ce7 5835:5b79fbf1a65f
    15 signature ATTRIBUTE =
    15 signature ATTRIBUTE =
    16 sig
    16 sig
    17   include BASIC_ATTRIBUTE
    17   include BASIC_ATTRIBUTE
    18   val thm_of: tthm -> thm
    18   val thm_of: tthm -> thm
    19   val tthm_of: thm -> tthm
    19   val tthm_of: thm -> tthm
       
    20   val lift_modifier: ('a * thm list -> 'b) -> 'a * tthm list -> 'b
       
    21   val rule: ('b -> 'a) -> ('a -> thm -> thm) -> 'b attribute
    20   val none: 'a -> 'a * 'b attribute list
    22   val none: 'a -> 'a * 'b attribute list
    21   val no_attrs: 'a * 'b -> ('a * ('b * tag list)) * 'c attribute list
    23   val no_attrs: 'a * 'b -> ('a * ('b * tag list)) * 'c attribute list
    22   val no_attrss: 'a * 'b list -> ('a * ('b * tag list) list) * 'c attribute list
    24   val no_attrss: 'a * 'b list -> ('a * ('b * tag list) list) * 'c attribute list
    23   val fail: string -> string -> 'a
    25   val fail: string -> string -> 'a
    24   val apply: ('a * tthm) * 'a attribute list -> ('a * tthm)
    26   val apply: ('a * tthm) * 'a attribute list -> ('a * tthm)
    44 type tthm = thm * tag list;
    46 type tthm = thm * tag list;
    45 type 'a attribute = 'a * tthm -> 'a * tthm;
    47 type 'a attribute = 'a * tthm -> 'a * tthm;
    46 
    48 
    47 fun thm_of (thm, _) = thm;
    49 fun thm_of (thm, _) = thm;
    48 fun tthm_of thm = (thm, []);
    50 fun tthm_of thm = (thm, []);
       
    51 
       
    52 fun lift_modifier f (x, tthms) = f (x, map thm_of tthms);
       
    53 
       
    54 fun rule get_data f (x, (thm, tags)) = (x, (f (get_data x) thm, tags));
    49 
    55 
    50 fun none x = (x, []);
    56 fun none x = (x, []);
    51 fun no_attrs (x, y) = ((x, (y, [])), []);
    57 fun no_attrs (x, y) = ((x, (y, [])), []);
    52 fun no_attrss (x, ys) = ((x, map (rpair []) ys), []);
    58 fun no_attrss (x, ys) = ((x, map (rpair []) ys), []);
    53 
    59