872 |
872 |
873 subsection {* Simprocs for the Naturals *} |
873 subsection {* Simprocs for the Naturals *} |
874 |
874 |
875 use "Tools/nat_numeral_simprocs.ML" |
875 use "Tools/nat_numeral_simprocs.ML" |
876 |
876 |
877 declaration {* |
877 declaration {* |
878 let |
878 K (Lin_Arith.add_simps (@{thms neg_simps} @ [@{thm Suc_nat_number_of}, @{thm int_nat_number_of}]) |
879 |
879 #> Lin_Arith.add_simps (@{thms ring_distribs} @ [@{thm Let_number_of}, @{thm Let_0}, @{thm Let_1}, |
880 val less_eq_rules = @{thms ring_distribs} @ |
880 @{thm nat_0}, @{thm nat_1}, |
881 [@{thm Let_number_of}, @{thm Let_0}, @{thm Let_1}, @{thm nat_0}, @{thm nat_1}, |
881 @{thm add_nat_number_of}, @{thm diff_nat_number_of}, @{thm mult_nat_number_of}, |
882 @{thm add_nat_number_of}, @{thm diff_nat_number_of}, @{thm mult_nat_number_of}, |
882 @{thm eq_nat_number_of}, @{thm less_nat_number_of}, @{thm le_number_of_eq_not_less}, |
883 @{thm eq_nat_number_of}, @{thm less_nat_number_of}, @{thm le_number_of_eq_not_less}, |
883 @{thm le_Suc_number_of}, @{thm le_number_of_Suc}, |
884 @{thm le_Suc_number_of}, @{thm le_number_of_Suc}, |
884 @{thm less_Suc_number_of}, @{thm less_number_of_Suc}, |
885 @{thm less_Suc_number_of}, @{thm less_number_of_Suc}, |
885 @{thm Suc_eq_number_of}, @{thm eq_number_of_Suc}, |
886 @{thm Suc_eq_number_of}, @{thm eq_number_of_Suc}, |
886 @{thm mult_Suc}, @{thm mult_Suc_right}, |
887 @{thm mult_Suc}, @{thm mult_Suc_right}, |
887 @{thm add_Suc}, @{thm add_Suc_right}, |
888 @{thm add_Suc}, @{thm add_Suc_right}, |
888 @{thm eq_number_of_0}, @{thm eq_0_number_of}, @{thm less_0_number_of}, |
889 @{thm eq_number_of_0}, @{thm eq_0_number_of}, @{thm less_0_number_of}, |
889 @{thm of_int_number_of_eq}, @{thm of_nat_number_of_eq}, @{thm nat_number_of}, |
890 @{thm of_int_number_of_eq}, @{thm of_nat_number_of_eq}, @{thm nat_number_of}, @{thm if_True}, @{thm if_False}]; |
890 @{thm if_True}, @{thm if_False}]) |
891 |
891 #> Lin_Arith.add_simprocs (Nat_Numeral_Simprocs.combine_numerals :: Nat_Numeral_Simprocs.cancel_numerals)) |
892 val simprocs = Nat_Numeral_Simprocs.combine_numerals :: Nat_Numeral_Simprocs.cancel_numerals; |
|
893 |
|
894 in |
|
895 |
|
896 K (Lin_Arith.map_data (fn {add_mono_thms, mult_mono_thms, inj_thms, lessD, neqE, simpset} => |
|
897 {add_mono_thms = add_mono_thms, mult_mono_thms = mult_mono_thms, |
|
898 inj_thms = inj_thms, lessD = lessD, neqE = neqE, |
|
899 simpset = simpset addsimps (@{thms neg_simps} @ [@{thm Suc_nat_number_of}, @{thm int_nat_number_of}]) |
|
900 addsimps less_eq_rules |
|
901 addsimprocs simprocs})) |
|
902 |
|
903 end |
|
904 *} |
892 *} |
905 |
893 |
906 |
894 |
907 subsubsection{*For simplifying @{term "Suc m - K"} and @{term "K - Suc m"}*} |
895 subsubsection{*For simplifying @{term "Suc m - K"} and @{term "K - Suc m"}*} |
908 |
896 |