Using iZ3 for bit vector operations - z3

I was trying to use iz3 for extracting interpolants. It seems to work fine for examples given in the documentation page. I tried to run iz3 for a example which Z3 conformed as UNSAT. But when i used iZ3 the following error popped up
iZ3: unsupported Z3 operator in expression
(bvule bv100[101] main.a'64'0)
iZ3: unsupported Z3 operator in expression
(bvadd main.a'64'0 main.b'64'0)
Segmentation fault
Does iZ3 support only theories of AUFLIA and not QF_AUFBV ?
Is there a way I can get interpolants for QF_AUFBV which supports bit_vector operation as above?
I used iZ3 which was in z3 4.1 version
Thanks in advance

Maybe interpol (http://ultimate.informatik.uni-freiburg.de/smtinterpol/docu.html) and mathsat (http://mathsat.fbk.eu/) could be useful.

Sorry, iZ3 supports only AUFLIA.

Related

What is the c++ file and method where the DPLL algorithm backtraces up the tree?

I'm trying to find the c++ file for Z3 where the algorithm backtraces if it can't find a solution on the current branch. I've been looking through all the files and tried debug mode on the python files, but no luck so far. I just want to add a print statement to the method, so I can tell when it is returning to a previous node and trying a new path.
Thanks!
It depends on which solver Z3 uses for your problem. It typically uses smt_context.cpp in src/smt. The relevant backjump can be traced in the context::pop_scope method. Other solvers exist too: the src/sat/sat_solver is used for bit-vector and Boolean problems. It has a similar pop method. Finally, nlsat is used for non-linear polynomial arithmetic over the reals.

Dose SMTLIB 1.2 has a (get-value) function like like SMTLIB 2

I wonder if SMTLIB1.2 has an equivalent to the SMTLIB2's (get-value).
I'm running different SMT encoding tests using Z3 SMT solver and SMTLIB1.2, the problem is in the output I keep getting all values the model mixed with 100s of auxiliary variable values.
Thanks
Sorry, there is no get-value for SMTLIB 1.2.
SMTLIB 1.2 is deprecated and you can do everything possible
with SMTLIB 1.2 with 2.0 format instead, so there should be no
real reason to use v1.2 of the syntax.

z3 SMT solver: unknown result after running QF_BVRE benchmark

I just downloaded the benchmarks for seq and regexp sorts (using z3-4.3.2). What could be the problem when I get unknown as result after running "membership_1.smt2"?
I did not specify any further command line options. According to the benchmark it should result in sat, but unknown is printed without any model.
Thank you
edit:
I noticed further, that "re-begin" is not recognized. Has this to do with the version of z3 or did u just forgot a command line option?
Firstly, I don't know where the OP or commenter found the "membership_1.smt2" example input. I checked the SMT-LIB benchmarks, and the source of Z3, S3, and Z3-str, and couldn't find it.
In any case, the problem was that the OP was testing a benchmark written either for S3 or Z3-str and running it against an unmodified version of Z3. S3 and Z3-str require a modified version of Z3 to handle these extensions. This is described on the S3 website [S3: A Symbolic String Solver for Web Security Analysis, http://www.comp.nus.edu.sg/~trinhmt/S3/, accessed Aug. 4, 2016]:
Modified Version of Z3 Solver
The source code of the modified Z3 is available here.
We modify Z3 to have the interaction between String theory and Arithmetic theory.
These newly-added API methods allows us to query the length of a string variable, and relationship between the length of different
string variables, as shown in our CCS'14 paper.
Our modified version of Z3 is also used by Z3-str GROUP for integer/string theory integration.
Grepping the (unmodified) Z3 source shows no matches for "re-begin" or "re-concat". Grepping the modified version shows that these tokes are defined in lib/seq_decl_plugin.cpp of z3-source-060115.zip.

HORN Clause Z3 Documentation

I am trying to encode some imperative program using HORN logic of Z3 (set-logic HORN) but getting some difficulties of defining clause (using SMT2). Could anyone tell me where can I find a good source of documentations for this feature of Z3?
Well, there's more to it when it comes to "encoding" a program in horn clauses.
First you need to check an appropriate proof rule: does the program has recursive functions, should you do function summarization? and so on.
There are a few papers on the subject, but I don't think there's any tutorial on VC gen.
You may also want to take a look to some benchmarks in Horn SMT format to draw inspiration: https://svn.sosy-lab.org/software/sv-benchmarks/trunk/clauses/
Feel free to ask if you have a specific question.

Why does Z3 report different query statuses at web-page and locally (unsat/sat respectively)?

http://rise4fun.com/Z3/MlnZ
The correct result should be UNSAT (online version), but locally Z3 3.2 reports SAT. It also produces an interesting model, which contains a universe and cardinality constraints for enumeration types (datatypes). Ideas? Thanks!
Wait is over. 4.0 has been released.
This is a bug. Z3 3.2 does not install the recursive datatype engine for your script.
So, the sorts Q and T are treated as unintepreted sorts.
Z3 4.0 fixes this bug. The online version is already running Z3 4.0. That is why you got the correct result with the online version.
You can use the following workaround in Z3 3.2.
(set-option :auto-config false)

Resources