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