Increment(p) == /\ v' = v + 1 |
It seems that changes made by one processor are not seen my the other processor.
SPECIFICATION Spec
CONSTANT Debug = TRUE
CONSTANT Proc = {p1}
CONSTANT MaxValue = 10
INVARIANTS
Invariants
CONSTRAINTS
ClockConstraint
Running this shows a single thread incrementing the single variable v
monotonically, as we would expect:
$ tlc incrementer.tla
TLC2 Version 2.14 of 10 July 2019 (rev: 0cae24f)
(...)
Computing initial states...
Finished computing initial states: 1 distinct state generated at 2020-04-20 12:29:39.
"Proc[p1] v = 0"
"Proc[p1] v = 1"
"Proc[p1] v = 2"
"Proc[p1] v = 3"
"Proc[p1] v = 4"
"Proc[p1] v = 5"
"Proc[p1] v = 6"
"Proc[p1] v = 7"
"Proc[p1] v = 8"
"Proc[p1] v = 9"
"Proc[p1] v = 10"
Model checking completed. No error has been found.
(...)
SPECIFICATION Spec
CONSTANT Debug = TRUE
CONSTANT Proc = {p1, p2}
CONSTANT MaxValue = 10
INVARIANTS
Invariants
CONSTRAINTS
ClockConstraint
Running this shows what seems to be two separate threads incrementing a variable, monotonically, but separately...
$ tlc incrementer.tla
TLC2 Version 2.14 of 10 July 2019 (rev: 0cae24f)
Running breadth-first search Model-Checking with fp 17 and seed -6108814598051602586 with 1 worker on 8 cores with 7134MB heap and 64MB offheap memory [pid: 20023] (Linux 4.15.0-96-generic amd64, Ubuntu 11.0.6 x86_64, MSBDiskFPSet, DiskStateQueue).
(...)
Finished computing initial states: 1 distinct state generated at 2020-04-20 12:35:00.
"Proc[p1] v = 0"
"Proc[p2] v = 0"
"Proc[p1] v = 1"
"Proc[p2] v = 1"
"Proc[p1] v = 2"
"Proc[p2] v = 2"
"Proc[p1] v = 3"
"Proc[p2] v = 3"
"Proc[p1] v = 4"
"Proc[p2] v = 4"
"Proc[p1] v = 5"
"Proc[p2] v = 5"
"Proc[p1] v = 6"
"Proc[p2] v = 6"
"Proc[p1] v = 7"
"Proc[p2] v = 7"
"Proc[p1] v = 8"
"Proc[p2] v = 8"
"Proc[p1] v = 9"
"Proc[p2] v = 9"
"Proc[p1] v = 10"
"Proc[p2] v = 10"
Model checking completed. No error has been found.
(...)
v
variable here?Increment
action, and the output is the same:Increment(p) ==
/\ v' = v + 1
/\ PrintT("Proc[" \o ToString(p) \o "] v = " \o ToString(v) \o " to v' = " \o ToString(v'))