[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlaplus] RFC: an agent skill for writing, checking and proving TLA+ specs



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:

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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

--
You received this message because you are subscribed to the Google Groups "tlaplus" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tlaplus+unsubscribe@xxxxxxxxxxxxxxxx.
To view this discussion visit https://groups.google.com/d/msgid/tlaplus/CAAhV83fyWF4Xtmr1J2fQQBoTY0jjXCZao%2BFVJK%3DaoatLLZTK2Q%40mail.gmail.com.