src/Pure/Isar/generic_target.ML
changeset 57065 2869310dae2a
parent 57057 e54713f22a88
child 57068 474403e50e05
--- a/src/Pure/Isar/generic_target.ML	Thu May 22 15:49:36 2014 +0200
+++ b/src/Pure/Isar/generic_target.ML	Thu May 22 16:59:49 2014 +0200
@@ -25,10 +25,10 @@
     string * bool -> (binding * mixfix) * term -> local_theory -> (term * term) * local_theory
   val background_declaration: declaration -> local_theory -> local_theory
   val locale_declaration: string -> bool -> declaration -> local_theory -> local_theory
-  val standard_declaration: (int -> int -> bool) -> declaration -> local_theory -> local_theory
+  val standard_declaration: (int * int -> bool) -> declaration -> local_theory -> local_theory
   val generic_const: bool -> Syntax.mode -> (binding * mixfix) * term ->
     Context.generic -> Context.generic
-  val const_declaration: (int -> int -> bool) -> Syntax.mode -> (binding * mixfix) * term ->
+  val const_declaration: (int * int -> bool) -> Syntax.mode -> (binding * mixfix) * term ->
     local_theory -> local_theory
   val background_foundation: ((binding * typ) * mixfix) * (binding * term) ->
     term list * term list -> local_theory -> (term * thm) * local_theory
@@ -231,7 +231,7 @@
 
 fun standard_declaration pred decl lthy =
   Local_Theory.map_contexts (fn level => fn ctxt =>
-    if pred (Local_Theory.level lthy) level
+    if pred (Local_Theory.level lthy, level)
     then Context.proof_map (Local_Theory.standard_form lthy ctxt decl) ctxt
     else ctxt) lthy;
 
@@ -308,8 +308,7 @@
 fun theory_foundation (((b, U), mx), (b_def, rhs)) (type_params, term_params) =
   background_foundation (((b, U), mx), (b_def, rhs)) (type_params, term_params)
   #-> (fn (lhs, def) =>
-        const_declaration (fn this_level => fn level => level <> this_level)
-          Syntax.mode_default ((b, mx), lhs)
+        const_declaration (op <>) Syntax.mode_default ((b, mx), lhs)
     #> pair (lhs, def));
 
 fun theory_notes kind global_facts local_facts =
@@ -326,10 +325,10 @@
       (fn (lhs, _) =>  (* FIXME type_params!? *)
         Sign.notation true prmode [(lhs, check_mixfix_global (b, null xs) mx)] #> pair lhs))
   #-> (fn lhs =>
-        const_declaration (fn this_level => fn level => level <> this_level) prmode
+        const_declaration (op <>) prmode
           ((b, if null xs then NoSyn else mx), Term.list_comb (Logic.unvarify_global lhs, xs)));
 
 fun theory_declaration decl =
-  background_declaration decl #> standard_declaration ((K o K) true) decl;
+  background_declaration decl #> standard_declaration (K true) decl;
 
 end;