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
1
vote
2 answers

Craig Interpolation API

There are versions of the Z3 SMT solver that support Craig interpolation. Methods of the API where, for example, Z3_interpolate, Z3_write_interpolation_problem, or Z3_mk_interpolation_context. Microsoft Research provides a website with the…
Andreas
  • 13
  • 2
1
vote
1 answer

Z3 Solver : Stable version for Java API

I would like to ask how do I download a stable version of Z3 for using Java API? In the master branch in codeplex, the source does not contain directory src/api/java. This is present in some branches like cade24 or rc and others. I do not have an…
Raj
  • 3,300
  • 8
  • 39
  • 67
1
vote
1 answer

converting c# statement to z3 format

I am writing a code in c#. In the code there are various IF conditions. I want to pass these conditions to z3 constraint solver and check its satisfiability and get the values that makes it satifiable. (I make use of these values further in my…
Poorva
  • 31
  • 2
1
vote
1 answer

Creating constant from sort in Z3 Python API

Given a Z3 Sort and a string s I am trying to create a Z3 constant of that sort named s. For instance, given IntSort() and the name "x" I'd like to get an integer constant named "x". I know I can get it calling Int('x') but since I am creating this…
1
vote
0 answers

Performance issue using Z3 for linear arithmetic queries

I am writing a static analysis tools that needs to perform some queries to an oracle solving linear integer arithmetic problems. For my first version, I implemented a decision procedure for Presburger arithmetic in OCaml (for fun, and profit). On…
mpu
  • 433
  • 2
  • 11
1
vote
0 answers

How to prove theorems for one-parameter groups using Z3

Using Z3 it is possible to prove that forms a one-parameter group. The proof is performed using the following Z3 code: (declare-sort S) (declare-fun carte (Real Real) S) (declare-fun h (Real S) S) (declare-fun a () Real) (declare-fun b ()…
Juan Ospina
  • 1,317
  • 1
  • 7
  • 15
1
vote
1 answer

Z3 maximization API: switching objectives

Another question on the maximization API in Z3. I get wrong answers if I switch maximization objectives midway through: from z3 import Real, Optimize x = Real('x') y = Real('y') opt = Optimize() opt.add(x >= 0) opt.add(y >= 0) opt.add(x + y <=…
George Karpenkov
  • 2,094
  • 1
  • 16
  • 36
1
vote
1 answer

Solving projection function equations using SMT in Z3

I'm trying to use Z3 to solve equations involving unknown projection functions, to find a valid interpretation of the functions that satisfy the equation. So for example for the equation: snd . f = g . fst a valid interpretation would be f = \(x,y)…
Taj
  • 21
  • 4
1
vote
0 answers

SIGSEGV occurred using signed mkBV2Int

The following code leads to a SIGSEV Map settings = new HashMap(); settings.put("model", "true"); Context z3_ctx = new Context(settings); BitVecExpr bv_left = z3_ctx.mkBV(10, 32); IntExpr ret_val =…
1
vote
1 answer

Z3 maximization API: possible bug?

I'm currently playing with the maximization API for Z3 (opt branch), and I've stumbled upon a following bug: Whenever I give it any unbounded problem, it simply returns me OPT and gives zero in the resulting model (e.g. maximize Real('x') with no…
George Karpenkov
  • 2,094
  • 1
  • 16
  • 36
1
vote
2 answers

Models and recursive functions

As previously asked Z3 can not provide a model for recursive functions. However, is it possible to tell Z3 (preferably via the Java API) that a model without a definition for recursive functions is sufficient (or indeed choose the functions I am…
1
vote
1 answer

z3 "more than" totally ordered relation

I wanted to create a SMT sequence, such that I have a total ordering which should be complete. example 1: a < b and b < c should be satisfiable example 2: a < b and c < d should be unsatisfiable. By adding b < c we will get satisfiability. Does…
paubo147
  • 748
  • 4
  • 8
1
vote
1 answer

Random seed for Z3 SAT Solver

I am using Z3 as SAT solver for a tough satisfiability problem encoded in CNF/DIMACS format. Would it make sense to randomize the input in order to increase the chance to find a solution: Shuffle the order of CNF clauses Sort/shuffle the numbering…
Axel Kemper
  • 10,544
  • 2
  • 31
  • 54
1
vote
1 answer

Z3 C++ API expression predicate operator overload does not have unsigned operation

I was looking at document of class expr of Z3 C++ API from following link http://research.microsoft.com/en-us/um/redmond/projects/z3/classz3_1_1expr.html. I found that for predicate operator such us ">" , ">=" and "<=", for bit vector it only…
Min Gao
  • 383
  • 4
  • 16
1
vote
0 answers

Z3 is the only system that is able to refute REL051+1.p?

The problem in relational algebra REL051+1.p reads File : REL051+1 : TPTP v6.1.0. Released v4.0.0. % Domain : Relation Algebra % Problem : Dense linear ordering Using TPTP syntax with fof the corresponding code is fof(f01,axiom,( ! [A]…
Juan Ospina
  • 1,317
  • 1
  • 7
  • 15