src/Provers/Arith/fast_lin_arith.ML
changeset 38762 996afaa9254a
parent 38052 04a8de29e8f7
child 38763 283f1f9969ba
     1.1 --- a/src/Provers/Arith/fast_lin_arith.ML	Thu Aug 26 17:01:12 2010 +0200
     1.2 +++ b/src/Provers/Arith/fast_lin_arith.ML	Thu Aug 26 17:37:26 2010 +0200
     1.3 @@ -95,6 +95,11 @@
     1.4                       lessD: thm list, neqE: thm list, simpset: Simplifier.simpset,
     1.5                       number_of : serial * (theory -> typ -> int -> cterm)})
     1.6                  -> Context.generic -> Context.generic
     1.7 +  val add_inj_thms: thm list -> Context.generic -> Context.generic
     1.8 +  val add_lessD: thm -> Context.generic -> Context.generic
     1.9 +  val add_simps: thm list -> Context.generic -> Context.generic
    1.10 +  val add_simprocs: simproc list -> Context.generic -> Context.generic
    1.11 +  val set_number_of: (theory -> typ -> int -> cterm) -> Context.generic -> Context.generic
    1.12    val trace: bool Unsynchronized.ref
    1.13  end;
    1.14  
    1.15 @@ -135,13 +140,35 @@
    1.16       lessD = Thm.merge_thms (lessD1, lessD2),
    1.17       neqE = Thm.merge_thms (neqE1, neqE2),
    1.18       simpset = Simplifier.merge_ss (simpset1, simpset2),
    1.19 -     (* FIXME depends on accidental load order !?! *)
    1.20 +     (* FIXME depends on accidental load order !?! *)  (* FIXME *)
    1.21       number_of = if s1 > s2 then number_of1 else number_of2};
    1.22  );
    1.23  
    1.24  val map_data = Data.map;
    1.25  val get_data = Data.get o Context.Proof;
    1.26  
    1.27 +fun map_inj_thms f {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset, number_of} =
    1.28 +  {add_mono_thms = add_mono_thms, mult_mono_thms = mult_mono_thms, inj_thms = f inj_thms,
    1.29 +    lessD = lessD, neqE = neqE, simpset = simpset, number_of = number_of};
    1.30 +
    1.31 +fun map_lessD f {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset, number_of} =
    1.32 +  {add_mono_thms = add_mono_thms, mult_mono_thms = mult_mono_thms, inj_thms = inj_thms,
    1.33 +    lessD = f lessD, neqE = neqE, simpset = simpset, number_of = number_of};
    1.34 +
    1.35 +fun map_simpset f {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset, number_of} =
    1.36 +  {add_mono_thms = add_mono_thms, mult_mono_thms = mult_mono_thms, inj_thms = inj_thms,
    1.37 +    lessD = lessD, neqE = neqE, simpset = f simpset, number_of = number_of};
    1.38 +
    1.39 +fun map_number_of f {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset, number_of} =
    1.40 +  {add_mono_thms = add_mono_thms, mult_mono_thms = mult_mono_thms, inj_thms = inj_thms,
    1.41 +    lessD = lessD, neqE = neqE, simpset = simpset, number_of = f number_of};
    1.42 +
    1.43 +fun add_inj_thms thms = map_data (map_inj_thms (append thms));
    1.44 +fun add_lessD thm = map_data (map_lessD (fn thms => thms @ [thm]));
    1.45 +fun add_simps thms = map_data (map_simpset (fn simpset => simpset addsimps thms));
    1.46 +fun add_simprocs procs = map_data (map_simpset (fn simpset => simpset addsimprocs procs));
    1.47 +
    1.48 +fun set_number_of f = map_data (map_number_of (K (serial (), f)));
    1.49  
    1.50  
    1.51  (*** A fast decision procedure ***)