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

Apalache seems to cache Gen expressions #2973

Open
Kukovec opened this issue Aug 28, 2024 · 0 comments
Open

Apalache seems to cache Gen expressions #2973

Kukovec opened this issue Aug 28, 2024 · 0 comments
Assignees
Labels

Comments

@Kukovec
Copy link
Collaborator

Kukovec commented Aug 28, 2024

When encountering two syntactically-equal and type-equal Gen-initializations, apalache appears to cache the RHS, making it impossible to generate different values for two variables initializaed this way. For the attached module, apalache-mc check --length=0 results in a deadlock with --init=InitDeadlock, and no error with --init=InitNoDeadlock, even though the two Init- operators should behave exactly the same. The same bug occurs even if the types of a and b are more complex, e.g. Set({x: Int}).

----------------------------- MODULE module -----------------------------
EXTENDS Apalache, Integers

VARIABLES 
    \* @type: Int;
    a,
    \* @type: Int;
    b

InitDeadlock == 
    /\ a = Gen(1)
    /\ b = Gen(1)
    /\ a /= b

InitNoDeadlock == 
    /\ a = Gen(1)
    /\ b = Gen(2)
    /\ a /= b

Next == UNCHANGED <<a,b>>
=============================================================================
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