z3py Questions

2

I want to use a Int vector as an array index. python. array = [12,45,66,34] s= Solver() x = Int('x') s.add(array[x] == 66) so the x should be 2.. how can i do it?
Schopenhauerism asked 25/3, 2018 at 9:21

4

Solved

In Z3Py, how can I check if equation for given constraints have only one solution? If more than one solution, how can I enumerate them?
Bevash asked 8/8, 2012 at 15:10

1

Solved

Recently I am learning SMT solver. Although SMT solver is a new concept to me, it reminds me of logic programming, e.g. Prolog and minikanren. So I tried a classic example of logic programming in S...
Garland asked 20/7, 2021 at 6:58

1

Solved

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 im...
Plyler asked 30/12, 2017 at 6:3

2

I'm new to Z3 and I was checking the online python tutorial. Then I thought I could check overflow behavior in BitVecs. I wrote this code: x = BitVec('x', 3) y = Int('y') solve(BV2Int(x) == y, ...
Wiltonwiltsey asked 23/7, 2013 at 21:20

1

I am using the Python bindings for the Z3 theorem prover (Z3Py). I have N boolean variables, x1,..,xN. I want to express the constraint that exactly K out of N of them should be true. How can I do ...
Enlarge asked 28/3, 2017 at 23:55

2

Solved

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 equa...
Microsecond asked 3/6, 2016 at 8:43

2

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/ solu...
Fourhanded asked 18/3, 2014 at 18:56

1

Solved

Let's say I have a z3 solver with a certain number of asserted constraints that are satisfiable. Let S be a set of constraints, I would like to verify for every constraint in S whether the formula ...
Ptolemaic asked 14/6, 2015 at 11:4

1

Solved

I'm working on a Python project, where I'm currently trying to speed things up in some horrible ways: I set up my Z3 solvers, then I fork the process, and have Z3 perform the solve in the child pro...
Unleavened asked 28/8, 2014 at 6:33

1

Solved

I'm trying to influence the randomness of results for model values generated by Z3. As far as I understand, the options for this are very limited: in case of linear arithmetic, the simplex solver d...
Cultivator asked 20/6, 2014 at 13:5

3

Solved

I have been trying to solve a small problem which includes absolute value of some terms. In z3 there is no support for abs() function. In python there is, but I eventually i have to pass it to z3py...
Theology asked 21/3, 2014 at 0:35

1

Solved

In a previous post some problems involving operational amplifiers were solved using Z3Py online. But now that Z3Py online is out of service I am trying to solve such problems using Z3 SMT-LIB onlin...
Precious asked 11/10, 2013 at 12:2

1

Solved

I am using Z3's python api to do some kind of incremental solving. I push constraints to the solver iteratively while checking for unsatisfiability at each step using solver.push() command. I want ...
Parthena asked 16/8, 2013 at 8:29

2

Solved

Suppose that a is an integer of 8-bit of value 254. If a is a signed integer, it is actually considered -2. In contrary, if a is unsigned, it remains 254. I am trying to model this signed/unsigned...
Dinsdale asked 24/7, 2013 at 15:26

3

Solved

Over the years I keep track of solving technology - and I maintain a blog post about applying them to a specific puzzle - the "crossing ladders". To get to the point, I accidentally found out abo...
Warfourd asked 18/7, 2013 at 14:54

1

Solved

In Z3Py, I have a formula. How can I retrieve the list of variables using in the formula? Thanks.
Noctule asked 29/12, 2012 at 9:34

1

Solved

How can I get real python values from a Z3 model? E.g. p = Bool('p') x = Real('x') s = Solver() s.add(Or(x < 5, x > 10), Or(p, x**2 == 2), Not(p)) s.check() print s.model()[x] print s.mode...
Myasthenia asked 26/9, 2012 at 9:17

1

Solved

Have the equation Pell x*x - 193 * y*y = 1 in z3py: x = BitVec('x',64) y = BitVec('y',64) solve(x*x - 193 * y*y == 1, x > 0, y > 0) Result: [y = 2744248620923429728, x = 81691677930189747...
Rosenberry asked 7/9, 2012 at 22:39
1

© 2022 - 2025 — McMap. All rights reserved.