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
8
votes
2 answers

Python -- Optimize system of inequalities

I am working on a program in Python in which a small part involves optimizing a system of equations / inequalities. Ideally, I would have wanted to do as can be done in Modelica, write out the equations and let the solver take care of it. The…
Gerome Pistre
  • 457
  • 6
  • 15
8
votes
2 answers

QF_FPA? Does Z3 support IEEE-754 arithmetic?

Browsing Z3 source code, I came across a bunch of files referring to QF_FPA, which seems to stand for quantifier-free, floating-point-arithmetic. However, I don't seem to be able to locate any documentation regarding its state, or how it can be used…
alias
  • 28,120
  • 2
  • 23
  • 40
8
votes
2 answers

What are the limits of reasoning in quantified arithmetic in SMT?

I have tried several SMT solvers (CVC3, CVC4 and Z3) on the following seemingly trivial benchmark: (set-logic LIA) (set-info :smt-lib-version 2.0) (assert (forall (( x Int)) (forall ((y Int)) (= y x)))) (check-sat) (exit) The solvers all return…
8
votes
3 answers

Minimum and maximum values of integer variable

Let's assume a very simple constraint: solve(x > 0 && x < 5). Can Z3 (or any other SMT solver, or any other automatic technique) compute the minimum and maximum values of (integer) variable x that satisfies the given constraints? In our case, the…
user1217406
  • 329
  • 3
  • 15
7
votes
1 answer

What is the reason behind the warning message in Z3: "failed to find a pattern for quantifier (quantifier id: k!18) "

I find an issue as shown in the following simple SMT-LIB program. The SMT-LIB code: (declare-fun isDigit (Int) Bool) (assert (forall ((x Int)) (=> (isDigit x) (and (>= x 0) (< x 10)) ) ) ) (assert (forall ((x Int)) (=>…
Ashiq
  • 307
  • 2
  • 10
7
votes
1 answer

Are floating point SMT logics slower than real ones?

I wrote an application in Haskell that calls Z3 solver to solve constrains with some complex formulas. Thanks to Haskell I can quickly switch the data type I'm working with. When using SBV's AlgReal type for computations, I get results in sensible…
arrowd
  • 33,231
  • 8
  • 79
  • 110
7
votes
1 answer

z3: solve the Eight Queens puzzle

I'm using Z3 to solve the Eight Queens puzzle. I know that each queen can be represented by a single integer in this problem. But, when I represent a queen by two integers as following: from z3 import * X = [[Int("x_%s_%s" % (i+1, j+1)) for j in…
Tan
  • 115
  • 7
7
votes
1 answer

Z3: express linear algebra properties

I would like to prove properties of expressions involving matrices and vectors (potentially large size, but size is fixed). For example I want to prove that the outcome of an expression is a diagonal matrix or a triangular matrix, or it is positive…
tyr.bentsen
  • 143
  • 1
  • 6
7
votes
1 answer

What is the relation between options `rlimit` and `timeout`?

It was suggested in this Z3 issue comment that option rlimit is to be preferred over timeout: Combining timeouts with a search algorithm makes everything non-deterministic, so now you don't even have to change the random seed to make it fail!…
Malte Schwerhoff
  • 12,684
  • 4
  • 41
  • 71
7
votes
3 answers

Calling SMT solver from JavaScript

Is there a way to run Z3 solver from javascript? Or is there a better SMT solver that I can be used in JavaScript?
william007
  • 17,375
  • 25
  • 118
  • 194
7
votes
1 answer

Read func interp of a z3 array from the z3 model

Suppose I have 2 arrays in a formula whose satisfiability I want to check using z3. If z3 returns sat, I want to read in the first array in the z3 model and pretty print it as a key, value pair and a default value. Later I want to convert it to a…
Tushar
  • 357
  • 1
  • 14
7
votes
2 answers

How to use Z3py and Sympy together

I am trying to perform some symbolic calculation on matrices (with symbols as an entries of matrices), and after that I will have a number of possible solution. My goal is to select solutions/ solution based upon constraints. for example, M is a…
user3196876
  • 187
  • 1
  • 12
7
votes
1 answer

Interpretation of Z3 Statistics

I obtained several statistics from runs of Z3. I need to understand what these mean. I am rather rusty and non up to date for the recent developments of sat and SMT solving, for this reason I tried to find explanations myself and I might be dead…
gapag
  • 71
  • 3
7
votes
1 answer

Understanding effects of produce-proofs, field names, and intermediate check-sat's on performance

For the below code, I have observed very fast results that seem to be caused/affected by three unusual aspects: When using (set-option :produce-proof true), the final UNSAT is very fast. Without this option, the final check-sat does not…
Thomas M. DuBuisson
  • 64,245
  • 7
  • 109
  • 166
7
votes
1 answer

eliminating forall using unsat

We know that, we can prove validity of a theorem by saying : let Demorgan(x, y) = formula1(x,y) iff formula2(x,y) assert ( forall (x,y) . Demorgan(x,y) ) Alternatively we can eliminate the forall quantifier by saying that : let Demorgan(x, y) =…
Shambo
  • 898
  • 1
  • 10
  • 17