Z3 Theorem Prover log file documentation? - z3

As of recent, I am working with Axiom Profiler, which parses Z3 log files for information.
But the program has encountered problems when parsing lines that don't start with a header (a square bracket).
These lines occur after an [assign] line in the log file.
[assign] (not #6339) clause (not p3) p2
(not (= z3.sk.3 -26::Int))
(= z3.sk.3 -39::Int)
Unfortunatly I did not find any documentation of this.
Is this a new change to Z3's log file? and where can I find the documentation to what this entails?
The log file I used is generated by using:
z3 trace=true proof=true trace-file-name=foo.log ./input.smt2
Any help is appreicated.
Thanks in advance.

Related

How to make z3 generate proof of unsatisfiability?

I am trying to use z3 from the command line as a SAT solver, but I can't figure out how to make it generate a proof of unsatisfiability. No matter what I do, it just prints "unsat" with no explanation, and nothing I can find online has helped. I tried passing proof=true on the command line, but nothing changed.
../z3-4.8.6-x64-ubuntu-16.04/bin/z3 proof=true unsat_core=true test_tx.cnf
unsat
z3 can generate proofs in SMTLib mode (though the proof format is rather unspecified.) I'm not sure if it can even generate proofs in the CNF mode at all, though it certainly should be possible. Your best bet might be to file an issue at https://github.com/Z3Prover/z3/issues and see if this is supported.

Z3 infinite loop from KLEE

I have a modified version of KLEE and an essentially simple query
like
(assert (= 173 (str.len "OREN"))) (meant to be false).
When I invoke the Z3 solver I get stuck in an infinite loop
(haven't waited forever though :]) inside the following while statement in
z3/src/ast/rewriter/rewriter_def.h:
while (!frame_stack().empty())
I've posted it as a potential bug in GitHub/Z3Prover/z3/issues
but I'm not at all sure it is indeed a bug. Any help is very much appreciated, thanks!
From the answer in GitHub/Z3Prover/z3/issues:
KLEE uses the C API but uses wrapper classes to correctly do reference counting.
However what I did back at the time was:
called the Z3 C API without using KLEE's wrapper class: Z3ASTHandle
That made things go (very) wrong ...

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.

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.

Can z3 read the outputfile of MathSAT as its inputfile?

I need to conduct some experiments using z3 and mathsat. I have already finished the experiments with mathsat. It takes a lot of time to write the input file for mathsat and I don't want to write the input files for z3 again. Mathsat supports generating 'smt' files from the 'msat' files. The converting command is shown below:
/home/xdb/mathsat/mathsat-4.2.17-linux-x86_64/bin/mathsat -input=msat -output=smt -logic=QF_LRA /home/xdb/satcase/sample/sample.msat>>/home/xdb/satcase/sample/sample.smt
My question is that can z3 recognize this 'smt' file?
Z3 can read SMT 1.0 and 2.0 files. The format is defined at http://www.smtlib.org. If the formulas generated by MathSAT are compliant with the standard, then you should have no problems. Have you tried to use Z3 to read the generated files? If it didn't work, what was the error message produced by Z3?

Resources