# HG changeset patch # User nipkow # Date 1187112207 -7200 # Node ID bdb48fd8fbdd9ed61f0f44b9f23eb7e18758fcd0 # Parent 4d5917cc60c4da92a9b715ef3985ede82907999d extended linear arith capabilities with code by Amine diff -r 4d5917cc60c4 -r bdb48fd8fbdd src/HOL/int_arith1.ML --- a/src/HOL/int_arith1.ML Tue Aug 14 15:09:33 2007 +0200 +++ b/src/HOL/int_arith1.ML Tue Aug 14 19:23:27 2007 +0200 @@ -570,7 +570,66 @@ (* Update parameters of arithmetic prover *) local -(* reduce contradictory <= to False *) +(* reduce contradictory =/ if s = @{const_name "HOL.one"} then not (t = @{typ int}) + else s mem_string allowed_consts + | a$b => check a andalso check b + | _ => false; + +val conv = + Simplifier.rewrite + (HOL_basic_ss addsimps + ((map (fn th => th RS sym) [@{thm of_int_add}, @{thm of_int_mult}, + @{thm of_int_diff}, @{thm of_int_minus}])@ + [@{thm of_int_less_iff}, @{thm of_int_le_iff}, @{thm of_int_eq_iff}]) + addsimprocs [zero_to_of_int_zero_simproc,one_to_of_int_one_simproc]); + +fun sproc phi ss ct = if check (term_of ct) then SOME (conv ct) else NONE +val lhss' = + [@{cpat "(?x::?'a::ring_char_0) = (?y::?'a)"}, + @{cpat "(?x::?'a::ordered_idom) < (?y::?'a)"}, + @{cpat "(?x::?'a::ordered_idom) <= (?y::?'a)"}] +in +val zero_one_idom_simproc = + make_simproc {lhss = lhss' , name = "zero_one_idom_simproc", + proc = sproc, identifier = []} +end; + val add_rules = simp_thms @ arith_simps @ rel_simps @ arith_special @ [@{thm neg_le_iff_le}, @{thm numeral_0_eq_0}, @{thm numeral_1_eq_1}, @@ -584,7 +643,7 @@ val nat_inj_thms = [@{thm zle_int} RS iffD2, @{thm int_int_eq} RS iffD2] -val Int_Numeral_Base_Simprocs = assoc_fold_simproc +val Int_Numeral_Base_Simprocs = assoc_fold_simproc :: zero_one_idom_simproc :: Int_Numeral_Simprocs.combine_numerals :: Int_Numeral_Simprocs.cancel_numerals;