equal
deleted
inserted
replaced
2 |
2 |
3 header {* Combination and Cancellation Simprocs for Numeral Expressions *} |
3 header {* Combination and Cancellation Simprocs for Numeral Expressions *} |
4 |
4 |
5 theory Numeral_Simprocs |
5 theory Numeral_Simprocs |
6 imports Divides |
6 imports Divides |
7 uses |
|
8 "~~/src/Provers/Arith/assoc_fold.ML" |
|
9 "~~/src/Provers/Arith/cancel_numerals.ML" |
|
10 "~~/src/Provers/Arith/combine_numerals.ML" |
|
11 "~~/src/Provers/Arith/cancel_numeral_factor.ML" |
|
12 "~~/src/Provers/Arith/extract_common_term.ML" |
|
13 ("Tools/numeral_simprocs.ML") |
|
14 ("Tools/nat_numeral_simprocs.ML") |
|
15 begin |
7 begin |
|
8 |
|
9 ML_file "~~/src/Provers/Arith/assoc_fold.ML" |
|
10 ML_file "~~/src/Provers/Arith/cancel_numerals.ML" |
|
11 ML_file "~~/src/Provers/Arith/combine_numerals.ML" |
|
12 ML_file "~~/src/Provers/Arith/cancel_numeral_factor.ML" |
|
13 ML_file "~~/src/Provers/Arith/extract_common_term.ML" |
16 |
14 |
17 lemmas semiring_norm = |
15 lemmas semiring_norm = |
18 Let_def arith_simps nat_arith rel_simps |
16 Let_def arith_simps nat_arith rel_simps |
19 if_False if_True |
17 if_False if_True |
20 add_0 add_Suc add_numeral_left |
18 add_0 add_Suc add_numeral_left |
98 |
96 |
99 lemma nat_mult_div_cancel_disj[simp]: |
97 lemma nat_mult_div_cancel_disj[simp]: |
100 "(k*m) div (k*n) = (if k = (0::nat) then 0 else m div n)" |
98 "(k*m) div (k*n) = (if k = (0::nat) then 0 else m div n)" |
101 by (simp add: nat_mult_div_cancel1) |
99 by (simp add: nat_mult_div_cancel1) |
102 |
100 |
103 use "Tools/numeral_simprocs.ML" |
101 ML_file "Tools/numeral_simprocs.ML" |
104 |
102 |
105 simproc_setup semiring_assoc_fold |
103 simproc_setup semiring_assoc_fold |
106 ("(a::'a::comm_semiring_1_cancel) * b") = |
104 ("(a::'a::comm_semiring_1_cancel) * b") = |
107 {* fn phi => Numeral_Simprocs.assoc_fold *} |
105 {* fn phi => Numeral_Simprocs.assoc_fold *} |
108 |
106 |
208 simproc_setup divide_cancel_factor |
206 simproc_setup divide_cancel_factor |
209 ("((l::'a::field_inverse_zero) * m) / n" |
207 ("((l::'a::field_inverse_zero) * m) / n" |
210 |"(l::'a::field_inverse_zero) / (m * n)") = |
208 |"(l::'a::field_inverse_zero) / (m * n)") = |
211 {* fn phi => Numeral_Simprocs.divide_cancel_factor *} |
209 {* fn phi => Numeral_Simprocs.divide_cancel_factor *} |
212 |
210 |
213 use "Tools/nat_numeral_simprocs.ML" |
211 ML_file "Tools/nat_numeral_simprocs.ML" |
214 |
212 |
215 simproc_setup nat_combine_numerals |
213 simproc_setup nat_combine_numerals |
216 ("(i::nat) + j" | "Suc (i + j)") = |
214 ("(i::nat) + j" | "Suc (i + j)") = |
217 {* fn phi => Nat_Numeral_Simprocs.combine_numerals *} |
215 {* fn phi => Nat_Numeral_Simprocs.combine_numerals *} |
218 |
216 |