tlaplus: Raise warning when definition or declaration appears as Record field name
The formula SeemsObvious is false for any value of C1, except for the one value "C1".
---- MODULE Foo ----
CONSTANTS C1
SomeSet == {C1}
SomeRecord ==
[
C1 |-> 1
]
SeemsObvious ==
DOMAIN SomeRecord = SomeSet
\* A more real-world scenario.
Next == \E v \in SomeSet: SomeRecord[v] = 1
\* TLAPS proves this theorem
THEOREM DOMAIN SomeRecord = {"C1"} BY DEF SomeRecord
====
This appears sufficiently counterintuitive to warrant a warning. ~Unfortunately, such a warning can only be raised during model checking in the general case.~ SANY could issue a warning when it sees the symbol of the CONSTANT C1 appear as a record field. Thoughts?
/cc @craft095
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 33 (29 by maintainers)
Commits related to this issue
- Raise warning when symbol appears in Records. Addresses Github issue #1184 https://github.com/tlaplus/tlaplus/issues/1184 [Feature][TLC] Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.d... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. Addresses Github issue #1184 https://github.com/tlaplus/tlaplus/issues/1184 [Feature][TLC] Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.d... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. Addresses Github issue #1184 https://github.com/tlaplus/tlaplus/issues/1184 [Feature][TLC] Signed-off-by: Markus Alexander Kuppe <github.com@lemmster.d... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. ``` The field name "SomeField" in the record constructor is identical to the existing definition or declaration named SomeField, located at line 5, col 1... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. ``` The field name "SomeField" in the record constructor is identical to the existing definition or declaration named SomeField, located at line 5, col 1... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. However, do NOT raise a warning in cases like the following, which imply that the user understands the semantics correctly: ```tla bar == 23 R == [bar |... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. However, do NOT raise a warning in cases like the following, which imply that the user understands the semantics correctly: ```tla bar == 23 R == [bar |... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. Corpus test to assert no warnings in the record constructor. Related to Git commit ae5945ec4f0c240b3ccbd1eb7bff277bacdde2db Follow-up of Github issue #... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. Corpus test to assert no warnings in the record constructor. Related to Git commit ae5945ec4f0c240b3ccbd1eb7bff277bacdde2db Follow-up of Github issue #... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. However, do NOT raise a warning in cases like the following, which imply that the user understands the semantics correctly: ```tla bar == 23 R == [bar |... — committed to tlaplus/tlaplus by lemmy 2 years ago
- Raise warning when symbol appears in Records. However, do NOT raise a warning in cases like the following, which imply that the user understands the semantics correctly: ```tla bar == 23 R == [bar |... — committed to tlaplus/tlaplus by lemmy 2 years ago
I can probably take on #1186 this month. SANY has needed an overhaul to its output system for a while.
“Breaks” was a little strong, more like it caused problems. Nontechnical people were suddenly worried that the specs were now flawed, and weren’t reassured that the warnings were coming from the Pluscal translation process.
It might be worthwhile to add an optional user-friendly warnings pass after level checking. We don’t really make much use of warnings in the parser but I’m sure there are a lot of things we could think of to add warnings for.