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
|
|
19 |
trans_def "trans(r) == (!x y z. <x,y>:r --> <y,z>:r --> <x,z>:r)"
|
|
20 |
comp_def (*composition of relations*)
|
|
21 |
"r O s == {xz. ? x y z. xz = <x,z> & <x,y>:s & <y,z>:r}"
|
|
22 |
id_def (*the identity relation*)
|
|
23 |
"id == {p. ? x. p = <x,x>}"
|
|
24 |
rtrancl_def "r^* == lfp(%s. id Un (r O s))"
|
|
25 |
trancl_def "r^+ == r O rtrancl(r)"
|
|
26 |
end
|