src/HOL/UNITY/Union.thy
author paulson
Mon Oct 18 15:18:24 1999 +0200 (1999-10-18)
changeset 7878 43b03d412b82
parent 7826 c6a8b73b6c2a
child 7915 c7fd7eb3b0ef
permissions -rw-r--r--
working version with localTo[C] instead of localTo
     1 (*  Title:      HOL/UNITY/Union.thy
     2     ID:         $Id$
     3     Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
     4     Copyright   1998  University of Cambridge
     5 
     6 Unions of programs
     7 
     8 Partly from Misra's Chapter 5: Asynchronous Compositions of Programs
     9 
    10 Do we need a Meet operator?  (Aka Intersection)
    11 *)
    12 
    13 Union = SubstAx + FP +
    14 
    15 constdefs
    16   JOIN  :: ['a set, 'a => 'b program] => 'b program
    17     "JOIN I F == mk_program (INT i:I. Init (F i), UN i:I. Acts (F i))"
    18 
    19   Join :: ['a program, 'a program] => 'a program      (infixl 65)
    20     "F Join G == mk_program (Init F Int Init G, Acts F Un Acts G)"
    21 
    22   SKIP :: 'a program
    23     "SKIP == mk_program (UNIV, {})"
    24 
    25   Diff :: "['a set, 'a program, ('a * 'a)set set] => 'a program"
    26     "Diff C G acts ==
    27        mk_program (Init G, (Restrict C `` Acts G) - (Restrict C `` acts))"
    28 
    29   (*The set of systems that regard "v" as local to F*)
    30   LOCALTO :: ['a => 'b, 'a set, 'a program] => 'a program set
    31                                            ("(_/ localTo[_]/ _)" [80,0,80] 80)
    32     "v localTo[C] F == {G. ALL z. Diff C G (Acts F) : stable {s. v s = z}}"
    33 
    34   (*The weak version of localTo, considering only G's reachable states*)
    35   LocalTo :: ['a => 'b, 'a program] => 'a program set  (infixl 80)
    36     "v LocalTo F == {G. G : v localTo[reachable G] F}"
    37 
    38   (*Two programs with disjoint actions, except for identity actions.
    39     It's a weak property but still useful.*)
    40   Disjoint :: ['a set, 'a program, 'a program] => bool
    41     "Disjoint C F G ==
    42        (Restrict C `` (Acts F - {Id})) Int (Restrict C `` (Acts G - {Id}))
    43        <= {}"
    44 
    45 syntax
    46   "@JOIN1"     :: [pttrns, 'b set] => 'b set         ("(3JN _./ _)" 10)
    47   "@JOIN"      :: [pttrn, 'a set, 'b set] => 'b set  ("(3JN _:_./ _)" 10)
    48 
    49 translations
    50   "JN x:A. B"   == "JOIN A (%x. B)"
    51   "JN x y. B"   == "JN x. JN y. B"
    52   "JN x. B"     == "JOIN UNIV (%x. B)"
    53 
    54 end