methods: added simp_flags argument, added "depth_limit" flag;
authorwenzelm
Mon, 04 Jul 2005 20:13:39 +0200
changeset 16684 7b58002668c0
parent 16683 f1ea17a4f222
child 16685 4ffc943c9c75
methods: added simp_flags argument, added "depth_limit" flag;
src/Pure/simplifier.ML
--- a/src/Pure/simplifier.ML	Mon Jul 04 17:09:15 2005 +0200
+++ b/src/Pure/simplifier.ML	Mon Jul 04 20:13:39 2005 +0200
@@ -475,6 +475,11 @@
   Args.parens (Args.$$$ asm_lrN) >> K asm_lr_simp_tac ||
   Scan.succeed asm_full_simp_tac);
 
+val simp_flags = Scan.repeat
+  (Args.parens (Args.$$$ "depth_limit" -- Args.colon |-- Args.nat)
+    >> setmp MetaSimplifier.simp_depth_limit)
+  >> curry (Library.foldl op o) I;
+
 val cong_modifiers =
  [Args.$$$ congN -- Args.colon >> K ((I, cong_add_local):Method.modifier),
   Args.$$$ congN -- Args.add -- Args.colon >> K (I, cong_add_local),
@@ -494,16 +499,16 @@
    @ cong_modifiers;
 
 fun simp_args more_mods =
-  Method.sectioned_args (Args.bang_facts -- Scan.lift simp_options) (more_mods @ simp_modifiers');
+  Method.sectioned_args (Args.bang_facts -- Scan.lift simp_options -- Scan.lift simp_flags)
+    (more_mods @ simp_modifiers');
 
-
-fun simp_method (prems, tac) ctxt = Method.METHOD (fn facts =>
+fun simp_method ((prems, tac), FLAGS) ctxt = Method.METHOD (fn facts =>
   ALLGOALS (Method.insert_tac (prems @ facts)) THEN
-    (CHANGED_PROP o ALLGOALS o tac) (local_simpset_of ctxt));
+    (FLAGS o CHANGED_PROP o ALLGOALS o tac) (local_simpset_of ctxt));
 
-fun simp_method' (prems, tac) ctxt = Method.METHOD (fn facts =>
+fun simp_method' ((prems, tac), FLAGS) ctxt = Method.METHOD (fn facts =>
   HEADGOAL (Method.insert_tac (prems @ facts) THEN'
-      (CHANGED_PROP oo tac) (local_simpset_of ctxt)));
+      ((FLAGS o CHANGED_PROP) oo tac) (local_simpset_of ctxt)));
 
 
 (* setup methods *)