Skip to content

pstack statechart: a rule "holds" when the action that could break it can never fire, and the report drops TLC's warning #1235

Open

Description

@Tarekkharsa

Summary

statechart lists a rule under "Rules that hold" when the only action that could break it is disabled in every state. TLC prints a warning for the commonest cause (an action sets a variable and also lists it as UNCHANGED), and tlc.out keeps it, but report.md and the chart say nothing. The reader gets a clean pass on a model that cannot fail.

Checked on pstack 0.15.36 at main (3dbd22f), Node 26.13, TLC 2.19.

Repro

Vac.tla:

---- MODULE Vac ----
EXTENDS Naturals
VARIABLES sent, paid

Init == sent = 0 /\ paid = FALSE

YouPressPay == sent < 2 /\ sent' = sent + 1 /\ UNCHANGED paid

BankAccepts == sent > 0 /\ paid' = TRUE /\ UNCHANGED <<sent, paid>>

Done == sent = 2 /\ UNCHANGED <<sent, paid>>

Next == YouPressPay \/ BankAccepts \/ Done

Spec == Init /\ [][Next]_<<sent, paid>>

NeverPaidTwice == ~(paid /\ sent > 1)
====

Vac.cfg:

SPECIFICATION Spec
INVARIANT NeverPaidTwice
scripts/statechart Vac.tla --config Vac.cfg --out out

Actual

report.md:

TLC reached 3 states and 3 steps. The chart draws 3 states and 2 arrows.
The chart does not draw 1 steps that stay in one chart state.

## Rules that hold
NeverPaidTwice, NoDeadlock

chart.mmd has no BankAccepts arrow. tlc.out has the only sign:

Warning: The variable paid was changed while it is specified as UNCHANGED at
line 9, col 62 to line 9, col 65 of module Vac

NeverPaidTwice holds only because paid can never become true. With the typo fixed (UNCHANGED sent), the rule breaks.

Expected

The report says that the pass is empty. Two levels, the first is enough for this case:

  1. Carry TLC's warnings into report.md, above "Rules that hold".
  2. List each action of Next that made no step, for example "Actions that never happened: BankAccepts". This also covers a guard that is never true and a constant that disables a branch, where TLC prints no warning.

The second must be a line in the report, not a failure: a config can disable an action on purpose, and under the 100,000-state bound "not seen" is not "never".

Why it matters

create-formal-verification-skill asks for a check that is "able to fail". A missing arrow in a chart of 20 is not something a reader notices, so this is the one place where the tool can show what the reader cannot.

I hit this in real use on the first day of a model: an action that both set and kept a variable, and every rule passed. I can send a patch with a test for either level.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions