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

Problem with functions sets that have function sets as their range in the arrays encoding #1774

Closed
rodrigo7491 opened this issue May 17, 2022 · 4 comments · Fixed by #1775
Closed
Assignees
Labels
bug Farrays Feature: New SMT encoding with arrays

Comments

@rodrigo7491
Copy link
Collaborator

Description

Another bug discovered via #1588. Like #1748 it occurs in both SMT encodings, and seems to be related to cherry picking function sets. It differs in that it exposes the fact that the arrays encoding does not handle function sets whose range is itself a function set. This issue is to track this particular problem.

Input specification

------ MODULE Oracle --------
VARIABLES
  \* @type: Set((Seq(Bool) -> (Int -> Int)));
  witness,
  \* @type: Bool;
  found

Init ==
  /\ witness \in {[{<<TRUE>>} -> [{1} -> {2}]], [{<<TRUE>>} -> [{3} -> {4}]]}
  /\ found \in BOOLEAN

Next ==
  UNCHANGED <<witness, found>>

NotFound ==
  ~found
======================

The command line parameters used to run the tool

apalache-mc check --smt-encoding=oopsla19 --debug Oracle.tla
apalache-mc check --smt-encoding=arrays --debug Oracle.tla

Additional context

For the oopsla19 encoding we have:

at.forsyte.apalache.tla.bmcmt.RewriterException: Do not know how pick an element from a set of type: FinFunSet[CellTFrom(Set(Seq(Bool))), FinFunSet[CellTFrom(Set(Int)), CellTFrom(Set(Int))]]

For the arrays encoding we have:

com.microsoft.z3.Z3Exception: domain sort Cell_F%SQ_b_%F%Si_%Si and parameter sort (Array (Array Cell_Q_b (Array Int Int)) Bool) do not match
@konnov
Copy link
Collaborator

konnov commented May 18, 2022

So it is picking out of a set of two function sets that map tuples to functions of functions? @thpani, Nitpicker is exploding my brain 🤣

@thpani
Copy link
Collaborator

thpani commented May 18, 2022

Yikes! 😂
I hope this gets a bit better when we merge the shrinker in #1683

@konnov
Copy link
Collaborator

konnov commented May 18, 2022

It is a totally legal TLA+ expression. As every automatic tool, Nitpicker does not have any notion of common sense and thus it is not avoiding scary expressions. This is good!

@thpani
Copy link
Collaborator

thpani commented May 18, 2022

Sure, I just meant we can probably produce smaller expressions that are easier to parse by humans 😉

@Kukovec Kukovec mentioned this issue Apr 25, 2023
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Farrays Feature: New SMT encoding with arrays
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants