src/HOL/UNITY/WFair.thy
author paulson
Fri, 17 Jul 1998 10:50:28 +0200
changeset 5155 21177b8a4d7f
parent 4776 1f9362e769c1
child 5239 2fd94efb9d64
permissions -rw-r--r--
added comments
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     1
(*  Title:      HOL/UNITY/WFair
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     2
    ID:         $Id$
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     3
    Author:     Lawrence C Paulson, Cambridge University Computer Laboratory
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     4
    Copyright   1998  University of Cambridge
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     5
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     6
Weak Fairness versions of transient, ensures, leadsTo.
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     7
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     8
From Misra, "A Logic for Concurrent Programming", 1994
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
     9
*)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    10
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    11
WFair = Traces + Vimage +
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    12
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    13
constdefs
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    14
5155
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    15
  (*This definition specifies weak fairness.  The rest of the theory
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    16
    is generic to all forms of fairness.*)
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    17
  transient :: "[('a * 'a)set set, 'a set] => bool"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    18
    "transient Acts A == EX act:Acts. A <= Domain act & act^^A <= Compl A"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    19
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    20
  ensures :: "[('a * 'a)set set, 'a set, 'a set] => bool"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    21
    "ensures Acts A B == constrains Acts (A-B) (A Un B) & transient Acts (A-B)"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    22
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    23
consts leadsTo :: "[('a * 'a)set set, 'a set, 'a set] => bool"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    24
       leadsto :: "[('a * 'a)set set] => ('a set * 'a set) set"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    25
  
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    26
translations
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    27
  "leadsTo Acts A B" == "(A,B) : leadsto Acts"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    28
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    29
inductive "leadsto Acts"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    30
  intrs 
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    31
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    32
    Basis  "ensures Acts A B ==> leadsTo Acts A B"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    33
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    34
    Trans  "[| leadsTo Acts A B;  leadsTo Acts B C |]
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    35
	   ==> leadsTo Acts A C"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    36
5155
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    37
    (*Encoding using powerset of the desired axiom
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    38
       (!!A. A : S ==> leadsTo Acts A B) ==> leadsTo Acts (Union S) B
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    39
    *)
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    40
    Union  "(UN A:S. {(A,B)}) : Pow (leadsto Acts)
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    41
	   ==> leadsTo Acts (Union S) B"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    42
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    43
  monos "[Pow_mono]"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    44
5155
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    45
21177b8a4d7f added comments
paulson
parents: 4776
diff changeset
    46
(*wlt Acts B is the largest set that leads to B*)
4776
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    47
constdefs wlt :: "[('a * 'a)set set, 'a set] => 'a set"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    48
  "wlt Acts B == Union {A. leadsTo Acts A B}"
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    49
1f9362e769c1 New UNITY theory
paulson
parents:
diff changeset
    50
end