--- a/doc-src/IsarAdvanced/Classes/Thy/code_examples/Classes.hs Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Classes/Thy/code_examples/Classes.hs Tue Mar 18 20:34:26 2008 +0100
@@ -3,8 +3,6 @@
data Nat = Suc Nat | Zero_nat;
-data Bit = B1 | B0;
-
nat_aux :: Integer -> Nat -> Nat;
nat_aux i n = (if i <= 0 then n else nat_aux (i - 1) (Suc n));
--- a/doc-src/IsarAdvanced/Classes/Thy/code_examples/classes.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Classes/Thy/code_examples/classes.ML Tue Mar 18 20:34:26 2008 +0100
@@ -3,8 +3,6 @@
datatype nat = Suc of nat | Zero_nat;
-datatype bit = B1 | B0;
-
fun nat_aux i n =
(if IntInf.<= (i, (0 : IntInf.int)) then n
else nat_aux (IntInf.- (i, (1 : IntInf.int))) (Suc n));
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/bool_infix.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/bool_infix.ML Tue Mar 18 20:34:26 2008 +0100
@@ -3,10 +3,10 @@
datatype nat = Suc of nat | Zero_nat;
-fun less_nat n (Suc m) = less_eq_nat n m
+fun less_nat m (Suc n) = less_eq_nat m n
| less_nat n Zero_nat = false
-and less_eq_nat (Suc n) m = less_nat n m
- | less_eq_nat Zero_nat m = true;
+and less_eq_nat (Suc m) n = less_nat m n
+ | less_eq_nat Zero_nat n = true;
end; (*struct Nat*)
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/bool_literal.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/bool_literal.ML Tue Mar 18 20:34:26 2008 +0100
@@ -15,10 +15,10 @@
datatype nat = Suc of nat | Zero_nat;
-fun less_nat n (Suc m) = less_eq_nat n m
+fun less_nat m (Suc n) = less_eq_nat m n
| less_nat n Zero_nat = HOL.False
-and less_eq_nat (Suc n) m = less_nat n m
- | less_eq_nat Zero_nat m = HOL.True;
+and less_eq_nat (Suc m) n = less_nat m n
+ | less_eq_nat Zero_nat n = HOL.True;
end; (*struct Nat*)
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/bool_mlbool.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/bool_mlbool.ML Tue Mar 18 20:34:26 2008 +0100
@@ -3,10 +3,10 @@
datatype nat = Suc of nat | Zero_nat;
-fun less_nat n (Suc m) = less_eq_nat n m
+fun less_nat m (Suc n) = less_eq_nat m n
| less_nat n Zero_nat = false
-and less_eq_nat (Suc n) m = less_nat n m
- | less_eq_nat Zero_nat m = true;
+and less_eq_nat (Suc m) n = less_nat m n
+ | less_eq_nat Zero_nat n = true;
end; (*struct Nat*)
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/monotype.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/monotype.ML Tue Mar 18 20:34:26 2008 +0100
@@ -8,44 +8,17 @@
| eqop_nat Zero_nat (Suc a) = false
| eqop_nat (Suc a) Zero_nat = false;
-fun plus_nat (Suc m) n = plus_nat m (Suc n)
- | plus_nat Zero_nat n = n;
-
end; (*struct Nat*)
-structure Product_Type =
-struct
-
-fun split c (a, b) = c a b;
-
-end; (*struct Product_Type*)
-
structure List =
struct
-fun list_case f1 f2 [] = f1
- | list_case f1 f2 (a :: lista) = f2 a lista;
-
-fun zip xs (y :: ys) =
- (case xs of [] => [] | z :: zs => (z, y) :: zip zs ys)
- | zip xs [] = [];
-
fun null (x :: xs) = false
| null [] = true;
-fun list_all p (x :: xs) = p x andalso list_all p xs
- | list_all p [] = true;
-
-fun size_list (a :: lista) =
- Nat.plus_nat (size_list lista) (Nat.Suc Nat.Zero_nat)
- | size_list [] = Nat.Zero_nat;
-
fun list_all2 p (x :: xs) (y :: ys) = p x y andalso list_all2 p xs ys
| list_all2 p xs [] = null xs
- | list_all2 p [] ys = null ys
- | list_all2 p xs ys =
- Nat.eqop_nat (size_list xs) (size_list ys) andalso
- list_all (fn a as (aa, b) => p aa b) (zip xs ys);
+ | list_all2 p [] ys = null ys;
end; (*struct List*)
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/pick1.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/pick1.ML Tue Mar 18 20:34:26 2008 +0100
@@ -10,10 +10,10 @@
datatype nat = Suc of nat | Zero_nat;
-fun less_nat n (Suc m) = less_eq_nat n m
+fun less_nat m (Suc n) = less_eq_nat m n
| less_nat n Zero_nat = false
-and less_eq_nat (Suc n) m = less_nat n m
- | less_eq_nat Zero_nat m = true;
+and less_eq_nat (Suc m) n = less_nat m n
+ | less_eq_nat Zero_nat n = true;
fun minus_nat (Suc m) (Suc n) = minus_nat m n
| minus_nat Zero_nat n = Zero_nat
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/pick2.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/pick2.ML Tue Mar 18 20:34:26 2008 +0100
@@ -3,10 +3,10 @@
datatype nat = Suc of nat | Zero_nat;
-fun less_nat n (Suc m) = less_eq_nat n m
+fun less_nat m (Suc n) = less_eq_nat m n
| less_nat n Zero_nat = false
-and less_eq_nat (Suc n) m = less_nat n m
- | less_eq_nat Zero_nat m = true;
+and less_eq_nat (Suc m) n = less_nat m n
+ | less_eq_nat Zero_nat n = true;
fun minus_nat (Suc m) (Suc n) = minus_nat m n
| minus_nat Zero_nat n = Zero_nat
--- a/doc-src/IsarAdvanced/Codegen/Thy/examples/tree.ML Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/IsarAdvanced/Codegen/Thy/examples/tree.ML Tue Mar 18 20:34:26 2008 +0100
@@ -33,10 +33,10 @@
val eq_nat = {eqop = eqop_nat} : nat HOL.eq;
-fun less_nat n (Suc m) = less_eq_nat n m
+fun less_nat m (Suc n) = less_eq_nat m n
| less_nat n Zero_nat = false
-and less_eq_nat (Suc n) m = less_nat n m
- | less_eq_nat Zero_nat m = true;
+and less_eq_nat (Suc m) n = less_nat m n
+ | less_eq_nat Zero_nat n = true;
val ord_nat = {less_eq = less_eq_nat, less = less_nat} : nat HOL.ord;
--- a/doc-src/TutorialI/Types/document/Records.tex Tue Mar 18 20:33:33 2008 +0100
+++ b/doc-src/TutorialI/Types/document/Records.tex Tue Mar 18 20:34:26 2008 +0100
@@ -547,23 +547,22 @@
be the same as \isa{point{\isachardot}make}.
\begin{isabelle}%
-point{\isachardot}make\ Xcoord\ Ycoord\ {\isasymequiv}\isanewline
-{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ {\isacharparenleft}{\isacharparenright}{\isasymrparr}\isasep\isanewline%
+point{\isachardot}make\ Xcoord\ Ycoord\ {\isasymequiv}\ {\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord{\isasymrparr}\isasep\isanewline%
point{\isachardot}extend\ r\ more\ {\isasymequiv}\isanewline
{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord\ r{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord\ r{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ more{\isasymrparr}\isasep\isanewline%
-point{\isachardot}truncate\ r\ {\isasymequiv}\ {\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord\ r{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord\ r{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ {\isacharparenleft}{\isacharparenright}{\isasymrparr}%
+point{\isachardot}truncate\ r\ {\isasymequiv}\ {\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord\ r{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord\ r{\isasymrparr}%
\end{isabelle}
Contrast those with the corresponding functions for record \isa{cpoint}. Observe \isa{cpoint{\isachardot}fields} in particular.
\begin{isabelle}%
cpoint{\isachardot}make\ Xcoord\ Ycoord\ col\ {\isasymequiv}\isanewline
-{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord{\isacharcomma}\ col\ {\isacharequal}\ col{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ {\isacharparenleft}{\isacharparenright}{\isasymrparr}\isasep\isanewline%
-cpoint{\isachardot}fields\ col\ {\isasymequiv}\ {\isasymlparr}col\ {\isacharequal}\ col{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ {\isacharparenleft}{\isacharparenright}{\isasymrparr}\isasep\isanewline%
+{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord{\isacharcomma}\ col\ {\isacharequal}\ col{\isasymrparr}\isasep\isanewline%
+cpoint{\isachardot}fields\ col\ {\isasymequiv}\ {\isasymlparr}col\ {\isacharequal}\ col{\isasymrparr}\isasep\isanewline%
cpoint{\isachardot}extend\ r\ more\ {\isasymequiv}\isanewline
{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord\ r{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord\ r{\isacharcomma}\ col\ {\isacharequal}\ col\ r{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ more{\isasymrparr}\isasep\isanewline%
cpoint{\isachardot}truncate\ r\ {\isasymequiv}\isanewline
-{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord\ r{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord\ r{\isacharcomma}\ col\ {\isacharequal}\ col\ r{\isacharcomma}\ {\isasymdots}\ {\isacharequal}\ {\isacharparenleft}{\isacharparenright}{\isasymrparr}%
+{\isasymlparr}Xcoord\ {\isacharequal}\ Xcoord\ r{\isacharcomma}\ Ycoord\ {\isacharequal}\ Ycoord\ r{\isacharcomma}\ col\ {\isacharequal}\ col\ r{\isasymrparr}%
\end{isabelle}
To demonstrate these functions, we declare a new coloured point by