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] Unsound skolemization #985

Closed
konnov opened this issue Sep 14, 2021 · 1 comment · Fixed by #989
Closed

[BUG] Unsound skolemization #985

konnov opened this issue Sep 14, 2021 · 1 comment · Fixed by #989
Assignees
Labels
bug Fprepro Feature: TLA+ preprocessor

Comments

@konnov
Copy link
Collaborator

konnov commented Sep 14, 2021

A piece of spec that triggers an error. An MWE follows later:

  LET fail ==
     \/ ~IsValidCtrSpec(cspec) 
     \/ \E cs \in contractSpecs: cs.id = cspec.id
  IN
  /\ tx_fail' = (tx_fail \/ fail)

We should not skolemize cs in fail, but we do.

@konnov konnov added the bug label Sep 14, 2021
@konnov konnov added this to the September iteration milestone Sep 14, 2021
@konnov konnov self-assigned this Sep 14, 2021
@konnov
Copy link
Collaborator Author

konnov commented Sep 16, 2021

An MWE:

-------------------------------- MODULE Bug985 --------------------------------
\* This is a regression test
\* for unsound Skolemization of expressions under LET-IN:
\*
\* https://github.com/informalsystems/apalache/issues/985
VARIABLES
    \* @type: Set(Int);
    S,
    \* @type: Bool;
    tx_fail

Init ==
    /\ S = { 1, 2 }
    /\ tx_fail = TRUE

Next ==
    LET fail ==
        \* This should be true since S = { 1, 2 }.
        \* However, if we Skolemize x and then negate fail,
        \* the solver is free to use 1 as a value.
        \E x \in S:
            x /= 1
    IN
    /\ tx_fail' = fail
    /\ UNCHANGED S

\* This invariant should hold true. However, it fails in #985.
Inv ==
    tx_fail
===============================================================================

@konnov konnov added FSMT Feature: Improvements in the SMT encoding Fprepro Feature: TLA+ preprocessor customer fast track and removed FSMT Feature: Improvements in the SMT encoding labels Sep 16, 2021
konnov added a commit that referenced this issue Sep 16, 2021
closes #985: do not skolemize let-definitions that are used as values
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fprepro Feature: TLA+ preprocessor
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant