--- a/src/HOL/Decision_Procs/Cooper.thy Thu Nov 05 10:39:49 2015 +0100
+++ b/src/HOL/Decision_Procs/Cooper.thy Thu Nov 05 10:39:59 2015 +0100
@@ -18,7 +18,7 @@
datatype num = C int | Bound nat | CN nat int num | Neg num | Add num num| Sub num num
| Mul int num
-primrec num_size :: "num \<Rightarrow> nat" -- \<open>A size for num to make inductive proofs simpler\<close>
+primrec num_size :: "num \<Rightarrow> nat" \<comment> \<open>A size for num to make inductive proofs simpler\<close>
where
"num_size (C c) = 1"
| "num_size (Bound n) = 1"
@@ -44,7 +44,7 @@
| Closed nat | NClosed nat
-fun fmsize :: "fm \<Rightarrow> nat" -- \<open>A size for fm\<close>
+fun fmsize :: "fm \<Rightarrow> nat" \<comment> \<open>A size for fm\<close>
where
"fmsize (NOT p) = 1 + fmsize p"
| "fmsize (And p q) = 1 + fmsize p + fmsize q"
@@ -60,7 +60,7 @@
lemma fmsize_pos: "fmsize p > 0"
by (induct p rule: fmsize.induct) simp_all
-primrec Ifm :: "bool list \<Rightarrow> int list \<Rightarrow> fm \<Rightarrow> bool" -- \<open>Semantics of formulae (fm)\<close>
+primrec Ifm :: "bool list \<Rightarrow> int list \<Rightarrow> fm \<Rightarrow> bool" \<comment> \<open>Semantics of formulae (fm)\<close>
where
"Ifm bbs bs T \<longleftrightarrow> True"
| "Ifm bbs bs F \<longleftrightarrow> False"
@@ -113,7 +113,7 @@
by (induct p arbitrary: bs rule: prep.induct) auto
-fun qfree :: "fm \<Rightarrow> bool" -- \<open>Quantifier freeness\<close>
+fun qfree :: "fm \<Rightarrow> bool" \<comment> \<open>Quantifier freeness\<close>
where
"qfree (E p) \<longleftrightarrow> False"
| "qfree (A p) \<longleftrightarrow> False"
@@ -127,7 +127,7 @@
text \<open>Boundedness and substitution\<close>
-primrec numbound0 :: "num \<Rightarrow> bool" -- \<open>a num is INDEPENDENT of Bound 0\<close>
+primrec numbound0 :: "num \<Rightarrow> bool" \<comment> \<open>a num is INDEPENDENT of Bound 0\<close>
where
"numbound0 (C c) \<longleftrightarrow> True"
| "numbound0 (Bound n) \<longleftrightarrow> n > 0"
@@ -142,7 +142,7 @@
shows "Inum (b # bs) a = Inum (b' # bs) a"
using nb by (induct a rule: num.induct) (auto simp add: gr0_conv_Suc)
-primrec bound0 :: "fm \<Rightarrow> bool" -- \<open>A Formula is independent of Bound 0\<close>
+primrec bound0 :: "fm \<Rightarrow> bool" \<comment> \<open>A Formula is independent of Bound 0\<close>
where
"bound0 T \<longleftrightarrow> True"
| "bound0 F \<longleftrightarrow> True"
@@ -188,7 +188,7 @@
"numbound0 a \<Longrightarrow> Inum (b#bs) (numsubst0 a t) = Inum ((Inum (b'#bs) a)#bs) t"
by (induct t rule: numsubst0.induct) (auto simp: nth_Cons' numbound0_I[where b="b" and b'="b'"])
-primrec subst0:: "num \<Rightarrow> fm \<Rightarrow> fm" -- \<open>substitue a num into a formula for Bound 0\<close>
+primrec subst0:: "num \<Rightarrow> fm \<Rightarrow> fm" \<comment> \<open>substitue a num into a formula for Bound 0\<close>
where
"subst0 t T = T"
| "subst0 t F = F"
@@ -254,7 +254,7 @@
lemma decr_qf: "bound0 p \<Longrightarrow> qfree (decr p)"
by (induct p) simp_all
-fun isatom :: "fm \<Rightarrow> bool" -- \<open>test for atomicity\<close>
+fun isatom :: "fm \<Rightarrow> bool" \<comment> \<open>test for atomicity\<close>
where
"isatom T \<longleftrightarrow> True"
| "isatom F \<longleftrightarrow> True"
@@ -856,9 +856,9 @@
(auto simp add: not disj conj iff imp not_qf disj_qf conj_qf imp_qf iff_qf
simpfm simpfm_qf simp del: simpfm.simps)
-text \<open>Linearity for fm where Bound 0 ranges over @{text "\<int>"}\<close>
+text \<open>Linearity for fm where Bound 0 ranges over \<open>\<int>\<close>\<close>
-fun zsplit0 :: "num \<Rightarrow> int \<times> num" -- \<open>splits the bounded from the unbounded part\<close>
+fun zsplit0 :: "num \<Rightarrow> int \<times> num" \<comment> \<open>splits the bounded from the unbounded part\<close>
where
"zsplit0 (C c) = (0, C c)"
| "zsplit0 (Bound n) = (if n = 0 then (1, C 0) else (0, Bound n))"
@@ -989,7 +989,7 @@
by simp
qed
-consts iszlfm :: "fm \<Rightarrow> bool" -- \<open>Linearity test for fm\<close>
+consts iszlfm :: "fm \<Rightarrow> bool" \<comment> \<open>Linearity test for fm\<close>
recdef iszlfm "measure size"
"iszlfm (And p q) \<longleftrightarrow> iszlfm p \<and> iszlfm q"
"iszlfm (Or p q) \<longleftrightarrow> iszlfm p \<and> iszlfm q"
@@ -1006,7 +1006,7 @@
lemma zlin_qfree: "iszlfm p \<Longrightarrow> qfree p"
by (induct p rule: iszlfm.induct) auto
-consts zlfm :: "fm \<Rightarrow> fm" -- \<open>Linearity transformation for fm\<close>
+consts zlfm :: "fm \<Rightarrow> fm" \<comment> \<open>Linearity transformation for fm\<close>
recdef zlfm "measure fmsize"
"zlfm (And p q) = And (zlfm p) (zlfm q)"
"zlfm (Or p q) = Or (zlfm p) (zlfm q)"
@@ -1258,7 +1258,7 @@
qed
qed auto
-consts minusinf :: "fm \<Rightarrow> fm" -- \<open>Virtual substitution of @{text "-\<infinity>"}\<close>
+consts minusinf :: "fm \<Rightarrow> fm" \<comment> \<open>Virtual substitution of \<open>-\<infinity>\<close>\<close>
recdef minusinf "measure size"
"minusinf (And p q) = And (minusinf p) (minusinf q)"
"minusinf (Or p q) = Or (minusinf p) (minusinf q)"
@@ -1273,7 +1273,7 @@
lemma minusinf_qfree: "qfree p \<Longrightarrow> qfree (minusinf p)"
by (induct p rule: minusinf.induct) auto
-consts plusinf :: "fm \<Rightarrow> fm" -- \<open>Virtual substitution of @{text "+\<infinity>"}\<close>
+consts plusinf :: "fm \<Rightarrow> fm" \<comment> \<open>Virtual substitution of \<open>+\<infinity>\<close>\<close>
recdef plusinf "measure size"
"plusinf (And p q) = And (plusinf p) (plusinf q)"
"plusinf (Or p q) = Or (plusinf p) (plusinf q)"
@@ -1285,7 +1285,7 @@
"plusinf (Ge (CN 0 c e)) = T"
"plusinf p = p"
-consts \<delta> :: "fm \<Rightarrow> int" -- \<open>Compute @{text "lcm {d| N\<^sup>? Dvd c*x+t \<in> p}"}\<close>
+consts \<delta> :: "fm \<Rightarrow> int" \<comment> \<open>Compute \<open>lcm {d| N\<^sup>? Dvd c*x+t \<in> p}\<close>\<close>
recdef \<delta> "measure size"
"\<delta> (And p q) = lcm (\<delta> p) (\<delta> q)"
"\<delta> (Or p q) = lcm (\<delta> p) (\<delta> q)"
@@ -1293,7 +1293,7 @@
"\<delta> (NDvd i (CN 0 c e)) = i"
"\<delta> p = 1"
-consts d_\<delta> :: "fm \<Rightarrow> int \<Rightarrow> bool" -- \<open>check if a given l divides all the ds above\<close>
+consts d_\<delta> :: "fm \<Rightarrow> int \<Rightarrow> bool" \<comment> \<open>check if a given l divides all the ds above\<close>
recdef d_\<delta> "measure size"
"d_\<delta> (And p q) = (\<lambda>d. d_\<delta> p d \<and> d_\<delta> q d)"
"d_\<delta> (Or p q) = (\<lambda>d. d_\<delta> p d \<and> d_\<delta> q d)"
@@ -1354,7 +1354,7 @@
qed simp_all
-consts a_\<beta> :: "fm \<Rightarrow> int \<Rightarrow> fm" -- \<open>adjust the coefficients of a formula\<close>
+consts a_\<beta> :: "fm \<Rightarrow> int \<Rightarrow> fm" \<comment> \<open>adjust the coefficients of a formula\<close>
recdef a_\<beta> "measure size"
"a_\<beta> (And p q) = (\<lambda>k. And (a_\<beta> p k) (a_\<beta> q k))"
"a_\<beta> (Or p q) = (\<lambda>k. Or (a_\<beta> p k) (a_\<beta> q k))"
@@ -1368,7 +1368,7 @@
"a_\<beta> (NDvd i (CN 0 c e))=(\<lambda>k. NDvd ((k div c)*i) (CN 0 1 (Mul (k div c) e)))"
"a_\<beta> p = (\<lambda>k. p)"
-consts d_\<beta> :: "fm \<Rightarrow> int \<Rightarrow> bool" -- \<open>test if all coeffs c of c divide a given l\<close>
+consts d_\<beta> :: "fm \<Rightarrow> int \<Rightarrow> bool" \<comment> \<open>test if all coeffs c of c divide a given l\<close>
recdef d_\<beta> "measure size"
"d_\<beta> (And p q) = (\<lambda>k. (d_\<beta> p k) \<and> (d_\<beta> q k))"
"d_\<beta> (Or p q) = (\<lambda>k. (d_\<beta> p k) \<and> (d_\<beta> q k))"
@@ -1382,7 +1382,7 @@
"d_\<beta> (NDvd i (CN 0 c e))=(\<lambda>k. c dvd k)"
"d_\<beta> p = (\<lambda>k. True)"
-consts \<zeta> :: "fm \<Rightarrow> int" -- \<open>computes the lcm of all coefficients of x\<close>
+consts \<zeta> :: "fm \<Rightarrow> int" \<comment> \<open>computes the lcm of all coefficients of x\<close>
recdef \<zeta> "measure size"
"\<zeta> (And p q) = lcm (\<zeta> p) (\<zeta> q)"
"\<zeta> (Or p q) = lcm (\<zeta> p) (\<zeta> q)"
@@ -1434,7 +1434,7 @@
"mirror (NDvd i (CN 0 c e)) = NDvd i (CN 0 c (Neg e))"
"mirror p = p"
-text \<open>Lemmas for the correctness of @{text "\<sigma>_\<rho>"}\<close>
+text \<open>Lemmas for the correctness of \<open>\<sigma>_\<rho>\<close>\<close>
lemma dvd1_eq1:
fixes x :: int