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

Garbage SMT queries #248

Closed
catalin-hritcu opened this issue May 27, 2015 · 13 comments
Closed

Garbage SMT queries #248

catalin-hritcu opened this issue May 27, 2015 · 13 comments
Labels
Milestone

Comments

@catalin-hritcu
Copy link
Member

When looking with Simon at the output of Z3 on a file obtained with --logQueries on tinyfstar-new.fst, we first observed that there are a lot of model is not available errors. Maybe those are expected(?) so we filtered those out and then we found this:

(error "line 208792 column 14: unknown constant @x3")
(error "line 208889 column 14: unknown constant @x3")
(error "line 209035 column 0: unknown constant @x4")
(error "line 209180 column 0: unknown constant @x4")
unknown

The code in question looks like this:

;;;;;;;;;;;;;;;;Exp_abs_7904 typing
(assert (forall ((@x0 Term) (@x1 Term) (@x2 Term))
 (! (HasType (Exp_abs_7904 @x0
@x1
@x2)
(Typ_fun_7906 @x3
@x4
@x2
@x2))

(and something very similar for the other 3 errors)
The variables in question are really not bound. Is this reasonable? Is it normal to ignore SMT queries that return errors? I'm a bit worried about "garbage in, garbage out" behavior.

Just for the record, saving the invocation we used for calling z3 from the command line:

z3 -smt2 -t:10 AUTO_CONFIG=false MODEL=true SMT.RELEVANCY=2 queries-bg-2.smt2 | grep -v "model is not available"
@catalin-hritcu catalin-hritcu changed the title Garbage SMT queries? Garbage SMT queries Aug 24, 2015
@catalin-hritcu catalin-hritcu changed the title Garbage SMT queries Garbage SMT queries ... SMT errors should not be ignored! Dec 4, 2015
@nikswamy
Copy link
Collaborator

nikswamy commented May 23, 2016

Fyi, minimized a related example to the one below.

Repro with

$ fstar --universes --explicit_deps test.fst --log_queries
$ z3 queries-bg-0.smt2 | grep error | grep -v model
module Test
assume type grows : nat -> nat -> Type0
let reln (a:Type) = a -> a -> Type

assume type m_rref : a:Type -> reln a -> Type0
assume val m_contains : a:Type -> b:reln a -> r:m_rref a b -> GTot bool

let genPost (log:m_rref nat grows) h1 = 
    m_contains nat grows log

UPDATE: FIXED NOW

@vkanne-msft
Copy link
Contributor

We should hard fail on SMT errors.

@nikswamy
Copy link
Collaborator

strange. it was not my intention to close it. GitHub did it automatically ...

@msprotz
Copy link
Collaborator

msprotz commented Sep 24, 2016

"fix #N" and "fixes #N" in the commit message have the side-effect of closing the corresponding bug

@catalin-hritcu
Copy link
Member Author

right, and "tentative fix to #N" and "does not fix #N" do too ... github is not so good with semantic differences :)

@catalin-hritcu
Copy link
Member Author

Had a quick look at the 93 Z3 warnings this generates for the regression:

  • 44 are invalid pop command, argument is greater than the current stack depth
  • 32 are named expression already defined
  • 15 are invalid declaration, function/constant ... (with the given signature) already declared
  • 2 are Wrong number of arguments (2) passed to function (declare-fun Unification.nat_order () Term)

@nikswamy
Copy link
Collaborator

Yep. I'm aware of it. Thanks for logging

@nikswamy nikswamy reopened this Sep 25, 2016
@nikswamy
Copy link
Collaborator

Down to 1 warning from an encoding glitch in FStar.DM4F.ST

@catalin-hritcu
Copy link
Member Author

Just for the record, the remaining warning seems to be this one:

unknown(0,0-0,0) (Warning): FStar.DM4F.ST: Unexpected output from Z3: (error "line 36871 column 0: unknown constant @x4")

This looks like a similar problem to what I was getting with Simon when opening this bug. That's great progress.

@nikswamy nikswamy changed the title Garbage SMT queries ... SMT errors should not be ignored! SMT Encoding error in FStar.DM4F.ST Oct 6, 2016
@catalin-hritcu
Copy link
Member Author

catalin-hritcu commented Oct 18, 2016

@nikswamy: Could it be that this last problem was inadvertently fixed recently? I can no longer reproduce it. FStar.DM4F.ST no longer raises this warning and nothing in our whole test suite does. Can we call this fixed? :)

@nikswamy
Copy link
Collaborator

Yes. I fixed some scoping bugs in dmff.fs the other day

@catalin-hritcu catalin-hritcu changed the title SMT Encoding error in FStar.DM4F.ST Garbage SMT queries ... SMT errors should not be ignored! Nov 27, 2016
@catalin-hritcu catalin-hritcu changed the title Garbage SMT queries ... SMT errors should not be ignored! Garbage SMT queries Nov 27, 2016
@catalin-hritcu
Copy link
Member Author

This kind of error is back in FStar.SquashProperties:

[hritcu@detained ulib]$ fstar.exe FStar.SquashProperties.fst
unknown(0,0-0,0): (Warning) FStar.SquashProperties: Unexpected output from Z3: (error "line 43541 column 43: unknown constant @x8")

@catalin-hritcu
Copy link
Member Author

Closed in favor of #836, which has a simpler test case.

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

4 participants