diff -r dd58f13a8eb4 -r eb85850d3eb7 src/HOL/ex/Classpackage.thy --- a/src/HOL/ex/Classpackage.thy Fri Nov 17 02:19:55 2006 +0100 +++ b/src/HOL/ex/Classpackage.thy Fri Nov 17 02:20:03 2006 +0100 @@ -97,8 +97,8 @@ qed definition (in monoid) - units :: "'a set" - units_def: "units = { y. \x. x \<^loc>\ y = \<^loc>\ \ y \<^loc>\ x = \<^loc>\ }" + units :: "'a set" where + "units = { y. \x. x \<^loc>\ y = \<^loc>\ \ y \<^loc>\ x = \<^loc>\ }" lemma (in monoid) inv_obtain: assumes ass: "x \ units" @@ -139,11 +139,11 @@ "reduce f g (Suc n) x = f x (reduce f g n x)" definition (in monoid) - npow :: "nat \ 'a \ 'a" + npow :: "nat \ 'a \ 'a" where npow_def_prim: "npow n x = reduce (op \<^loc>\) \<^loc>\ n x" abbreviation (in monoid) - abbrev_npow :: "'a \ nat \ 'a" (infix "\<^loc>\" 75) + abbrev_npow :: "'a \ nat \ 'a" (infix "\<^loc>\" 75) where "x \<^loc>\ n \ npow n x" lemma (in monoid) npow_def: @@ -272,12 +272,12 @@ using invr invl by simp definition (in group) - pow :: "int \ 'a \ 'a" - pow_def: "pow k x = (if k < 0 then \<^loc>\
(monoid.npow (op \<^loc>\) \<^loc>\ (nat (-k)) x) + pow :: "int \ 'a \ 'a" where + "pow k x = (if k < 0 then \<^loc>\
(monoid.npow (op \<^loc>\) \<^loc>\ (nat (-k)) x) else (monoid.npow (op \<^loc>\) \<^loc>\ (nat k) x))" abbreviation (in group) - abbrev_pow :: "'a \ int \ 'a" (infix "\<^loc>\" 75) + abbrev_pow :: "'a \ int \ 'a" (infix "\<^loc>\" 75) where "x \<^loc>\ k \ pow k x" lemma (in group) int_pow_zero: @@ -312,12 +312,12 @@ definition "X a b c = (a \ \ \ b, a \ \ \ b, [a, b] \ \ \ [a, b, c])" +definition "Y a b c = (a, \
a) \ \ \ \
(b, \
c)" -definition - "x1 = X (1::nat) 2 3" - "x2 = X (1::int) 2 3" - "y2 = Y (1::int) 2 3" +definition "x1 = X (1::nat) 2 3" +definition "x2 = X (1::int) 2 3" +definition "y2 = Y (1::int) 2 3" code_gen "op \" \ inv code_gen X Y (SML) (Haskell)