Giter Club home page Giter Club logo

Comments (6)

Kukovec avatar Kukovec commented on July 19, 2024

Debug log: So far, I've discovered that

UNION { [d -> r] : d \in {{0}} }

finds a "counterexample",

Funs(part_dom, r) == UNION { [{0} -> r] }

triggers the rewriter error, but

Funs(part_dom, r) == [{0} -> r]

does not, even though they are all semantically equivalent. This is definitely some sort of bug. Investigating further.

from apalache.

Kukovec avatar Kukovec commented on July 19, 2024

Found the following (potentially related) issue:
When trying to evaluate

Inv == [{0} -> {1}] = UNION { [d -> {1}] : d \in {{0}} }

Apalache reports

...
PASS #13: BoundedChecker                                          I@16:12:47.639
State 0: Checking 1 state invariants                              I@16:12:48.574
<unknown>: checker error: Unexpected equality test over types FinFunSet[CellTFrom(Set(Int)), CellTFrom(Set(Int))] and CellTFrom(Set((Int -> Int))) E@16:12:48.608
at.forsyte.apalache.infra.AdaptedException: <unknown>: checker error: Unexpected equality test over types FinFunSet[CellTFrom(Set(Int)), CellTFrom(Set(Int))] and CellTFrom(Set((Int -> Int)))
	at at.forsyte.apalache.infra.passes.PassChainExecutor$.run(PassChainExecutor.scala:39)
        ...

See #1946, #1808, #1801

from apalache.

Kukovec avatar Kukovec commented on July 19, 2024

Rewriting the above as X = Y \iff \A x \in X: x \in Y /\ \A x \in Y: x \in X, we see that Apalache finds a violation of

Inv ==
    LET X == [{0} -> {1}]
        Y == UNION { [d -> {1}] : d \in {{0}} }
    IN 
        /\ \A f \in X: f \in Y
        /\ \A f \in Y: f \in X

Which is 100% inceorrect

from apalache.

Kukovec avatar Kukovec commented on July 19, 2024

Interestingly, Apalache agrees that Y \subseteq X, but not X \subseteq Y. Hypothesis: \A f \in Y is treated as the empty forall.

from apalache.

Kukovec avatar Kukovec commented on July 19, 2024

Got it down to a minimal problematic input:

---- MODULE test ----
EXTENDS Integers, Apalache

Inv == [x \in {0} |-> 1] \in UNION { [d -> {1}] : d \in {{0}} }
Init == TRUE
Next == TRUE
====

The fundamental issue, is that { [d -> {1}] : d \in {{0}} } creates symbolic function sets (Which Apalache does not handle, unless they're being selected from, or quantified over). These sets' contents are unconstrained cells.

Inv ==  \A S \in { [d -> {1}] : d \in {{0}} }: \A f \in S: f[0] = 1

does not trigger the incorrect violation, so it's likely that UNION is a key contributor to this bug.

from apalache.

Kukovec avatar Kukovec commented on July 19, 2024

Note that #2778 closes this issue, but the original input should still fail with an error instead of producing bogus CEs.

from apalache.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.