This directory demonstrates how to find the bug with TLC and Apalache.
Tip
To download the CLI version of TLC, run:
wget https://github.com/tlaplus/tlaplus/releases/download/v1.7.4/tla2tools.jar
To find an invariant violation for the buffer size of 2 and
{0, 1} as buffer elements:
$ java -cp tla2tools.jar "-XX:+UseParallelGC" tlc2.TLC \
-config MC.cfg MC2u1_BuggyCircularBuffer.tlaYou can try to do the same for buffer size of 10 and 0..255 as buffer
elements, but it will eat all of your disk space!:
$ java -cp tla2tools.jar "-XX:+UseParallelGC" tlc2.TLC \
-simulate -config MC.cfg MC10u8_BuggyCircularBuffer.tlaTo find an invariant violation for the buffer size of 10:
$ java -cp tla2tools.jar "-XX:+UseParallelGC" tlc2.TLC \
-simulate -config MC.cfg MC10u8_BuggyCircularBuffer.tlaTo bump the buffer size to 100:
$ java -cp tla2tools.jar "-XX:+UseParallelGC" tlc2.TLC \
-simulate -config MC.cfg MC100u8_BuggyCircularBuffer.tlaTip
To download the Apalache docker image, run:
docker pull ghcr.io/apalache-mc/apalache
To find an invariant violation for the buffer size of 10:
$ docker run --rm -v `pwd`:/var/apalache ghcr.io/apalache-mc/apalache \
check --inv=SafeInv --length=20 MC10u8_BuggyCircularBuffer.tla$ docker run --rm -v `pwd`:/var/apalache ghcr.io/apalache-mc/apalache \
simulate --inv=SafeInv --length=20 MC10u8_BuggyCircularBuffer.tla