Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SANY incorrectly allows subexpression prefixes for labels with parameters #885

Open
ahelwer opened this issue Mar 6, 2024 · 0 comments
Open
Labels
bug error, glitch, fault, flaw, ... SANY Issues involving SANY's analysis Tools The command line tools - TLC, SANY, ...

Comments

@ahelwer
Copy link
Contributor

ahelwer commented Mar 6, 2024

Here is the input which SANY should fail on but instead accepts:

---- MODULE Test ----
op == \A x \in {} : A!B!lbl(x) :: x
====

The A!B! should be disallowed at the parser level. The semantic level doesn't catch this because it (reasonably) assumes nobody would ever add a subexpression prefix there. Here is the parser trace:

****** SANY2 Version 2.2 created 08 July 2020

Parsing file /home/ahelwer/src/tlaplus/java-tools/tlatools/org.lamport.tlatools/Test.tla
Beginning Module definition
Beginning Begin module
Ending Begin module
Beginning Extends
Ending Extends
Beginning Module body
Beginning Definition
Beginning Identifier LHS
Ending Identifier LHS
Beginning Expression
Beginning Quantified form
Beginning Quant Bound
Beginning Expression
Beginning ExtendableExpr
Beginning Some { } form
Ending Some { } form
Ending ExtendableExpr
Ending Expression
Ending Quant Bound
Beginning Expression
Beginning ExtendableExpr
Beginning Primitive expression
Beginning Bang Extension
Ending Bang Extension
Beginning Bang Extension
Beginning Optional Arguments
Beginning Expression
Beginning ExtendableExpr
Beginning Primitive expression
Ending Primitive expression
Ending ExtendableExpr
Ending Expression
Ending Optional Arguments
Ending Bang Extension
Ending Primitive expression
Beginning Expression
Beginning ExtendableExpr
Beginning Primitive expression
Ending Primitive expression
Ending ExtendableExpr
Ending Expression
Ending ExtendableExpr
Ending Expression
Ending Quantified form
Ending Expression
Ending Definition
Ending Module body
Ending Module definition
Semantic processing of module Test

SANY correctly rejects this behavior when the label does not take parameters; this fails:

---- MODULE Test ----
op == A!B!lbl :: TRUE
====

Bug discovered during the course of working on #882.

@lemmy lemmy added bug error, glitch, fault, flaw, ... Tools The command line tools - TLC, SANY, ... SANY Issues involving SANY's analysis labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug error, glitch, fault, flaw, ... SANY Issues involving SANY's analysis Tools The command line tools - TLC, SANY, ...
Development

No branches or pull requests

2 participants