Fair Readers & Writers (Fair R&W)
This example provides a formal specification of the Fair Readers and Writers protocol. It regulates access to a shared resource by allowing multiple readers to proceed concurrently while ensuring that writers obtain exclusive access in a fair manner, preventing starvation.
Verification
This example contains the larger Fair Readers & Writers specification and the accompanying DM-Check command material. It is useful for experimenting with symbolic invariant checks over a richer state representation.
The page intentionally avoids summarizing an open or version-sensitive proof attempt as a verified property. The downloadable command material is the authoritative source for the exact checks performed with the current release.
When a child has matching parents but a semantic obligation remains open, the branch is not considered folded until that obligation is discharged.
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/rw-fair/rw-fair.maude
Maude> load dm-check.maude
DM-Check> load examples/rw-fair/rw-fair.dmcThe script selects the module R&W-FAIR, 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.
As an independent check, the NuITP script proves that every state of the first disjunct of the invariant enables some rule (DM-Check establishes deadlock freedom directly, with the case commands of its script). From the same folder, in a new Maude session, run it:
$ maude -allow-files
Maude> load examples/rw-fair/rw-fair.maude
Maude> load NuITP.maude
Maude> erew in NuITP : init .
NuITP> load examples/rw-fair/rw-fair.nuitp