src/HOL/UNITY/Union.thy
author paulson
Wed Oct 27 13:03:32 1999 +0200 (1999-10-27)
changeset 7947 b999c1ab9327
parent 7915 c7fd7eb3b0ef
child 8055 bb15396278fb
permissions -rw-r--r--
working again; new treatment 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@7947
    11
paulson@7947
    12
CAN PROBABLY DELETE the "Disjoint" predicate
paulson@5252
    13
*)
paulson@5252
    14
paulson@5252
    15
Union = SubstAx + FP +
paulson@5252
    16
paulson@5252
    17
constdefs
paulson@5648
    18
  JOIN  :: ['a set, 'a => 'b program] => 'b program
paulson@6295
    19
    "JOIN I F == mk_program (INT i:I. Init (F i), UN i:I. Acts (F i))"
paulson@5252
    20
paulson@5648
    21
  Join :: ['a program, 'a program] => 'a program      (infixl 65)
paulson@6295
    22
    "F Join G == mk_program (Init F Int Init G, Acts F Un Acts G)"
paulson@5252
    23
paulson@6295
    24
  SKIP :: 'a program
paulson@6295
    25
    "SKIP == mk_program (UNIV, {})"
paulson@5259
    26
paulson@7878
    27
  Diff :: "['a set, 'a program, ('a * 'a)set set] => 'a program"
paulson@7878
    28
    "Diff C G acts ==
paulson@7878
    29
       mk_program (Init G, (Restrict C `` Acts G) - (Restrict C `` acts))"
paulson@5648
    30
paulson@5804
    31
  (*The set of systems that regard "v" as local to F*)
paulson@7878
    32
  LOCALTO :: ['a => 'b, 'a set, 'a program] => 'a program set
paulson@7878
    33
                                           ("(_/ localTo[_]/ _)" [80,0,80] 80)
paulson@7878
    34
    "v localTo[C] F == {G. ALL z. Diff C G (Acts F) : stable {s. v s = z}}"
paulson@7878
    35
paulson@7878
    36
  (*The weak version of localTo, considering only G's reachable states*)
paulson@7878
    37
  LocalTo :: ['a => 'b, 'a program] => 'a program set  (infixl 80)
paulson@7915
    38
    "v LocalTo F == {G. G : v localTo[reachable (F Join G)] F}"
paulson@5804
    39
paulson@7826
    40
  (*Two programs with disjoint actions, except for identity actions.
paulson@7826
    41
    It's a weak property but still useful.*)
paulson@7878
    42
  Disjoint :: ['a set, 'a program, 'a program] => bool
paulson@7878
    43
    "Disjoint C F G ==
paulson@7878
    44
       (Restrict C `` (Acts F - {Id})) Int (Restrict C `` (Acts G - {Id}))
paulson@7878
    45
       <= {}"
paulson@5648
    46
paulson@5313
    47
syntax
paulson@7359
    48
  "@JOIN1"     :: [pttrns, 'b set] => 'b set         ("(3JN _./ _)" 10)
paulson@5313
    49
  "@JOIN"      :: [pttrn, 'a set, 'b set] => 'b set  ("(3JN _:_./ _)" 10)
paulson@5313
    50
paulson@5313
    51
translations
paulson@5313
    52
  "JN x:A. B"   == "JOIN A (%x. B)"
paulson@7359
    53
  "JN x y. B"   == "JN x. JN y. B"
paulson@7359
    54
  "JN x. B"     == "JOIN UNIV (%x. B)"
paulson@5313
    55
paulson@5252
    56
end