Readers and Writers (R&W)
This example provides a formal specification of the Readers and Writers problem. It allows multiple readers to access a shared resource simultaneously, while writers require exclusive access, ensuring mutual exclusion and consistency of the shared data.
Verification
This is the compact introductory Readers & Writers example used in the manual. DM-Check checks that a supplied symbolic set B is transition-closed and then checks a symbolic containment property B ⊆ Q.
The example is intentionally small: the two commands illustrate inductive-invariant checking and containment by subsumption. A complete invariant proof from designated initial states would additionally require establishing A ⊆ B.
Use the downloadable Maude specification and DM-Check command material to reproduce the exact session.
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/rw.maude
Maude> load dm-check.maude
DM-Check> load examples/rw/rw.dmcThe script selects the module R&W, 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.