-
Notifications
You must be signed in to change notification settings - Fork 0
/
client-server.maude
66 lines (46 loc) · 1.46 KB
/
client-server.maude
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
load ltlr-checker
load client-server-model
mod CLIENT-SERVER-CHECK is
protecting CLIENT-SERVER-ABS .
inc LTLR-MODEL-CHECKER .
subsort Conf < State .
vars C S : Oid . vars N M : Nat . var CF : Conf .
op answered : Oid -> Prop .
eq [C,S,N,M] CF |= answered(C) = true .
eq CF |= answered(C) = false [owise] .
op init : -> State .
eq init = [a] [b,a,1,nil] [c,a,0,nil] .
endm
set verbose on .
--- false
red modelCheck(init, <> answered(b)) .
--------------- ---------------
--- Full Maude commands
set verbose off .
load ltlr-interface
(mod CLIENT-SERVER-CHECK-CONTEXT is
including LTLR-MODEL-CHECKER .
protecting CLIENT-SERVER-CHECK .
protecting CONTEXT[CLIENT-SERVER] . --- generate context signature
subsort Context$Conf < StateContext . --- declare state context sort
endm)
(select CLIENT-SERVER-CHECK .)
set verbose on .
--- false
(mc init |= <> answered(b) .)
--- false (plus context information)
(mc in CLIENT-SERVER-CHECK-CONTEXT : init |= [] (req(b) -> <> answered(b)) .)
--- true
(pfmc init |= <> answered(b) .)
--- false
(mc init |= <> answered(b) under
just(req(C:Oid)) ; just(rec(b)) .)
--- false
(mc init |= <> answered(b) under
just(req(C:Oid)) ; just(rec(C:Oid)) ; fair(reply(S:Oid,C:Oid)) .)
--- true
(mc init |= <> answered(b) under
just(req(b)) ; fair(rec(C:Oid)) ; fair(reply(S:Oid,b)) .)
--- true
(mc init |= <> answered(b) under
just(req(C:Oid)) ; fair(rec(C:Oid)) ; fair(reply(S:Oid,C:Oid)) .)