Run SANY before invoking TLAPS proof commands#527
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Restores the Toolbox-style invariant that TLAPS proof checking only runs after the current module has been successfully accepted by SANY, preventing “successful” proofs on syntactically/semantically invalid TLA+ modules.
Changes:
- Adds a SANY parse-and-diagnostics gate before forwarding
tlaplus.tlaps.check-steprequests to the TLAPS LSP command. - Saves dirty buffers before running SANY/TLAPS to ensure both tools see identical content.
- Threads the shared
DiagnosticCollectionintoTlapsClientto publish SANY diagnostics to the Problems view.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/tlaps.ts | Adds SANY pre-check logic for proof-step checking and publishes SANY diagnostics before invoking TLAPS. |
| src/main.ts | Passes the shared diagnostic collection into TlapsClient. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
TLAPS accepts "raw TLA" (rTLA) that SANY rejects: formulas that are not insensitive to stuttering, permitting unrestrictive assertions about behaviors that should be unassertable in TLA+. Without a SANY check, a user can obtain a passing TLAPS result for a module that is not valid TLA+. Parse the saved module with SANY first (reusing tlaplus.parse) and abort the proof check, surfacing diagnostics, when SANY reports errors. Closes Github issue tlaplus#526 tlaplus#526 [Feature][TLAPS] Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #526.
TLAPS and SANY do not accept exactly the same language: TLAPS accepts some specifications that SANY (the standard TLA+ front end) correctly rejects (e.g. modules containing raw TLA syntax). Because the extension's SANY and TLAPS commands can be invoked independently, a user could obtain a successful TLAPS result for a module that SANY rejects, i.e. that is not a valid TLA+ module. The TLA+ Toolbox historically prevented this by requiring a successful SANY parse before enabling/invoking the prover.
This PR restores that invariant for the
tlaplus.tlaps.check-stepcommand (the only entry point that invokes TLAPS). Before forwarding the proof check to the TLAPS LSP server, the extension now:parseSpec(the implementation behindtlaplus.parse).tlaplusdiagnostic collection (Problems view).