Questions tagged [z3py]

Python interface for the Z3 Theorem Prover

z3py - Python interface for the Z3 Theorem Prover. Z3 is a high-performance theorem prover. Z3 supports arithmetic, fixed-size bit-vectors, extensional arrays, datatypes, uninterpreted functions, and quantifiers.

834 questions
0
votes
1 answer

z3py: How to set Tactic configuration options whose names contain "."?

The correct way of configuring tactics in z3.py is using "With". E.g. t = With(Tactic('simplify'), som=True) However, some option names contain a "." in it, such as "arith.solver" in tactic "qflia". If we code in the same way t =…
Mark Jin
  • 2,616
  • 3
  • 25
  • 37
0
votes
1 answer

z3py: What is a correct way of asserting a constraint of "something does not exist"

I want to assert a constraint of "something must not exist" in z3py. I tried using "Not(Exists(...))". A simple example is as follows. I want to find a assignment for a and b, so that such c does not exist. from z3 import * s = Solver() a =…
Mark Jin
  • 2,616
  • 3
  • 25
  • 37
0
votes
1 answer

how to solve equation instead of giving one model in z3

This might not beyond the scope of z3, I know in Z3 we can simplify expression, but I wonder if z3 can solve the equation instead of giving a model. For example, I want the following equation always be true for any value of a. Using ForAll…
Pounce
  • 25
  • 4
0
votes
0 answers

muZ returns different answers with datalog and pdr engines

I am running muZ over python with version 4.40. For one query I get a different result when I set fp.set( "engine", "datalog" ) And when I set fp.set( "engine", "pdr" ) The program below returns unsat for both queries with datalog and sat with…
0
votes
1 answer

Z3py SMT coding following variables and the formulas

I am really new to Z3 and SMT solvers. I have the following problem which I don't know how to code in Z3py. In the above diagram N is set of nodes, thus N = {Node1, Node2, Node3, Node4, Node5, Node6, Node7} I is set of Inputs, I = {I1, I2, I3,…
Priyanka
  • 107
  • 13
0
votes
0 answers

clauses and variables in Z3.py

I'm working recently on Z3.py. I wonder If there is any way to display the number of clauses and variable of my model. I used to work on Alloy. Alloy displays these informations automatically. Can anyone help? Thanks
Moody
  • 137
  • 1
  • 9
0
votes
0 answers

Building disjunction automatically

I have to build disjunctive/conjunctive formula automatically, all I know is the length of list from where I have to acquire the values of variables, e.g: x=Int('x') list= [0,1,2,3] solver=Solver() one approach to do this…
Rauf
  • 27
  • 6
0
votes
1 answer

Z3 taking too long for a non-linear real formula

Why does it take an unspecified large time for Z3 to solve the following Non-linear real formula? It instantly solves it if the first constraint changes for < 0 to > 0. The formula: s.add…
Asad Vivi
  • 1
  • 2
0
votes
1 answer

How to define piece-wise functions in Z3py

I would like to define a piece-wise (linear) function in Z3py, for example, the function f(x) has the form f(x) = a*x + b when 0 <= x <= 1 f(x) = exp(c*x) when 1 < x <= 2 f(x) = 1/(1+10^x) when 2 < x <= 3 etc. where a, b and c are constants. I…
Alex Allen
  • 39
  • 7
0
votes
1 answer

How to make up a new bitvec out of existing bitvecs?

I know in z3 we can extract some bits from one existing bitvec, but right now I have two bitvecs and I want to make a new bitvec based on these two, how can I implement this ? For example, ah = bitvec("ah", 8) al = bitvec("al", 8) now I would like…
Pounce
  • 25
  • 4
0
votes
2 answers

Where can I get windows/linux binaries for Z3opt

The link mentioned in the online tutorial doesn't contain any link to opt branch: http://z3.codeplex.com/ and also there isn't any page under download section... Is it possible to get the binaries for windows/linux? Thanks
Rauf
  • 27
  • 6
0
votes
1 answer

Simplifying expression involving variables in finite domain

The ctx-solver-simplify tactic only works for bool variables, so how would I deal with variables over finite domain (e.g., which tactics to use)? For example, if z can only take 3 values 0,1,2, then how to simplify Or(z==0,z==1,z==2) to true ? Also,…
Vu Nguyen
  • 987
  • 1
  • 9
  • 20
0
votes
1 answer

Z3py: Solving with integers and bit vectors in constraints

I am trying to solve constraints using Z3 SMT solver in python. The constraints involve both integers and bit vectors. I am converting the BitVec to Int using Z3_mk_bv2int. I believe the following constraints are unsatisfiable but I get SAT from Z3…
User1219
  • 1
  • 1
0
votes
1 answer

Setting the monomial degree in z3py

When reasoning about polynomial inequalities, Z3 seems to have to first transform the polynomial into monomial form. I'm wondering if there's a setting in the solver that let me define the monomial degree I want my polynomials to be transformed…
penny
  • 86
  • 5
0
votes
1 answer

Is Z3 python interface threadsafe?

within the python interface of Z3 variables can be created via methods: Int, Real, .... Does anybody know whether these methods can be called concurrently in python? That means, are those methods threadsafe? I would like to create variables…
sfrehse
  • 1,062
  • 9
  • 22