118
|
1 |
(* Title: HOL/Ord.thy
|
|
2 |
ID: $Id$
|
|
3 |
Author: Tobias Nipkow, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1993 University of Cambridge
|
|
5 |
|
|
6 |
The type class for ordered types
|
|
7 |
*)
|
|
8 |
|
0
|
9 |
Ord = HOL +
|
|
10 |
classes
|
|
11 |
ord < term
|
|
12 |
consts
|
|
13 |
"<", "<=" :: "['a::ord, 'a] => bool" (infixl 50)
|
|
14 |
mono :: "['a::ord => 'b::ord] => bool" (*monotonicity*)
|
|
15 |
min,max :: "['a::ord,'a] => 'a"
|
|
16 |
|
|
17 |
rules
|
|
18 |
|
|
19 |
mono_def "mono(f) == (!A B. A <= B --> f(A) <= f(B))"
|
|
20 |
min_def "min(a,b) == if(a <= b, a, b)"
|
|
21 |
max_def "max(a,b) == if(a <= b, b, a)"
|
|
22 |
|
|
23 |
end
|