QLOCK-COND
This example is a variant of QLOCK in which the rule that lets a waiting process enter the critical section is conditional: it fires only when the critical section is empty. Mutual exclusion then follows from the structure of the states, and the example shows how DM-Check handles rules with equational conditions.
Verification
In this variant only the rule w2c is conditional: a waiting process at the head of the queue may enter the critical section only if non-mt(C) = ff, that is, if the critical set is empty. The condition is an equation, so it is passed to the constraint of the generated terms. Mutual exclusion is structural, and the invariant does not need the distinctness predicate used in QLOCK.
The script checks the symbolic invariant after adding two lemmas on l2ms, checks that the invariant contains the initial states, and then checks mutual exclusion with intersect. The lemmas are only needed by the invariant check, so the script clears them with reset lemmas . before the intersection; it reports No intersection..
Deadlock freedom is checked by containment in the patterns of the three rules; the pattern of w2c includes its guard. The final steps use variant unification, case splitting, narrowing, and variable abstraction until the 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-cond/qlock-cond.maude
Maude> load dm-check.maude
DM-Check> load examples/qlock-cond/qlock-cond.dmcThe 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-cond/qlock-cond.maude
Maude> load NuITP.maude
Maude> erew in NuITP : init .
NuITP> load examples/qlock-cond/qlock-cond.nuitp