src/ZF/UNITY/Guar.thy
author ehmety
Thu, 15 Nov 2001 15:07:16 +0100
changeset 12195 ed2893765a08
parent 11479 697dcaaf478f
child 14093 24382760fd89
permissions -rw-r--r--
*** empty log message ***
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      ZF/UNITY/Guar.thy
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Sidi O Ehmety, Computer Laboratory
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   2001  University of Cambridge
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     5
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     6
Guarantees, etc.
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     7
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     8
From Chandy and Sanders, "Reasoning About Program Composition",
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
     9
Technical Report 2000-003, University of Florida, 2000.
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    10
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    11
Revised by Sidi Ehmety on January 2001
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    12
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    13
Added: Compatibility, weakest guarantees, etc.
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    14
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    15
and Weakest existential property,
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    16
from Charpentier and Chandy "Theorems about Composition",
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    17
Fifth International Conference on Mathematics of Program, 2000.
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    18
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    19
Theory ported from HOL.
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    20
*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    21
Guar = Comp +
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    22
constdefs
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    23
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    24
  (*Existential and Universal properties.  I formalize the two-program
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    25
    case, proving equivalence with Chandy and Sanders's n-ary definitions*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    26
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    27
   ex_prop :: i =>o
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    28
   "ex_prop(X) == X<=program &
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    29
    (ALL F:program. ALL G:program. F ok G --> F:X | G:X --> (F Join G):X)"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    30
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    31
  strict_ex_prop  :: i => o
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    32
  "strict_ex_prop(X) == X<=program &
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    33
   (ALL F:program. ALL  G:program. F ok G --> (F:X | G: X) <-> (F Join G : X))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    34
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    35
  uv_prop  :: i => o
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    36
   "uv_prop(X) == X<=program &
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    37
    (SKIP:X & (ALL F:program. ALL G:program. F ok G --> F:X & G:X --> (F Join G):X))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    38
  
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    39
 strict_uv_prop  :: i => o
12195
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    40
   "strict_uv_prop(X) == X<=program &
ed2893765a08 *** empty log message ***
ehmety
parents: 11479
diff changeset
    41
    (SKIP:X & (ALL F:program. ALL G:program. F ok G -->(F:X & G:X) <-> (F Join G:X)))"
11479
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    42
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    43
  guar :: [i, i] => i (infixl "guarantees" 55)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    44
              (*higher than membership, lower than Co*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    45
  "X guarantees Y == {F:program. ALL G:program. F ok G --> F Join G : X --> F Join G:Y}"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    46
  
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    47
  (* Weakest guarantees *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    48
   wg :: [i,i] => i
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    49
  "wg(F,Y) == Union({X:Pow(program). F:(X guarantees Y)})"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    50
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    51
  (* Weakest existential property stronger than X *)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    52
   wx :: "i =>i"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    53
   "wx(X) == Union({Y:Pow(program). Y<=X & ex_prop(Y)})"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    54
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    55
  (*Ill-defined programs can arise through "Join"*)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    56
  welldef :: i
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    57
  "welldef == {F:program. Init(F) ~= 0}"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    58
  
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    59
  refines :: [i, i, i] => o ("(3_ refines _ wrt _)" [10,10,10] 10)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    60
  "G refines F wrt X ==
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    61
   ALL H:program. (F ok H  & G ok H & F Join H:welldef Int X)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    62
    --> (G Join H:welldef Int X)"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    63
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    64
  iso_refines :: [i,i, i] => o  ("(3_ iso'_refines _ wrt _)" [10,10,10] 10)
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    65
  "G iso_refines F wrt X ==  F:welldef Int X --> G:welldef Int X"
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    66
697dcaaf478f new ZF/UNITY theory
paulson
parents:
diff changeset
    67
end