src/HOL/Numeral_Simprocs.thy
changeset 45436 62bc9474d04b
parent 45435 d660c4b9daa6
child 45462 aba629d6cee5
     1.1 --- a/src/HOL/Numeral_Simprocs.thy	Wed Nov 09 10:58:08 2011 +0100
     1.2 +++ b/src/HOL/Numeral_Simprocs.thy	Wed Nov 09 11:44:42 2011 +0100
     1.3 @@ -202,6 +202,30 @@
     1.4  
     1.5  use "Tools/nat_numeral_simprocs.ML"
     1.6  
     1.7 +simproc_setup nateq_cancel_numerals
     1.8 +  ("(l::nat) + m = n" | "(l::nat) = m + n" |
     1.9 +   "(l::nat) * m = n" | "(l::nat) = m * n" |
    1.10 +   "Suc m = n" | "m = Suc n") =
    1.11 +  {* fn phi => Nat_Numeral_Simprocs.eq_cancel_numerals *}
    1.12 +
    1.13 +simproc_setup natless_cancel_numerals
    1.14 +  ("(l::nat) + m < n" | "(l::nat) < m + n" |
    1.15 +   "(l::nat) * m < n" | "(l::nat) < m * n" |
    1.16 +   "Suc m < n" | "m < Suc n") =
    1.17 +  {* fn phi => Nat_Numeral_Simprocs.less_cancel_numerals *}
    1.18 +
    1.19 +simproc_setup natle_cancel_numerals
    1.20 +  ("(l::nat) + m \<le> n" | "(l::nat) \<le> m + n" |
    1.21 +   "(l::nat) * m \<le> n" | "(l::nat) \<le> m * n" |
    1.22 +   "Suc m \<le> n" | "m \<le> Suc n") =
    1.23 +  {* fn phi => Nat_Numeral_Simprocs.le_cancel_numerals *}
    1.24 +
    1.25 +simproc_setup natdiff_cancel_numerals
    1.26 +  ("((l::nat) + m) - n" | "(l::nat) - (m + n)" |
    1.27 +   "(l::nat) * m - n" | "(l::nat) - m * n" |
    1.28 +   "Suc m - n" | "m - Suc n") =
    1.29 +  {* fn phi => Nat_Numeral_Simprocs.diff_cancel_numerals *}
    1.30 +
    1.31  declaration {* 
    1.32    K (Lin_Arith.add_simps (@{thms neg_simps} @ [@{thm Suc_nat_number_of}, @{thm int_nat_number_of}])
    1.33    #> Lin_Arith.add_simps (@{thms ring_distribs} @ [@{thm Let_number_of}, @{thm Let_0}, @{thm Let_1},
    1.34 @@ -222,7 +246,12 @@
    1.35         @{simproc inteq_cancel_numerals},
    1.36         @{simproc intless_cancel_numerals},
    1.37         @{simproc intle_cancel_numerals}]
    1.38 -  #> Lin_Arith.add_simprocs (Nat_Numeral_Simprocs.combine_numerals :: Nat_Numeral_Simprocs.cancel_numerals))
    1.39 +  #> Lin_Arith.add_simprocs
    1.40 +      [Nat_Numeral_Simprocs.combine_numerals,
    1.41 +       @{simproc nateq_cancel_numerals},
    1.42 +       @{simproc natless_cancel_numerals},
    1.43 +       @{simproc natle_cancel_numerals},
    1.44 +       @{simproc natdiff_cancel_numerals}])
    1.45  *}
    1.46  
    1.47  end