QLOCK

This example provides a formal specification of the QLOCK protocol, a mutual exclusion algorithm for concurrent systems. It coordinates access to the critical section by organizing processes in a queue-like structure, ensuring that only one process enters at a time while preserving ordering.

Verification

This case study checks a symbolic invariant for the QLOCK mutual-exclusion protocol. Folding requires auxiliary facts about the list-to-multiset function l2ms; after adding the corresponding lemmas, the invariant is closed modulo the generated NuITP obligations.

The example also illustrates interactive transformations used when direct subsumption is insufficient, including variant unification, constructor case splitting, narrowing, variable abstraction, and substitution.

Those transformations are then used in the deadlock-freedom containment argument until the final subsumption query succeeds. The downloadable files contain the exact command and proof material.

Run it

Extract the DM-Check archive and, from that folder, replay the whole case study with its script:

$ maude -allow-files
Maude> load examples/qlock/qlock.maude
Maude> load dm-check.maude

DM-Check> load examples/qlock/qlock.dmc

The script selects the module QLOCK, prints every command before running it, and stops at the end of the file or at the first command that cannot be parsed or executed. To follow the proof step by step, type the commands one by one at the prompt instead. See Install, step 5 for the script format.

The two lemmas on l2ms added during the proof are discharged with NuITP. From the same folder, in a new Maude session, run its script:

$ maude -allow-files
Maude> load examples/qlock/qlock.maude
Maude> load NuITP.maude
Maude> erew in NuITP : init .

NuITP> load examples/qlock/qlock.nuitp