Skip to content

EWD840 and EWD998 proofs rely on tlapm soundness bug - #250

Merged
lemmy merged 5 commits into
masterfrom
mku-gh69
Oct 30, 2026
Merged

lemmy merged 5 commits into
masterfrom
mku-gh69

Conversation

@lemmy

@lemmy lemmy commented Oct 29, 2026

Copy link
Copy Markdown
Member

tlapm distributes instantiation over WF and SF, which is unsound (tlaplus/tlapm#69). Once fixed (tlaplus/tlapm#321), EWD840_proof.tla fails (https://github.com/tlaplus/tlapm/actions/runs/40806417736/job/123226446658?pr=321) for two independent reasons. Each commit fixes one of them:

  1. EWD840: extend TLAPS to work around a tlapm bug. tlapm rewrites ENABLED into EnabledWrapper from the TLAPS module when it instantiates a module. ExpandENABLED fails if the module with the INSTANCE doesn't extend TLAPS (compare TLAPM fails when instantiating a module containing ENABLEDaxioms (Error: Operator "EnabledWrapper" not found) tlapm#250). Once TLAPM identifies instantiated fairness condition with fairness of instantiated action tlapm#69 is fixed, every instantiated WF contains ENABLED, so TD == INSTANCE SyncTerminationDetection triggers the bug. This can be reverted once TLAPM fails when instantiating a module containing ENABLEDaxioms (Error: Operator "EnabledWrapper" not found) tlapm#250 has been addressed.
  2. EWD840_proof: do not rely on instantiation distributing over WF. The proof of Spec => TD!Spec relied on WF_TD!vars(TD!DetectTermination) matching the fairness conjunct of TD!Spec. The proof now refers to the instantiated ENABLED through the new operator SyncTerminationDetection!EnabledDT.

@lemmy lemmy self-assigned this Oct 29, 2026
@lemmy lemmy added the bug label Oct 29, 2026
@lemmy
lemmy requested a review from muenchnerkindl October 29, 2026 18:33

@muenchnerkindl muenchnerkindl left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks! I would probably have tried to structure the proof a little differently, see suggestions in the comments.

Comment thread specifications/ewd840/EWD840_proof.tla Resolved
@muenchnerkindl

Copy link
Copy Markdown
Collaborator

P.S.: It seems to me that the same issue affects EWD998?

@lemmy lemmy changed the title EWD840 proof relys on tlapm soundness bug EWD840 and EWD998 proofs rely on tlapm soundness bug Oct 30, 2026
lemmy and others added 2 commits October 30, 2026 09:48
Apalache looks up modules only in the directory of the spec, in its own
standard library, and in its working directory. It ignores TLA-Library,
and the classpath that lets TLC find TLAPS.tla does not reach it. A spec
that extends TLAPS, or instantiates a module that does, therefore fails
to parse with "Cannot find source file for module TLAPS". Running
Apalache from the TLAPS library directory lets it find the module. All
paths passed to Apalache are now absolute, and --out-dir keeps its
output in _apalache-out at the root of the repository.

https://github.com/tlaplus/Examples/actions/runs/41087129395/job/124171232756

Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Markus Alexander Kuppe <[email protected]>
tlapm rewrites ENABLED into EnabledWrapper from the TLAPS module when it
instantiates a module. If the module with the INSTANCE does not extend
TLAPS, ExpandENABLED fails with "Operator EnabledWrapper not found".
With tlapm#321, every instantiated WF contains ENABLED, so EWD840_proof
hits this bug through TD == INSTANCE SyncTerminationDetection.

tlaplus/tlapm#250
tlaplus/tlapm#321

Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Markus Alexander Kuppe <[email protected]>
lemmy and others added 3 commits October 30, 2026 10:35
Instantiation does not distribute over ENABLED, and hence not over WF.
The proof of Spec => TD!Spec relied on WF_TD!vars(TD!DetectTermination)
matching the fairness conjunct of TD!Spec, which tlapm#321 no longer
allows. SyncTerminationDetection now names its fairness condition Fair,
and the proof derives TD!Fair from the new lemma
SyncTerminationDetection_proof!Fairness.

Apalache accepts only fairness written out in Spec, so
APSyncTerminationDetection.cfg now names Init and Next instead.

tlaplus/tlapm#69
tlaplus/tlapm#321

Co-authored-by: Stephan Merz <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Markus Alexander Kuppe <[email protected]>
tlapm rewrites ENABLED into EnabledWrapper from the TLAPS module when it
instantiates a module. If the module with the INSTANCE does not extend
TLAPS, ExpandENABLED fails with "Operator EnabledWrapper not found".
With tlapm#321, every instantiated WF contains ENABLED, so EWD998_proof
hits this bug through TD == INSTANCE AsyncTerminationDetection.

tlaplus/tlapm#250
tlaplus/tlapm#321

Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Markus Alexander Kuppe <[email protected]>
Instantiation does not distribute over ENABLED, and hence not over WF.
The proof of Spec => TD!Spec relied on WF_TD!vars(TD!DetectTermination)
matching the fairness conjunct of TD!Spec, which tlapm#321 no longer
allows. AsyncTerminationDetection now names its fairness condition Fair,
and the proof derives TD!Fair from the new lemma
AsyncTerminationDetection_proof!Fairness.

tlaplus/tlapm#69
tlaplus/tlapm#321

Co-authored-by: Stephan Merz <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
Signed-off-by: Markus Alexander Kuppe <[email protected]>
@lemmy
lemmy merged commit 0e32a03 into master Oct 30, 2026
7 of 9 checks passed
@lemmy

lemmy commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Merging, as the remaining failing checks are unrelated to this change.

@lemmy
lemmy deleted the mku-gh69 branch October 30, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants