/tlaplus:tla-refinement-proofsfrom tlaplus
This skill provides guidance on specification refinement — proving that one TLA+ specification correctly implements another. It should be used when the user asks about "refinement", "specification refinement", "refine specification", "abstract and concrete specs", "implementation correctness", "prove implementation correct", "specification layers", "refinement mapping", "INSTANCE WITH", "TLAPS", "stuttering steps", "data refinement", or mentions proving one spec implements another.
Ships in tlaplus. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
This skill provides guidance on specification refinement - proving that one specification correctly implements another.
Refinement proves that a concrete (implementation) specification correctly implements an abstract (high-level) specification. Every behavior allowed by the concrete spec must correspond to a behavior allowed by the abstract spec.
Why Refine? Layered design, verified implementation, optimization verification, and interface compliance.
Safety Refinement: Concrete spec's behaviors are a subset of abstract spec's behaviors. Define a refinement mapping, then check with TLC.
Liveness Refinement: Concrete spec satisfies abstract spec's liveness properties. Requires safety refinement plus fairness conditions.
---- MODULE AbstractCounter ----
EXTENDS Naturals
VARIABLE count
Init == count = 0
Inc == count' = count + 1
Spec == Init /\ [][Inc]_count
====
---- MODULE ConcreteCounter ----
EXTENDS Naturals
VARIABLES x, y
Init == x = 0 /\ y = 0
IncX == x' = x + 1 /\ UNCHANGED y
IncY == y' = y + 1 /\ UNCHANGED x
Spec == Init /\ [][IncX \/ IncY]_<<x,y>>
====
In concrete spec, instantiate abstract with mapping:
A == INSTANCE AbstractCounter WITH count <- x + y
THEOREM Spec => A!Spec
SPECIFICATION Spec
PROPERTY A!Spec
/tla-check @QueueRefinement.tla
(Use the path to your refinement spec, e.g., @examples/QueueRefinement.tla)
If passes: concrete refines abstract. If fails: trace shows where refinement breaks.
---- MODULE Concrete ----
VARIABLES ...concrete vars...
ConcreteSpec == ConcreteInit /\ [][ConcreteNext]_vars
A == INSTANCE Abstract WITH abstractVar <- mappingExpression
THEOREM ConcreteSpec => A!Spec
====
references/refinement-patterns.md - Complete refinement mapping patterns (state mapping, history variables, stuttering steps, data/protocol/state machine refinement)references/checking-refinement.md - Verifying refinement with TLC, diagnosing failures, TLC vs TLAPS comparisonreferences/tlaps-guide.md - TLAPS proof system guide (advanced)See examples/ directory: AbstractQueue.tla, ConcreteQueue.tla, QueueRefinement.tla
tla-model-checking - Run TLC checkstla-getting-started - TLA+ basicstla-debug-violations - Debug counterexamples/tla-check - Verify refinement/tla-review - Review refinement structureexamples/AbstractQueue.tla (opens in a new tab)examples/ConcreteQueue.tla (opens in a new tab)examples/QueueRefinement.cfg (opens in a new tab)examples/QueueRefinement.tla (opens in a new tab)references/checking-refinement.md (opens in a new tab)references/refinement-patterns.md (opens in a new tab)references/tlaps-guide.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub photoszzt/tlaplus-ai-tools --plugin tlaplus12 skills in this plugin
/tla-checkThis skill runs exhaustive model checking to verify all reachable states of a TLA+ specification using TLC. It should be used when the user asks to "check my spec", "run TLC", "verify my TLA+ spec", "find invariant violations", "exhaustive model checking", "check for bugs in my spec", "model check", "exhaustive check", "verify all states", "run model checker", "verify invariants", "check properties", "check temporal properties", "check liveness", "full check", "check all states", "check safety", or "verify properties"./tla-create-animationsThis skill guides the creation of animations that visualize TLA+ specifications during model checking or trace exploration. It should be used when the user asks to "create animation", "animate my spec", "visualize state transitions", "show me what's happening", "TLA+ animation", "trace visualization", "see state changes", "render animation in terminal", "ASCII animation", "SVG animation", or "show animation in browser"./tla-debug-violationsThis skill provides a systematic workflow to isolate and diagnose TLA+ invariant or property violations. It should be used when the user mentions "invariant violated", "TLC found a bug", "counterexample", "property failed", "violation trace", "debugging TLA+ violations", "error trace", "why did TLC fail", "fix my spec", "TLC error", "trace analysis", "deadlock found", or "lasso-shaped counterexample".