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

SBV error from unint_z3 when showing counterexamples #569

Open
brianhuffman opened this issue Oct 18, 2019 · 4 comments
Open

SBV error from unint_z3 when showing counterexamples #569

brianhuffman opened this issue Oct 18, 2019 · 4 comments
Labels
needs test Issues for which we should add a regression test subproject Issues involving one of the various subprojects SAW depends on type: bug Issues reporting bugs or unexpected/unwanted behavior
Milestone

Comments

@brianhuffman
Copy link
Contributor

When you run the following saw-script:

let {{
  foo : [8] -> [8]
  foo x = x
}};

prove_print (unint_z3 ["foo"]) {{ \x -> foo x == x }};

you get the following error message from SBV:

*** Data.SBV: Unexpected response from the solver, context: get-value:
***
***    Sent      : (get-value (|foo#48|))
***    Expected  : a function value
***    Received  : (error "line 17 column 12: invalid function application, missing arguments foo#48")
***
***    Executable: z3
***    Options   : -nw -in -smt2
***
***    Reason    : Solver returned an error: "line 17 column 12: invalid function application, missing arguments foo#48"

I'm not sure whether this is a bug in SAW, or in the SBV library.

@atomb
Copy link
Contributor

atomb commented Oct 18, 2019

I think this is missing functionality in SBV. From what I understand, there's not a solid standard for how solvers should return models of uninterpreted functions, so every solver does it differently and in an undocumented (although generally straightforward) way.

Interestingly, using w4_unint_z3 instead yields a straightforward counterexample x = 0, but it just leaves out the model for foo.

@brianhuffman
Copy link
Contributor Author

So can we work around this from our end? Can we avoid asking SBV about models for uninterpreted function symbols?

@weaversa
Copy link
Contributor

weaversa commented May 1, 2020

The error message from SBV is now slightly different.

sawscript> let {{ foo x = x : [8] }}
sawscript> prove_print (unint_z3 ["foo"]) {{ \x -> foo x == x }};
saw: 
*** Data.SBV: Unexpected response from the solver, context: get-value:
***
***    Sent      : (get-value (|foo#50|))
***    Expected  : a function value
***    Received  : ((|foo#50| ((as const Array) #x00)))
***
***    Executable: z3
***    Options   : -nw -in -smt2

@brianhuffman
Copy link
Contributor Author

See also GaloisInc/what4#39

@robdockins robdockins self-assigned this Jul 30, 2021
@robdockins robdockins removed their assignment Sep 10, 2021
@sauclovian-g sauclovian-g added subproject Issues involving one of the various subprojects SAW depends on type: bug Issues reporting bugs or unexpected/unwanted behavior needs test Issues for which we should add a regression test and removed upstream labels Oct 24, 2024
@sauclovian-g sauclovian-g modified the milestones: 2024T3, 2025T1 Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs test Issues for which we should add a regression test subproject Issues involving one of the various subprojects SAW depends on type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
Development

No branches or pull requests

5 participants