simplified abbrev: single argument;
authorwenzelm
Sat, 09 Dec 2006 18:05:50 +0100
changeset 21730 88d8b4052792
parent 21729 7b3ccdae9212
child 21731 360fa2caaf2f
simplified abbrev: single argument;
src/Pure/Isar/term_syntax.ML
--- a/src/Pure/Isar/term_syntax.ML	Sat Dec 09 18:05:49 2006 +0100
+++ b/src/Pure/Isar/term_syntax.ML	Sat Dec 09 18:05:50 2006 +0100
@@ -8,7 +8,7 @@
 signature TERM_SYNTAX =
 sig
   val notation: Syntax.mode -> (term * mixfix) list -> local_theory -> local_theory
-  val abbrevs: Syntax.mode -> ((bstring * mixfix) * term) list -> local_theory -> local_theory
+  val abbrev: Syntax.mode -> (bstring * mixfix) * term -> local_theory -> local_theory
 end;
 
 structure TermSyntax: TERM_SYNTAX =
@@ -45,16 +45,16 @@
     else I
   end;
 
-fun abbrevs prmode raw_args lthy =
+fun abbrev prmode raw_arg lthy =
   let
     val is_local = is_none o Sign.const_constraint (ProofContext.theory_of lthy);
     val local_term = Term.exists_subterm (fn Const (c, _) => is_local c | _ => false);
     val input_only = (#1 Syntax.input_mode, #2 prmode);
-    val expand = ProofContext.cert_term (ProofContext.expand_abbrevs true lthy);
-    val args = raw_args |> map (morph_abbrev (LocalTheory.target_morphism lthy) #>
+    val expand = ProofContext.cert_term (ProofContext.set_expand_abbrevs true lthy);
+    val arg = raw_arg |> (morph_abbrev (LocalTheory.target_morphism lthy) #>
       (fn (lhs, rhs) =>  (*avoid dynamic references to local names*)
         if local_term rhs then (input_only, (lhs, expand rhs))
         else (prmode, (lhs, rhs))));
-  in LocalTheory.term_syntax (fn phi => fold (fn arg => target_abbrev arg phi) args) lthy end;
+  in LocalTheory.term_syntax (fn phi => target_abbrev arg phi) lthy end;
 
 end;