17 @{ML simple_arith_tac} performs meta-to-object-logic conversion, full |
17 @{ML simple_arith_tac} performs meta-to-object-logic conversion, full |
18 splitting of operators, and NNF normalization of the goal. The @{text arith} |
18 splitting of operators, and NNF normalization of the goal. The @{text arith} |
19 method combines them both, and tries other methods (e.g.~@{text presburger}) |
19 method combines them both, and tries other methods (e.g.~@{text presburger}) |
20 as well. This is the one that you should use in your proofs! |
20 as well. This is the one that you should use in your proofs! |
21 |
21 |
22 An @{text arith}-based simproc is available as well |
22 An @{text arith}-based simproc is available as well (see @{ML |
23 (see @{ML Fast_Arith.lin_arith_simproc}), |
23 LinArith.lin_arith_simproc}), which---for performance |
24 which---for performance reasons---however |
24 reasons---however does even less splitting than @{ML fast_arith_tac} |
25 does even less splitting than @{ML fast_arith_tac} at the moment (namely |
25 at the moment (namely inequalities only). (On the other hand, it |
26 inequalities only). (On the other hand, it does take apart conjunctions, |
26 does take apart conjunctions, which @{ML fast_arith_tac} currently |
27 which @{ML fast_arith_tac} currently does not do.) |
27 does not do.) |
28 *} |
28 *} |
29 |
29 |
30 (* |
30 (* |
31 ML {* set trace_arith; *} |
31 ML {* set trace_arith; *} |
32 *) |
32 *) |
120 |
120 |
121 lemma "(i::int) mod 1 = 0" |
121 lemma "(i::int) mod 1 = 0" |
122 (* FIXME: need to replace 1 by its numeral representation *) |
122 (* FIXME: need to replace 1 by its numeral representation *) |
123 apply (subst numeral_1_eq_1 [symmetric]) |
123 apply (subst numeral_1_eq_1 [symmetric]) |
124 (* FIXME: arith does not know about iszero *) |
124 (* FIXME: arith does not know about iszero *) |
125 apply (tactic {* LA_Data_Ref.pre_tac @{context} 1 *}) |
125 apply (tactic {* lin_arith_pre_tac @{context} 1 *}) |
126 oops |
126 oops |
127 |
127 |
128 lemma "(i::int) mod 42 <= 41" |
128 lemma "(i::int) mod 42 <= 41" |
129 (* FIXME: arith does not know about iszero *) |
129 (* FIXME: arith does not know about iszero *) |
130 apply (tactic {* LA_Data_Ref.pre_tac @{context} 1 *}) |
130 apply (tactic {* lin_arith_pre_tac @{context} 1 *}) |
131 oops |
131 oops |
132 |
132 |
133 |
133 |
134 subsection {* Meta-Logic *} |
134 subsection {* Meta-Logic *} |
135 |
135 |