# HG changeset patch # User haftmann # Date 1660888149 0 # Node ID fcd118d9242f8a1343aa2dddeeed50af68c82c7a # Parent dc758531077b3f9111c01d4f6514b6d0998bb5a2 consolidated attribute name diff -r dc758531077b -r fcd118d9242f NEWS --- a/NEWS Fri Aug 19 05:49:07 2022 +0000 +++ b/NEWS Fri Aug 19 05:49:09 2022 +0000 @@ -34,6 +34,9 @@ *** HOL *** +* Renamed attribute "arith_split" to "linarith_split". Minor +INCOMPATIBILITY. + * Theory Char_ord: streamlined logical specifications. Minor INCOMPATIBILITY. diff -r dc758531077b -r fcd118d9242f src/Doc/Isar_Ref/HOL_Specific.thy --- a/src/Doc/Isar_Ref/HOL_Specific.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/Doc/Isar_Ref/HOL_Specific.thy Fri Aug 19 05:49:09 2022 +0000 @@ -2003,7 +2003,7 @@ \begin{matharray}{rcl} @{method_def (HOL) arith} & : & \method\ \\ @{attribute_def (HOL) arith} & : & \attribute\ \\ - @{attribute_def (HOL) arith_split} & : & \attribute\ \\ + @{attribute_def (HOL) linarith_split} & : & \attribute\ \\ \end{matharray} \<^descr> @{method (HOL) arith} decides linear arithmetic problems (on types \nat\, @@ -2013,7 +2013,7 @@ \<^descr> @{attribute (HOL) arith} declares facts that are supplied to the arithmetic provers implicitly. - \<^descr> @{attribute (HOL) arith_split} attribute declares case split rules to be + \<^descr> @{attribute (HOL) linarith_split} attribute declares case split rules to be expanded before @{method (HOL) arith} is invoked. diff -r dc758531077b -r fcd118d9242f src/HOL/Archimedean_Field.thy --- a/src/HOL/Archimedean_Field.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/Archimedean_Field.thy Fri Aug 19 05:49:09 2022 +0000 @@ -243,7 +243,7 @@ lemma floor_le_iff: "\x\ \ z \ x < of_int z + 1" by (simp add: not_less [symmetric] less_floor_iff) -lemma floor_split[arith_split]: "P \t\ \ (\i. of_int i \ t \ t < of_int i + 1 \ P i)" +lemma floor_split[linarith_split]: "P \t\ \ (\i. of_int i \ t \ t < of_int i + 1 \ P i)" by (metis floor_correct floor_unique less_floor_iff not_le order_refl) lemma floor_mono: @@ -618,7 +618,7 @@ lemma ceiling_diff_one [simp]: "\x - 1\ = \x\ - 1" using ceiling_diff_of_int [of x 1] by simp -lemma ceiling_split[arith_split]: "P \t\ \ (\i. of_int i - 1 < t \ t \ of_int i \ P i)" +lemma ceiling_split[linarith_split]: "P \t\ \ (\i. of_int i - 1 < t \ t \ of_int i \ P i)" by (auto simp add: ceiling_unique ceiling_correct) lemma ceiling_diff_floor_le_1: "\x\ - \x\ \ 1" diff -r dc758531077b -r fcd118d9242f src/HOL/Divides.thy --- a/src/HOL/Divides.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/Divides.thy Fri Aug 19 05:49:09 2022 +0000 @@ -62,8 +62,8 @@ text \Enable (lin)arith to deal with \<^const>\divide\ and \<^const>\modulo\ when these are applied to some constant that is of the form \<^term>\numeral k\:\ -declare split_zdiv [of _ _ \numeral k\, arith_split] for k -declare split_zmod [of _ _ \numeral k\, arith_split] for k +declare split_zdiv [of _ _ \numeral k\, linarith_split] for k +declare split_zmod [of _ _ \numeral k\, linarith_split] for k lemma half_nonnegative_int_iff [simp]: \k div 2 \ 0 \ k \ 0\ for k :: int diff -r dc758531077b -r fcd118d9242f src/HOL/Fields.thy --- a/src/HOL/Fields.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/Fields.thy Fri Aug 19 05:49:09 2022 +0000 @@ -85,7 +85,7 @@ \<^text>\fast_nat_arith_simproc\ anyway. However, it seems cheaper to activate the solver all the time rather than add the additional check.\ -lemmas [arith_split] = nat_diff_split split_min split_max +lemmas [linarith_split] = nat_diff_split split_min split_max text\Lemmas \divide_simps\ move division to the outside and eliminates them on (in)equalities.\ diff -r dc758531077b -r fcd118d9242f src/HOL/Int.thy --- a/src/HOL/Int.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/Int.thy Fri Aug 19 05:49:09 2022 +0000 @@ -652,7 +652,7 @@ "nat (of_bool P) = of_bool P" by auto -lemma split_nat [arith_split]: "P (nat i) \ ((\n. i = int n \ P n) \ (i < 0 \ P 0))" +lemma split_nat [linarith_split]: "P (nat i) \ ((\n. i = int n \ P n) \ (i < 0 \ P 0))" (is "?P = (?L \ ?R)") for i :: int proof (cases "i < 0") @@ -739,11 +739,11 @@ text \ This version is proved for all ordered rings, not just integers! - It is proved here because attribute \arith_split\ is not available + It is proved here because attribute \linarith_split\ is not available in theory \Rings\. But is it really better than just rewriting with \abs_if\? \ -lemma abs_split [arith_split, no_atp]: "P \a\ \ (0 \ a \ P a) \ (a < 0 \ P (- a))" +lemma abs_split [linarith_split, no_atp]: "P \a\ \ (0 \ a \ P a) \ (a < 0 \ P (- a))" for a :: "'a::linordered_idom" by (force dest: order_less_le_trans simp add: abs_if linorder_not_less) diff -r dc758531077b -r fcd118d9242f src/HOL/Numeral_Simprocs.thy --- a/src/HOL/Numeral_Simprocs.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/Numeral_Simprocs.thy Fri Aug 19 05:49:09 2022 +0000 @@ -20,8 +20,8 @@ numeral_One [symmetric] uminus_numeral_One [symmetric] Suc_eq_plus1 eq_numeral_iff_iszero not_iszero_Numeral1 -declare split_div [of _ _ "numeral k", arith_split] for k -declare split_mod [of _ _ "numeral k", arith_split] for k +declare split_div [of _ _ "numeral k", linarith_split] for k +declare split_mod [of _ _ "numeral k", linarith_split] for k text \For \combine_numerals\\ diff -r dc758531077b -r fcd118d9242f src/HOL/Tools/lin_arith.ML --- a/src/HOL/Tools/lin_arith.ML Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/Tools/lin_arith.ML Fri Aug 19 05:49:09 2022 +0000 @@ -961,7 +961,7 @@ val global_setup = map_theory_simpset (fn ctxt => ctxt addSolver (mk_solver "lin_arith" (add_arith_facts #> Fast_Arith.prems_lin_arith_tac))) #> - Attrib.setup \<^binding>\arith_split\ (Scan.succeed (Thm.declaration_attribute add_split)) + Attrib.setup \<^binding>\linarith_split\ (Scan.succeed (Thm.declaration_attribute add_split)) "declaration of split rules for arithmetic procedure" #> Method.setup \<^binding>\linarith\ (Scan.succeed (fn ctxt => diff -r dc758531077b -r fcd118d9242f src/HOL/ex/Arith_Examples.thy --- a/src/HOL/ex/Arith_Examples.thy Fri Aug 19 05:49:07 2022 +0000 +++ b/src/HOL/ex/Arith_Examples.thy Fri Aug 19 05:49:09 2022 +0000 @@ -98,13 +98,13 @@ by linarith lemma "(i::nat) mod 0 = i" - using split_mod [of _ _ 0, arith_split] + using split_mod [of _ _ 0, linarith_split] \ \rule \<^text>\split_mod\ is only declared by default for numerals\ by linarith lemma "(i::nat) mod 1 = 0" (* rule split_mod is only declared by default for numerals *) - using split_mod [of _ _ 1, arith_split] + using split_mod [of _ _ 1, linarith_split] \ \rule \<^text>\split_mod\ is only declared by default for numerals\ by linarith @@ -112,12 +112,12 @@ by linarith lemma "(i::int) mod 0 = i" - using split_zmod [of _ _ 0, arith_split] + using split_zmod [of _ _ 0, linarith_split] \ \rule \<^text>\split_zmod\ is only declared by default for numerals\ by linarith lemma "(i::int) mod 1 = 0" - using split_zmod [of _ _ "1", arith_split] + using split_zmod [of _ _ "1", linarith_split] \ \rule \<^text>\split_zmod\ is only declared by default for numerals\ by linarith