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
0 answers

How can I check a boolean expr is literally either TRUE or FALSE?

I created the following program: context c; expr x = c.int_val(1); expr y = c.int_val(2); expr b = (x > y).simplify(); std::cout << "b = " << b << "\n"; The output said that b = false. But how can I check whether b is the false constant? I want to…
ZLW
  • 151
  • 9
1
vote
1 answer

Z3 Solver outputting the satisfying model?

In Z3, if the input script is written in SMTLib format, is it possible to output the model (value assignments satisfying the model)? The get-model returns an interpretation satisfying the constraints. Is there any way to extract the concrete values…
MockedMan.Object
  • 275
  • 1
  • 3
  • 13
1
vote
1 answer

Z3_parse_smtlib_string usage issues

In the following code, I put a clearly unsatisfiable Z3 declaration and then try to use the C++/C Z3 APIs to see it programmatically solved. The problem is that this code always triggers the check that outputs: "SAT?!". i.e. the clearly…
d'alar'cop
  • 2,357
  • 1
  • 14
  • 18
1
vote
1 answer

running z3 on google app engine

I'd like to find a pure-python z3 package that will help me to run z3 in google app engine. I've run the following python test locally and it runs: from z3 import * x = Real('x') y = Real('y') s = Solver() s.add(x + y > 5, x > 1, y…
1
vote
0 answers

OS X install z3 with z3types.Z3Exception: 'init(Z3_LIBRARY_PATH)

I'm trying to install z3 locally on my MAC, When I try the example, I got the exception: z3types.Z3Exception: 'init(Z3_LIBRARY_PATH), which is weird, because I've already linked it. Here is how I installed it: >> git clone…
katrina
  • 11
  • 1
1
vote
1 answer

My formula is in DNF, will z3 convert it into CNF?

DNF SAT is polynomial time, while CNF SAT is NP-Complete. If I have a first-order formula whose Boolean skeleton is already in DNF, will z3 be aware of that, or it will blindly convert the formula to CNF to solve by CDCL?
sean
  • 1,632
  • 2
  • 15
  • 34
1
vote
2 answers

Why does Z3 give no response on the following input?

I originally posted the question as shown below the dotted line, but since then I have an even simpler example: (declare-fun f (Int) Int) (assert (= (f 10) 1)) (check-sat) (get-model) produces an interpretation for f as expected. However change the…
Motorhead
  • 928
  • 6
  • 16
1
vote
1 answer

Different results in Z3 with smt2 file and OCaml

I have this same problem in SMT2 and OCaml. I'm able to get the unsat result in ~3 mins using SMT2 file. However the same problem in OCaml gets stuck. Please advise. SMT2 of the problem: (declare-fun x0 () (_ BitVec 32)) (declare-fun x1 () (_ BitVec…
Manjeet Dahiya
  • 485
  • 1
  • 4
  • 15
1
vote
1 answer

use of sort in Z3

Can somebody help to know how to use "for all" correctly in Z3, Ive been looking in the documentation but I couldnt find information. What I am trying to do is within "foo" I need say in Z3 something to the equivalent of "let (u,r) be runnable(t)…
user3723800
  • 145
  • 7
1
vote
1 answer

Include Z3 in a C++ project

I want to use Z3 in a llvm project(file directory copied from its sample project). What I did now is just simply include z3++.h without adding any other code in the source file and want to pass the compilation. But I don't know how to deal with…
Min Gao
  • 383
  • 4
  • 16
1
vote
1 answer

Z3: Expressing Array equivalence

I'm expressing memory as Z3Arrays. And I want to express that the two arrays are same i.e. their contents are same. How can I do the same in Z3?
Manjeet Dahiya
  • 485
  • 1
  • 4
  • 15
1
vote
1 answer

Z3 C# FiniteDomain Sort Exception / Usage?

I'm trying to use "FiniteDomainSort" in my context, but when i give it to the solver it throws some exceptions. Remarks: * I use MkNumeral as suggested here * Tested with z3-4.3.0 x64 (win) and z3-4.3.2 x64 (ubuntu) * Runs fine when I use IntSort in…
M.S.
  • 442
  • 3
  • 13
1
vote
1 answer

Unexpected result after calling Exists on substituted formula

When calling Z3py's Exists function subsequently on different variables and formulas, I get the exact same result. Is that some sort of Python problem or is Z3 broken here? How to fix? The following minimal example illustrates the problem: from z3…
Fightclub
  • 13
  • 2
1
vote
1 answer

muZ3: Non-deterministic recursive call

Is there a way to perform a recursive call non-deterministically in a muZ3 relation specification? Specifically, I want to translate a function like the following: int foo(int x) { ... if (*) y = foo(y); ... } to the muZ3 rule format.
Hinton
  • 2,320
  • 4
  • 26
  • 32
1
vote
2 answers

How to convert SMT(containing boolean and bounded int variables) constraints to CNF

My applicant is originally a SAT problem. Now, I'm trying to do some extension which requires to use some int variables. So the problem becomes a SMT problem. But I encountered a performance problem when using z3 to solve it. As the int variable is…
Dingbao Xie
  • 716
  • 9
  • 21
1 2 3
99
100