Hi,
"I" have written an agent skill (scripts included) for writing TLA+ specs, checking them with TLC, and proving them with TLAPS.
I would appreciate any comments on it’s usefulness and the validity of it’s methods.
Skill: https://github.com/scottcochran/TOPAK/tree/main/skills/writing-tla-specs-and-proofs
What it has the agent do:
Mutation matrix. Every module has one constant, Mut. Mut = "none"
is the spec; each other value removes exactly one guard, and the
module header names the property that removal must break. TLC must
find a counterexample for each mutation against the property it
should break, and none against every other property.
Witnesses. For each state the design says is reachable there is a
Never... invariant that TLC must violate, so that no property
holds only because the state it forbids is unreachable.
Proofs. A proof module extends the spec unedited and proves
Spec => []P for each property, assuming only Mut # "M_X" for the
mutations that break P. Properties are written as a flag the
violating action would set, or over an append-only set, which
makes most invariants inductive as stated.
Hypothesis flipping. Before a proof counts, one Mut # "M_X" is
changed to Mut = "M_X" in a scratch copy, and tlapm must then fail
in a statement that carried the hypothesis. A proof that survives
is proving something the mutation does not break.
Evidence. TLC results are called "checked" at stated constants,
TLAPS results "proved" under named hypotheses, and simulation
"sampled". Each comes from a dated results file that a script
regenerates, with the digests of the modules and the tool.
It does not cover PlusCal, Apalache or refinement.
Writing proofs this way turned up two TLAPS soundness issues where tlapm proved false statements:
The skill carries writing rules that try to avoid both on builds without the fixes.
Questions I would most like answered:
This skill was developed using AI to write it based on the practices gathered while using AI to develop the processes and perform the tasks included in the skill.
Thanks,
Scott