author | nipkow |
Tue, 09 May 1995 22:10:08 +0200 | |
changeset 1114 | c8dfb56a7e95 |
parent 972 | e61b058d58d2 |
child 1128 | 64b30e3cc6d4 |
permissions | -rw-r--r-- |
923 | 1 |
(* Title: HOL/trancl.thy |
2 |
ID: $Id$ |
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory |
|
4 |
Copyright 1992 University of Cambridge |
|
5 |
||
6 |
Transitive closure of a relation |
|
7 |
||
8 |
rtrancl is refl/transitive closure; trancl is transitive closure |
|
9 |
*) |
|
10 |
||
11 |
Trancl = Lfp + Prod + |
|
12 |
consts |
|
13 |
trans :: "('a * 'a)set => bool" (*transitivity predicate*) |
|
14 |
id :: "('a * 'a)set" |
|
15 |
rtrancl :: "('a * 'a)set => ('a * 'a)set" ("(_^*)" [100] 100) |
|
16 |
trancl :: "('a * 'a)set => ('a * 'a)set" ("(_^+)" [100] 100) |
|
17 |
O :: "[('b * 'c)set, ('a * 'b)set] => ('a * 'c)set" (infixr 60) |
|
18 |
defs |
|
972
e61b058d58d2
changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents:
923
diff
changeset
|
19 |
trans_def "trans(r) == (!x y z. (x,y):r --> (y,z):r --> (x,z):r)" |
923 | 20 |
comp_def (*composition of relations*) |
972
e61b058d58d2
changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents:
923
diff
changeset
|
21 |
"r O s == {xz. ? x y z. xz = (x,z) & (x,y):s & (y,z):r}" |
923 | 22 |
id_def (*the identity relation*) |
972
e61b058d58d2
changed syntax of tuples from <..., ...> to (..., ...)
clasohm
parents:
923
diff
changeset
|
23 |
"id == {p. ? x. p = (x,x)}" |
923 | 24 |
rtrancl_def "r^* == lfp(%s. id Un (r O s))" |
25 |
trancl_def "r^+ == r O rtrancl(r)" |
|
26 |
end |