added map_specs/facts operators (from locale.ML);
authorwenzelm
Thu, 18 Aug 2005 11:17:40 +0200
changeset 17105 1b07a176a880
parent 17104 89d5bbb2f746
child 17106 2bd6c20cdda1
added map_specs/facts operators (from locale.ML);
src/Pure/Isar/attrib.ML
--- a/src/Pure/Isar/attrib.ML	Thu Aug 18 11:17:39 2005 +0200
+++ b/src/Pure/Isar/attrib.ML	Thu Aug 18 11:17:40 2005 +0200
@@ -28,6 +28,11 @@
   val context_attribute: ProofContext.context -> Args.src -> ProofContext.context attribute
   val undef_global_attribute: theory attribute
   val undef_local_attribute: ProofContext.context attribute
+  val map_specs: ('a -> 'b attribute) ->
+    (('c * 'a list) * 'd) list -> (('c * 'b attribute list) * 'd) list
+  val map_facts: ('a -> 'b attribute) ->
+    (('c * 'a list) * ('d * 'a list) list) list ->
+    (('c * 'b attribute list) * ('d * 'b attribute list) list) list
   val crude_closure: ProofContext.context -> src -> src
   val add_attributes: (bstring * ((src -> theory attribute) *
       (src -> ProofContext.context attribute)) * string) list -> theory -> theory
@@ -121,6 +126,12 @@
   fn _ => error "attribute undefined in proof context";
 
 
+(* attributed declarations *)
+
+fun map_specs f = map (apfst (apsnd (map f)));
+fun map_facts f = map (apfst (apsnd (map f)) o apsnd (map (apsnd (map f))));
+
+
 (* crude_closure *)
 
 (*Produce closure without knowing facts in advance! The following