Questions tagged [z3]

Z3 is a high-performance theorem prover being developed at Microsoft Research.

Z3 is a high-performance theorem prover being developed at Microsoft Research. Z3 supports linear real and integer arithmetic, fixed-size bit-vectors, extensional arrays, uninterpreted functions, and quantifiers.

Some key features of Z3 are:

  • High-performance theorem prover
  • Integrating efficient constraint solving technologies
  • Checking satisfiability of logical formulas with quantifiers
  • Highly customizable with an extensive API
  • Including support for custom theories

For more information about Z3, visit the Z3 homepage or try Z3 in your browser.

See also Z3 tutorial guide for more in-depth introduction about Z3.

2824 questions
7
votes
1 answer

How to get a list of all available configuration settings for a Z3 context?

The .net API has the following constructor for a Context: Context (Dictionary< string, string > settings) how to get a list of all the possible settings? Specifically, I am interested in how to ask Z3 to produce an unsat core, ie the equivalent of…
Motorhead
  • 928
  • 6
  • 16
7
votes
1 answer

Z3: convert Z3py expression to SMT-LIB2?

Given an expression in Z3py, can I convert that to SMT-LIB2 language? (So I can feed this SMT-LIB2 expression to other SMT solvers that support SMT-LIB2) If this is possible, please give one example. Thanks a lot.
user311703
  • 1,113
  • 2
  • 14
  • 25
7
votes
1 answer

equivalence checking with Z3

i am still new with Z3, and have a question: is it possible to use Z3 to do equivalence checking? if that is possible, could you give me one example of checking 2 formulas for equivalence? thanks.
user311703
  • 1,113
  • 2
  • 14
  • 25
7
votes
1 answer

Z3 Polarity using Z3 as SAT Solver

I am trying to solve a SAT problem with 12000+ boolean variables using Z3. I expect that most of the variables will evaluate to false in the solution. Is there a way to guide or hint Z3 as SAT solver to try "polarity false" first? I've tried it with…
Axel Kemper
  • 10,544
  • 2
  • 31
  • 54
7
votes
1 answer

Z3 quantifier support

I need a theorem prover for some simple linear arithmetic problems. However, I can't get Z3 to work even on simple problems. I'm aware that it is incomplete, however it should be able to handle this simple example: (assert (forall ((t Int)) (= t…
ThorstenT
  • 438
  • 4
  • 6
7
votes
1 answer

printing internal solver formulas in z3

The theorem proving tool z3 is taking a lot of time to solve a formula, which I believe it should be able to handle easily. To understand this better and possibly optimize my input to z3, I wanted to see the internal constraints that z3 generates as…
user1779685
  • 283
  • 2
  • 8
7
votes
2 answers

Z3 and DIMACS output

Z3 currently supports the DIMACS format for input. Is there any way to output the DIMACS format for the problem before solution? I mean converting the problem to a system CNFs and output it in a DIMACS format. If not, any ideas towards this…
absinthe_minded
  • 171
  • 1
  • 3
7
votes
1 answer

Quantifiers and patterns (QBF formula)

I'm trying to encode a QBF in smt-lib 2 syntax for z3. Running z3 results in a warning WARNING: failed to find a pattern for quantifier (quantifier id: k!14) and the satisfiability result is "unknown". The code is as follows: (declare-fun R (Bool…
Matthias Schlaipfer
  • 510
  • 1
  • 3
  • 15
6
votes
1 answer

C API for Quantifiers

I want to solve constraints that contain quantifiers using Z3 C API. I am struggling to use the functions like "Z3_mk_exists()" as I don't find any example either online or in the test examples in the tar file. I don't exactly understand all the…
Kaustubh Nimkar
  • 159
  • 1
  • 6
6
votes
1 answer

Getting a "good" unsat-core with z3 (logic QF_BV)

I am using the Z3 SMT solver to solve a problem that I have expressed in the logic QF_BV, using the SMTLIB 2 language. The model is unsatisfiable, and I am trying to get the solver to produce an unsat-core. My model consists of several 'mandatory'…
dhrumeel
  • 574
  • 1
  • 6
  • 15
6
votes
1 answer

SMTLIB array theory oddity in Z3

While using SMTLIB arrays, I noticed a difference between Z3's understanding of the theory and mine. I am using the SMTLIB array theory [0] which can be found on the official website [1]. I think my problem is best illustrated with a simple…
leonh
  • 826
  • 5
  • 6
6
votes
1 answer

Counterexample output of Z3

When a formula in Z3 is unsat and (get-proof) is specified there is an output which I don't find any information about what it is. Where can I find any documentation about that? Seems to me quite unreadable, is there possibly any tool that takes…
MattKay
  • 115
  • 6
6
votes
1 answer

Soft/Hard constraints in Z3

How do I express soft and hard constraints in Z3? I know from the API that it is possible to have assumptions (soft constraints), but I can't express this when using the command line tool. I am calling it using z3 /smt2 /si
leco
  • 1,989
  • 16
  • 30
6
votes
5 answers

Z3 solver installed but I can't import anything

I've installed z3-solver package from PyPi in my Python3 environment using Anaconda Prompt ( pip install z3-solver ) and that's it. The package appears in the site-packages/ directory ( the package has _init__.py and all essential files including…
CPS_001
  • 71
  • 1
  • 4
6
votes
2 answers

Parallel solving in Z3

One of the new features in Z3 4.8.1 is parallel solving: A parallel mode is available for select theories, including QF_BV. By setting parallel.enable=true Z3 will spawn a number of worker threads proportional to the number of available CPU…
user1618465
  • 1,813
  • 2
  • 32
  • 58