CHC-based Software Verification
This example provides a formal specification of software verification using Constrained Horn Clauses (CHC). It models the behavior of a simple imperative program and encodes its semantics and properties as logical clauses, enabling the verification of invariants such as correctness of loop execution.
Verification
This example encodes a simple imperative loop using Constrained Horn Clauses and illustrates how DM-Check can perform symbolic invariant analysis over the resulting rewrite-theory representation.
The example focuses on the relationship between program variables across loop iterations and on checking a candidate symbolic invariant under the encoded transitions.
For the exact invariant and verification result, use the downloadable specification and DM-Check command material rather than the informal summary on this page.
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/chc/chc.maude
Maude> load dm-check.maude
DM-Check> load examples/chc/chc.dmcThe script selects the module CHC, 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.