4776
|
1 |
(* Title: HOL/UNITY/Channel
|
|
2 |
ID: $Id$
|
|
3 |
Author: Lawrence C Paulson, Cambridge University Computer Laboratory
|
|
4 |
Copyright 1998 University of Cambridge
|
|
5 |
|
|
6 |
Unordered Channel
|
|
7 |
|
|
8 |
From Misra, "A Logic for Concurrent Programming" (1994), section 13.3
|
|
9 |
*)
|
|
10 |
|
|
11 |
Channel = WFair + Option +
|
|
12 |
|
|
13 |
types state = nat set
|
|
14 |
|
5648
|
15 |
consts
|
|
16 |
F :: state program
|
|
17 |
|
4776
|
18 |
constdefs
|
|
19 |
minSet :: nat set => nat option
|
|
20 |
"minSet A == if A={} then None else Some (LEAST x. x:A)"
|
|
21 |
|
|
22 |
rules
|
|
23 |
|
5648
|
24 |
UC1 "F : constrains (minSet -`` {Some x}) (minSet -`` (Some``atLeast x))"
|
4776
|
25 |
|
5648
|
26 |
(* UC1 "F : constrains {s. minSet s = x} {s. x <= minSet s}" *)
|
4776
|
27 |
|
5648
|
28 |
UC2 "F : leadsTo (minSet -`` {Some x}) {s. x ~: s}"
|
4776
|
29 |
|
|
30 |
end
|