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

[BUG] Incorrect parsing on global module and INSTANCE name collision #143

Closed
Kukovec opened this issue May 3, 2020 · 2 comments
Closed
Assignees
Labels
Milestone

Comments

@Kukovec
Copy link
Collaborator

Kukovec commented May 3, 2020

Describe the bug
The spec Paxos.tla defines both a nullary operator votes and an instance V of Voting (defined in Voting.tla).
The spec Voting.tla uses a VARIABLE votes and an operator

Spec == Init /\ [][Next]_<<votes, maxBal>>

In the pass immediately after parsing, the internal representation of V!Spec is read as

V!Init() ∧ []([V!Next()]_(<<votes(), maxBal>>))

where votes() is an operator application (to the locally defined nullary votes) instead of a variable.

To Reproduce
Steps to reproduce the behavior:

Expected behavior
What did you expect to see?
V!Spec as

V!Init() ∧ []([V!Next()]_(<<V!votes, V!maxBal>>))

or similar.

@Kukovec Kukovec added the bug label May 3, 2020
@konnov konnov added this to the v0.8-dev-multicore milestone Jun 26, 2020
@konnov
Copy link
Collaborator

konnov commented Jun 26, 2020

This is a rare bug, postponing for the next milestone

@konnov konnov modified the milestones: v0.8.0-dev-multicore, v0.12.0-user-care Sep 23, 2020
@konnov
Copy link
Collaborator

konnov commented Oct 14, 2020

The issue boils down to the following example:

------------------- MODULE P ----------------------                             
------------------- MODULE Vot ----------------------
------------------- MODULE Cons -------------------
VARIABLE chosen
Init == chosen = {}
Next == chosen = {2}
===================================================
chosen == {1}
C == INSTANCE Cons
===================================================
V == INSTANCE Vot
===================================================

SanyImporter fails to resolve chosen in the module Cons, as it is pointing to the operator V!Chosen. We should fix the code that performs substitution.

@konnov konnov closed this as completed Oct 28, 2020
konnov added a commit that referenced this issue Oct 29, 2020
)

fix #143: proper translation of chained substitutions in INSTANCE
@konnov konnov modified the milestones: v0.12.0-user-care, backlog2020 Dec 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants