Microsoft Research Community

Cardinality constraints

rated by 0 users
This post has 2 Replies | 2 Followers

Top 500 Contributor
Posts 3
kornevgen Posted: 09-17-2009 3:40 PM

Hi!

I try to use cardinality constraints but Z3 doesn't solve my constraints:

(benchmark test
:logic QF_BV

:extrafuns ((x BitVec[5]) (y1 Int) (y2 Int))

:assumption
(= y1 (ite (= (extract[2:0] x) bv1[3]) 1 0) )

:assumption
(= y2 (ite (= (extract[4:2] x) bv1[3]) 1 0) )

:assumption
(<= 2 (+ y1 y2))

)

And Z3 2.1 returns the following model:

x -> bv1[5]
y1 -> 1
y2 -> 0
sat

However these constraints must be UNSAT !  because it doesn't exist "x" such as x[4:2] == 1 and x[2:0] == 1.

How my constraints can be corrected ?

Top 25 Contributor
Posts 41

The Z3 release uses auto-configuration when reading SMT files. So when you specify :logic QF_BV, then the only decision procedure that is loaded is the one for bit-vectors. The arithmetic decision procedure is not enabled. Consequently, <= is treated as an uninterpreted function symbol.

You can do:  z3.exe AUTO_CONFIG=false <file.smt>

Or you can just comment out the line ":logic QF_BV" (then auto-configuration is also not used).

 

 

Top 500 Contributor
Posts 3

Thank you very much, Nikolaj !

Page 1 of 1 (3 items) | RSS
©2009 Microsoft Corporation. All rights reserved. Terms of Use | Trademarks | Privacy Statement | Feedback