eliminated unused arith "verbose" flag -- tools that need options can use the context;
authorwenzelm
Mon, 09 Mar 2015 11:32:32 +0100
changeset 59657 2441a80fb6c1
parent 59656 ddc5411c1cb9
child 59658 0cc388370041
child 59660 49e498cedd02
eliminated unused arith "verbose" flag -- tools that need options can use the context;
src/HOL/Tools/Qelim/cooper.ML
src/HOL/Tools/arith_data.ML
src/HOL/Tools/lin_arith.ML
src/HOL/Word/Word.thy
--- a/src/HOL/Tools/Qelim/cooper.ML	Mon Mar 09 11:21:00 2015 +0100
+++ b/src/HOL/Tools/Qelim/cooper.ML	Mon Mar 09 11:32:32 2015 +0100
@@ -907,7 +907,7 @@
     (Attrib.setup @{binding presburger}
       ((Scan.lift (Args.$$$ "del") |-- optional (keyword constsN |-- terms)) >> del ||
         optional (keyword constsN |-- terms) >> add) "data for Cooper's algorithm"
-    #> Arith_Data.add_tactic "Presburger arithmetic" (K (tac true [] [])));
+    #> Arith_Data.add_tactic "Presburger arithmetic" (tac true [] []));
 
 end;
 
--- a/src/HOL/Tools/arith_data.ML	Mon Mar 09 11:21:00 2015 +0100
+++ b/src/HOL/Tools/arith_data.ML	Mon Mar 09 11:32:32 2015 +0100
@@ -7,8 +7,7 @@
 signature ARITH_DATA =
 sig
   val arith_tac: Proof.context -> int -> tactic
-  val verbose_arith_tac: Proof.context -> int -> tactic
-  val add_tactic: string -> (bool -> Proof.context -> int -> tactic) -> theory -> theory
+  val add_tactic: string -> (Proof.context -> int -> tactic) -> theory -> theory
 
   val mk_number: typ -> int -> term
   val mk_sum: typ -> term list -> term
@@ -29,7 +28,7 @@
 
 structure Arith_Tactics = Theory_Data
 (
-  type T = (serial * (string * (bool -> Proof.context -> int -> tactic))) list;
+  type T = (serial * (string * (Proof.context -> int -> tactic))) list;
   val empty = [];
   val extend = I;
   fun merge data : T = AList.merge (op =) (K true) data;
@@ -37,15 +36,12 @@
 
 fun add_tactic name tac = Arith_Tactics.map (cons (serial (), (name, tac)));
 
-fun gen_arith_tac verbose ctxt =
+fun arith_tac ctxt =
   let
     val tactics = Arith_Tactics.get (Proof_Context.theory_of ctxt);
-    fun invoke (_, (_, tac)) k st = tac verbose ctxt k st;
+    fun invoke (_, (_, tac)) k st = tac ctxt k st;
   in FIRST' (map invoke (rev tactics)) end;
 
-val arith_tac = gen_arith_tac false;
-val verbose_arith_tac = gen_arith_tac true;
-
 val _ =
   Theory.setup
     (Method.setup @{binding arith}
@@ -53,7 +49,7 @@
         METHOD (fn facts =>
           HEADGOAL
           (Method.insert_tac (rev (Named_Theorems.get ctxt @{named_theorems arith}) @ facts)
-            THEN' verbose_arith_tac ctxt))))
+            THEN' arith_tac ctxt))))
       "various arithmetic decision procedures");
 
 
--- a/src/HOL/Tools/lin_arith.ML	Mon Mar 09 11:21:00 2015 +0100
+++ b/src/HOL/Tools/lin_arith.ML	Mon Mar 09 11:32:32 2015 +0100
@@ -892,7 +892,7 @@
       METHOD (fn facts =>
         HEADGOAL (Method.insert_tac (rev (Named_Theorems.get ctxt @{named_theorems arith}) @ facts)
           THEN' tac ctxt)))) "linear arithmetic" #>
-  Arith_Data.add_tactic "linear arithmetic" (K tac);
+  Arith_Data.add_tactic "linear arithmetic" tac;
 
 val setup =
   init_arith_data
--- a/src/HOL/Word/Word.thy	Mon Mar 09 11:21:00 2015 +0100
+++ b/src/HOL/Word/Word.thy	Mon Mar 09 11:32:32 2015 +0100
@@ -1551,7 +1551,7 @@
 fun uint_arith_tacs ctxt = 
   let
     fun arith_tac' n t =
-      Arith_Data.verbose_arith_tac ctxt n t
+      Arith_Data.arith_tac ctxt n t
         handle Cooper.COOPER _ => Seq.empty;
   in 
     [ clarify_tac ctxt 1,
@@ -2053,7 +2053,7 @@
 fun unat_arith_tacs ctxt =   
   let
     fun arith_tac' n t =
-      Arith_Data.verbose_arith_tac ctxt n t
+      Arith_Data.arith_tac ctxt n t
         handle Cooper.COOPER _ => Seq.empty;
   in 
     [ clarify_tac ctxt 1,