| 1 |
Considering object completion on: |
| 2 |
rl [get-hungry] : < I : Philosopher | status : thinking, timer : 0 > => < I : |
| 3 |
Philosopher | status : hungry > . |
| 4 |
Transformed rule: |
| 5 |
rl [get-hungry] : < I : V:Philosopher | status : thinking, timer : 0, Atts > |
| 6 |
=> < I : V:Philosopher | timer : 0, status : hungry, Atts > . |
| 7 |
|
| 8 |
Considering object completion on: |
| 9 |
crl [grab-stick] : < I : Philosopher | status : hungry, chopsticks : N > < J |
| 10 |
: Chopstick | none > => < I : Philosopher | chopsticks : s N > if I == J or |
| 11 |
s I == J or I == 4 and J == 0 = true . |
| 12 |
Transformed rule: |
| 13 |
crl [grab-stick] : < I : V:Philosopher | status : hungry, chopsticks : N, |
| 14 |
Atts > < J : V2:Chopstick | Atts2 > => < I : V:Philosopher | status : |
| 15 |
hungry, chopsticks : s N, Atts > if I == J or s I == J or I == 4 and J == 0 |
| 16 |
= true . |
| 17 |
|
| 18 |
Considering object completion on: |
| 19 |
rl [eat] : < I : Philosopher | status : hungry, chopsticks : 2 > => < I : |
| 20 |
Philosopher | status : eating, timer : EATING-TIME > . |
| 21 |
Transformed rule: |
| 22 |
rl [eat] : < I : V:Philosopher | status : hungry, chopsticks : 2, timer : A:[ |
| 23 |
Rat,TimeInf,Oid], Atts > => < I : V:Philosopher | chopsticks : 2, status : |
| 24 |
eating, timer : EATING-TIME, Atts > . |
| 25 |
|
| 26 |
Considering object completion on: |
| 27 |
eq mte(< I : Philosopher | timer : T, Atts1 > Conf) = minimum(T, mte(Conf)) . |
| 28 |
Transformed equation: |
| 29 |
eq mte(< I : V:Philosopher | timer : T, Atts1 > Conf) = minimum(T, mte(Conf)) |
| 30 |
. |
| 31 |
|
| 32 |
Considering object completion on: |
| 33 |
eq delta(< I : Philosopher | timer : T > Conf, T') = < I : Philosopher | |
| 34 |
timer : (T - T') > delta(Conf, T') . |
| 35 |
Transformed equation: |
| 36 |
eq delta(< I : V:Philosopher | timer : T, Atts > Conf, T') = < I : |
| 37 |
V:Philosopher | timer : (T - T'), Atts > delta(Conf, T') . |
| 38 |
|
| 39 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 40 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 41 |
========================================== |
| 42 |
reduce in DINING-PHILOSOPHERS : initState . |
| 43 |
rewrites: 7 |
| 44 |
result System: {< 0 : Philosopher | status : thinking, chopsticks : 0, timer : |
| 45 |
0 > < 0 : Chopstick | none > < 1 : Philosopher | status : thinking, |
| 46 |
chopsticks : 0, timer : 0 > < 1 : Chopstick | none > < 2 : Philosopher | |
| 47 |
status : thinking, chopsticks : 0, timer : 0 > < 2 : Chopstick | none > < 3 |
| 48 |
: Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 3 : |
| 49 |
Chopstick | none > < 4 : Philosopher | status : thinking, chopsticks : 0, |
| 50 |
timer : 0 > < 4 : Chopstick | none >, 0} |
| 51 |
========================================== |
| 52 |
search [1] in DINING-PHILOSOPHERS : initState =>! S:System . |
| 53 |
|
| 54 |
Solution 1 (state 1987) |
| 55 |
states: 2120 rewrites: 284085 |
| 56 |
S:System --> {< 0 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > |
| 57 |
< 1 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 2 : |
| 58 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 3 : |
| 59 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 4 : |
| 60 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 >, 0} |
| 61 |
Considering object completion on: |
| 62 |
eq {< P : Philosopher | status : St > Conf, T} |= phil-status(P, St) = true . |
| 63 |
Transformed equation: |
| 64 |
eq {< P : V:Philosopher | status : St, Atts > Conf, T} |= phil-status(P, St) |
| 65 |
= true . |
| 66 |
|
| 67 |
Considering object completion on: |
| 68 |
eq {< P : Philosopher | chopsticks : N > Conf, T} |= phil-sticks(P, N) = true |
| 69 |
. |
| 70 |
Transformed equation: |
| 71 |
eq {< P : V:Philosopher | chopsticks : N, Atts > Conf, T} |= phil-sticks(P, |
| 72 |
N) = true . |
| 73 |
|
| 74 |
op _`,_ left-identity collapse from AttributeSet to Attribute is unequal. |
| 75 |
op __ left-identity collapse from Configuration to Object is unequal. |
| 76 |
op __ left-identity collapse from TransitionList to Transition is unequal. |
| 77 |
op __ right-identity collapse from TransitionList to Transition is unequal. |
| 78 |
========================================== |
| 79 |
reduce in DINING-PHILOSOPHERS-5-CHECK : modelCheck(initState, []~ (phil-sticks( |
| 80 |
4, 1) /\ (phil-sticks(3, 1) /\ (phil-sticks(2, 1) /\ (phil-sticks(0, 1) /\ |
| 81 |
phil-sticks(1, 1)))))) . |
| 82 |
ModelChecker: Property automaton has 2 states. |
| 83 |
ModelCheckerSymbol: Examined 459 system states. |
| 84 |
rewrites: 48194 |
| 85 |
result ModelCheckResult: counterexample({{< 0 : Philosopher | status : |
| 86 |
thinking, chopsticks : 0, timer : 0 > < 0 : Chopstick | none > < 1 : |
| 87 |
Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 1 : |
| 88 |
Chopstick | none > < 2 : Philosopher | status : thinking, chopsticks : 0, |
| 89 |
timer : 0 > < 2 : Chopstick | none > < 3 : Philosopher | status : thinking, |
| 90 |
chopsticks : 0, timer : 0 > < 3 : Chopstick | none > < 4 : Philosopher | |
| 91 |
status : thinking, chopsticks : 0, timer : 0 > < 4 : Chopstick | none >, |
| 92 |
0}, 'get-hungry} {{< 0 : Philosopher | status : hungry, chopsticks : 0, |
| 93 |
timer : 0 > < 0 : Chopstick | none > < 1 : Philosopher | status : thinking, |
| 94 |
chopsticks : 0, timer : 0 > < 1 : Chopstick | none > < 2 : Philosopher | |
| 95 |
status : thinking, chopsticks : 0, timer : 0 > < 2 : Chopstick | none > < 3 |
| 96 |
: Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 3 : |
| 97 |
Chopstick | none > < 4 : Philosopher | status : thinking, chopsticks : 0, |
| 98 |
timer : 0 > < 4 : Chopstick | none >, 0}, 'grab-stick} {{< 0 : Philosopher |
| 99 |
| status : hungry, chopsticks : 1, timer : 0 > < 1 : Philosopher | status : |
| 100 |
thinking, chopsticks : 0, timer : 0 > < 1 : Chopstick | none > < 2 : |
| 101 |
Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 2 : |
| 102 |
Chopstick | none > < 3 : Philosopher | status : thinking, chopsticks : 0, |
| 103 |
timer : 0 > < 3 : Chopstick | none > < 4 : Philosopher | status : thinking, |
| 104 |
chopsticks : 0, timer : 0 > < 4 : Chopstick | none >, 0}, 'get-hungry} {{< |
| 105 |
0 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 1 : |
| 106 |
Philosopher | status : hungry, chopsticks : 0, timer : 0 > < 1 : Chopstick |
| 107 |
| none > < 2 : Philosopher | status : thinking, chopsticks : 0, timer : 0 > |
| 108 |
< 2 : Chopstick | none > < 3 : Philosopher | status : thinking, chopsticks |
| 109 |
: 0, timer : 0 > < 3 : Chopstick | none > < 4 : Philosopher | status : |
| 110 |
thinking, chopsticks : 0, timer : 0 > < 4 : Chopstick | none >, 0}, |
| 111 |
'grab-stick} {{< 0 : Philosopher | status : hungry, chopsticks : 1, timer : |
| 112 |
0 > < 1 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 2 : |
| 113 |
Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 2 : |
| 114 |
Chopstick | none > < 3 : Philosopher | status : thinking, chopsticks : 0, |
| 115 |
timer : 0 > < 3 : Chopstick | none > < 4 : Philosopher | status : thinking, |
| 116 |
chopsticks : 0, timer : 0 > < 4 : Chopstick | none >, 0}, 'get-hungry} {{< |
| 117 |
0 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 1 : |
| 118 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 2 : |
| 119 |
Philosopher | status : hungry, chopsticks : 0, timer : 0 > < 2 : Chopstick |
| 120 |
| none > < 3 : Philosopher | status : thinking, chopsticks : 0, timer : 0 > |
| 121 |
< 3 : Chopstick | none > < 4 : Philosopher | status : thinking, chopsticks |
| 122 |
: 0, timer : 0 > < 4 : Chopstick | none >, 0}, 'grab-stick} {{< 0 : |
| 123 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 1 : |
| 124 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 2 : |
| 125 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 3 : |
| 126 |
Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 3 : |
| 127 |
Chopstick | none > < 4 : Philosopher | status : thinking, chopsticks : 0, |
| 128 |
timer : 0 > < 4 : Chopstick | none >, 0}, 'get-hungry} {{< 0 : Philosopher |
| 129 |
| status : hungry, chopsticks : 1, timer : 0 > < 1 : Philosopher | status : |
| 130 |
hungry, chopsticks : 1, timer : 0 > < 2 : Philosopher | status : hungry, |
| 131 |
chopsticks : 1, timer : 0 > < 3 : Philosopher | status : hungry, chopsticks |
| 132 |
: 0, timer : 0 > < 3 : Chopstick | none > < 4 : Philosopher | status : |
| 133 |
thinking, chopsticks : 0, timer : 0 > < 4 : Chopstick | none >, 0}, |
| 134 |
'grab-stick} {{< 0 : Philosopher | status : hungry, chopsticks : 1, timer : |
| 135 |
0 > < 1 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 2 : |
| 136 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 3 : |
| 137 |
Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 4 : |
| 138 |
Philosopher | status : thinking, chopsticks : 0, timer : 0 > < 4 : |
| 139 |
Chopstick | none >, 0}, 'get-hungry} {{< 0 : Philosopher | status : hungry, |
| 140 |
chopsticks : 1, timer : 0 > < 1 : Philosopher | status : hungry, chopsticks |
| 141 |
: 1, timer : 0 > < 2 : Philosopher | status : hungry, chopsticks : 1, timer |
| 142 |
: 0 > < 3 : Philosopher | status : hungry, chopsticks : 1, timer : 0 > < 4 |
| 143 |
: Philosopher | status : hungry, chopsticks : 0, timer : 0 > < 4 : |
| 144 |
Chopstick | none >, 0}, 'grab-stick}, {{< 0 : Philosopher | status : |
| 145 |
hungry, chopsticks : 1, timer : 0 > < 1 : Philosopher | status : hungry, |
| 146 |
chopsticks : 1, timer : 0 > < 2 : Philosopher | status : hungry, chopsticks |
| 147 |
: 1, timer : 0 > < 3 : Philosopher | status : hungry, chopsticks : 1, timer |
| 148 |
: 0 > < 4 : Philosopher | status : hungry, chopsticks : 1, timer : 0 >, 0}, |
| 149 |
deadlock}) |
| 150 |
Bye. |