src/CCL/Trancl.thy
author paulson
Mon Dec 07 18:26:25 1998 +0100 (1998-12-07)
changeset 6019 0e55c2fb2ebb
parent 1474 3f7d67927fe2
child 17456 bcf7544875b2
permissions -rw-r--r--
tidying
clasohm@1474
     1
(*  Title:      CCL/trancl.thy
clasohm@0
     2
    ID:         $Id$
clasohm@1474
     3
    Author:     Martin Coen, Cambridge University Computer Laboratory
clasohm@0
     4
    Copyright   1993  University of Cambridge
clasohm@0
     5
clasohm@0
     6
Transitive closure of a relation
clasohm@0
     7
*)
clasohm@0
     8
clasohm@0
     9
Trancl = CCL +
clasohm@0
    10
clasohm@0
    11
consts
clasohm@1474
    12
    trans   :: "i set => o"                   (*transitivity predicate*)
clasohm@1474
    13
    id      :: "i set"
clasohm@1474
    14
    rtrancl :: "i set => i set"               ("(_^*)" [100] 100)
clasohm@1474
    15
    trancl  :: "i set => i set"               ("(_^+)" [100] 100)  
clasohm@1474
    16
    O       :: "[i set,i set] => i set"       (infixr 60)
clasohm@0
    17
clasohm@0
    18
rules   
clasohm@0
    19
clasohm@1474
    20
trans_def       "trans(r) == (ALL x y z. <x,y>:r --> <y,z>:r --> <x,z>:r)"
clasohm@1474
    21
comp_def        (*composition of relations*)
clasohm@1474
    22
                "r O s == {xz. EX x y z. xz = <x,z> & <x,y>:s & <y,z>:r}"
clasohm@1474
    23
id_def          (*the identity relation*)
clasohm@1474
    24
                "id == {p. EX x. p = <x,x>}"
clasohm@1474
    25
rtrancl_def     "r^* == lfp(%s. id Un (r O s))"
clasohm@1474
    26
trancl_def      "r^+ == r O rtrancl(r)"
clasohm@0
    27
clasohm@0
    28
end