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
1 answer

Why does Z3 return unknown result?

all, I am a newer to use Z3. I wrote this smt2 file, but the result return unknown, what is wrong in my file? (set-option :fixedpoint.engine datalog) (define-sort site () (_ BitVec 3)) (declare-rel pointsto (Int Int)) ;used to get all points-to…
nana
  • 11
  • 3
1
vote
1 answer

z3py error when converting int to bitvec

From (Z3: Is it possible to sum up a BitVec and a Real?) , I tried to convert an int to bitvec using x = Int('x') reg = BitVecRef(Z3_mk_int2bv(BitVecVal(x.ctx_ref(), 16, x)), x.ctx) but I always get an error saying " 'Ast' object has no attribute…
Pounce
  • 25
  • 4
1
vote
1 answer

constants in z3 – segmentation fault in c++ api

The following c++ api code for z3 results in Segmentation fault: 11 (z3 version 4.4.0 running on Mac OS 10.10.2) #include "../z3/include/z3++.h" int main() { z3::context c; z3::sort A = z3::sort(c); z3::expr x = c.constant("x", A); } Am I…
szymtor
  • 167
  • 1
  • 7
1
vote
1 answer

Z3 unsigned variables - simplify

I have the following constraint (constr) I want to simplify: 4p+3q<=-10+r AND 4p+3q<=-12+r p (and similar for r) is created as follows: Z3_ast p; Z3_sort ty = Z3_mk_int_sort(ctx) Z3_symbol s = Z3_mk_string_symbol(ctx, "p"); p = Z3_mk_const(ctx, s,…
User
  • 229
  • 3
  • 11
1
vote
1 answer

Asserting constraint on matrix multiplication

I am trying to evaluate resultant matrix by asserting constraint on matrix multiplication using z3py API. The following method works for matrix addition. Following is the code, which have 3 matrices: x, y, and sol. sol is the addition of x and y…
Rauf
  • 27
  • 6
1
vote
1 answer

Segmentation fault while using par-or tactic

This smt2 script encounters segmentation fault. The problem arises when par-or tactic is used. It is working without this tactics. I am using z3 4.4.0 on a "Debian 3.2.60-1+deb7u3 x86_64 GNU/Linux" machine.
mmpourhashem
  • 91
  • 1
  • 6
1
vote
1 answer

z3 4.3.2 fails to find a model for Why3-generated (satisfiable) goals

I'm trying to use Why3's Z3 back-end in order to retrieve models that can then be used to derive test cases exhibiting bugs in programs. However, Z3 version 4.3.2 seems unable to answer sat for any Why3 goal. It looks like some of the axiomatic…
Virgile
  • 9,724
  • 18
  • 42
1
vote
1 answer

Getting Unsat core examples using Z3 and c#

I am trying to use the Z3 sat solver in an C# implementation. This code is very close to the example given by Microsoft itself in "http://z3.codeplex.com/SourceControl/latest#examples/dotnet/Program.cs". My code is: using (Context ctx = new…
Amir Ebrahimi
  • 115
  • 1
  • 10
1
vote
1 answer

function to get nibbles using Z3 and bitvector theory

I'm trying to learn a little about z3 and the bit vector theory. My intention is to make a function to get the nibble from a position of the bitvector This code returns the nibble: (define-fun g_nibble( (l ( _ BitVec 12)) (idx (Int)) ) ( _…
1
vote
1 answer

timeout for z3 solver in python

I have problems setting a timeout for my solver: s = Solver() encoding = parse_smt2_file("ex.smt2") s.add(encoding) s.set("timeout", 600) solution = s.check() but I get the following error Traceback (most recent call last): File…
1
vote
1 answer

Polymorphic Functions in SMTLIB2 / Z3

Am I correct in understanding that one cannot create "polymorphic" functions in Z3 or SMTLIB2? e.g. I'd like to write something like: (declare-fun Prop (A) Bool) (declare-fun x1 () Int) (declare-fun x2 () Bool) (assert (and (Prop x1) (Prop…
Ranjit Jhala
  • 1,242
  • 8
  • 18
1
vote
1 answer

Use z3 to Prove Identity of Boolean/Arithmetic Formula

I'm trying to use z3 to prove the following identity: x+y == x^y + 2*(x&y) That is, we can replace any addition with a mixture of boolean and arithmetic instructions (example taken from Chapter 2.2, Hacker's Delight). I'm using the following z3…
newgre
  • 5,245
  • 4
  • 31
  • 41
1
vote
1 answer

Z3:unknown result in Z3 C API

In current Z3 context,assert " try(X,i,j) = ((X[i][j] == i*j)) " is already existed.the type of X is (Array Int (Array Int Int)).try(X,i,j) is a function and return type is bool.here is the Z3 context: (kernel (forall ((Y (Array Int (Array…
Lewis.Lee
  • 13
  • 3
1
vote
1 answer

Unexpected effect of smt.arith.nl.gb on reasoning with (syntactic) equality - bug?

Consider the following SMTLIB program (on rise4fun here): (set-option :auto_config false) (set-option :smt.mbqi false) (set-option :smt.arith.nl.gb false) (declare-const n Int) (declare-const i Int) (declare-const r Int) (assert (= i n)) (assert…
Malte Schwerhoff
  • 12,684
  • 4
  • 41
  • 71
1
vote
1 answer

Z3 java bindings?

is the information on this page still up to date? http://leodemoura.github.io/blog/2012/12/10/z3-for-java.html I see that both rc and stable have a examples/java folder with an actual example, does it mean that java bindings are now part of the…
remi
  • 566
  • 3
  • 13