author | nipkow |
Thu, 16 Nov 1995 19:50:40 +0100 | |
changeset 1334 | 32a9fde85699 |
parent 1128 | 64b30e3cc6d4 |
child 1454 | d0266c81a85e |
permissions | -rw-r--r-- |
1128
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
1 |
(* Title: Relation.thy |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
2 |
ID: $Id$ |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
3 |
Author: Riccardo Mattolini, Dip. Sistemi e Informatica |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
4 |
and Lawrence C Paulson, Cambridge University Computer Laboratory |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
5 |
Copyright 1994 Universita' di Firenze |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
6 |
Copyright 1993 University of Cambridge |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
7 |
*) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
8 |
|
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
9 |
Relation = Prod + |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
10 |
consts |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
11 |
id :: "('a * 'a)set" (*the identity relation*) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
12 |
O :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
13 |
trans :: "('a * 'a)set => bool" (*transitivity predicate*) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
14 |
converse :: "('a*'a) set => ('a*'a) set" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
15 |
"^^" :: "[('a*'a) set,'a set] => 'a set" (infixl 90) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
16 |
Domain :: "('a*'a) set => 'a set" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
17 |
Range :: "('a*'a) set => 'a set" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
18 |
defs |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
19 |
id_def "id == {p. ? x. p = (x,x)}" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
20 |
comp_def (*composition of relations*) |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
21 |
"r O s == {xz. ? x y z. xz = (x,z) & (x,y):s & (y,z):r}" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
22 |
trans_def "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
23 |
converse_def "converse(r) == {z. (? w:r. ? x y. w=(x,y) & z=(y,x))}" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
24 |
Domain_def "Domain(r) == {z. ! x. (z=x --> (? y. (x,y):r))}" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
25 |
Range_def "Range(r) == Domain(converse(r))" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
26 |
Image_def "r ^^ s == {y. y:Range(r) & (? x:s. (x,y):r)}" |
64b30e3cc6d4
Trancl is now based on Relation which used to be in Integ.
nipkow
parents:
diff
changeset
|
27 |
end |