Z3

How get a a value from a Lambda expression?

家住魔仙堡 提交于 2019-12-20 02:02:28
问题 I'm experimenting with z3 in python. I have the following model: (set-option :produce-models true) (set-logic QF_AUFBV ) (declare-fun a () (Array (_ BitVec 32) (_ BitVec 8) ) ) (declare-fun another () (Array (_ BitVec 32) (_ BitVec 8) ) ) (assert (and (= false (= (_ bv77 32) (concat (select a (_ bv3 32) ) (concat (select a (_ bv2 32) ) (concat (select a (_ bv1 32) ) (select a (_ bv0 32) ) ) ) ) ) ) (= false (= (_ bv12 32) (concat (select another (_ bv3 32) ) (concat (select another (_ bv2 32)

Z3 and DIMACS output

陌路散爱 提交于 2019-12-19 19:43:01
问题 Z3 currently supports the DIMACS format for input. Is there any way to output the DIMACS format for the problem before solution? I mean converting the problem to a system CNFs and output it in a DIMACS format. If not, any ideas towards this direction would be more than helpful. 回答1: The DIMACS format is very primitive, it supports only Boolean variables. Z3 does not reduce every problem into SAT. Some problems are solved using a propositional SAT solver, but this is not the rule. This usually

Z3 Enumerating all satisfying assignments

人走茶凉 提交于 2019-12-19 10:25:35
问题 I am trying to solve a problem similar to the one here (Z3: finding all satisfying models) where I need to find all satisfying assignments of SMT formulae that contain set variables. I understand the idea in the link since it is similar to what some SAT solvers do to iterate through solutions: add the negation of the solution to obtain a different solution. However, when I use the set variables (which are implemented as arrays in Z3) the things get a little complicated or perhaps I miss

Z3 patterns and injectivity

99封情书 提交于 2019-12-19 09:46:38
问题 In the Z3 tutorial, section 13.2.3, there is a nice example on how to reduce the number of patterns that have to be instantiated when dealing with the axiomatisation of injectivity. In the example, the function f that has to be stated injective, takes an object of type A as input and return an object of type B. As far as I understand the sorts A and B are disjunct. I have an SMT problem (FOL+EUF) on which Z3 seems not to terminate, and I am trying to isolate the cause. I have a function f:A-

Z3 patterns and injectivity

此生再无相见时 提交于 2019-12-19 09:46:00
问题 In the Z3 tutorial, section 13.2.3, there is a nice example on how to reduce the number of patterns that have to be instantiated when dealing with the axiomatisation of injectivity. In the example, the function f that has to be stated injective, takes an object of type A as input and return an object of type B. As far as I understand the sorts A and B are disjunct. I have an SMT problem (FOL+EUF) on which Z3 seems not to terminate, and I am trying to isolate the cause. I have a function f:A-

Again: Installing Z3 + Python on Windows

ⅰ亾dé卋堺 提交于 2019-12-19 04:56:20
问题 The installation problems pointed out in an earlier question are still present. I have tried to install Z3 4.3.0 and 4.1 under Windows XP SP3 32-bit and under Windows 7 64-bit. None of the combinations work! I am able to do the " from z3 import * ", but the init() of the Z3 dll fails. My Python version is 2.7.3. Z3 stand-alone and Python stand-alone do work, but they don't work together without lots of complaints. It would help to get an up-to-date installation recipe which answers the

Efficiency of constraint strengthening in SMT solvers

大兔子大兔子 提交于 2019-12-19 03:45:45
问题 One way to solve optimisation problems is to use an SMT solver to ask whether a (bad) solution exists, then to progressively add tighter cost constraints until the proposition is no longer satisfiable. This approach is discussed in, for example, http://www.lsi.upc.edu/~oliveras/espai/papers/sat06.pdf and http://isi.uni-bremen.de/agra/doc/konf/08_isvlsi_optprob.pdf. Is this approach efficient , though? i.e. will the solver re-use information from previous solutions when attempting to solve

How incremental solving works in Z3?

二次信任 提交于 2019-12-18 11:15:34
问题 I have a question regarding how Z3 incrementally solves problems. After reading through some answers here, I found the following: There are two ways to use Z3 for incremental solving: one is push/pop(stack) mode, the other is using assumptions. Soft/Hard constraints in Z3. In stack mode, z3 will forget all learned lemmas in global ( am I right? ) scope even after one local "pop" Efficiency of constraint strengthening in SMT solvers In assumptions mode (I don't know the name, that is the name

Z3 Theorem Prover: Pythagorean Theorem (Non-Linear Artithmetic)

て烟熏妆下的殇ゞ 提交于 2019-12-18 07:00:34
问题 Wherefore? The usecase context in which my problem occures I define 3 random item of a triangle. Microsoft Z3 should output: Are the constraints satisfiabe or are there invalid input values? A model for all the other triangle items where all the variables are assigned to concrete values. In order to constrain the items i need to assert triangle equalities - i wanted to start out with the Pythagorean Theorem ( (h_c² + p² = b²) ^ (h_c² + q² = a²) ). The Problem I know that Microsoft Z3 has only

Z3 Maximize in C++

余生颓废 提交于 2019-12-18 07:00:09
问题 In Z3, the following is clearly evaluated to a maximum of 2, with the model x=true and y=true. (declare-const x Bool) (declare-const y Bool) (declare-const z Bool) (assert(= z false)) (maximize( + (ite (= x true) 1 0) (ite (= y true) 1 0) (ite (= z true) 1 0) ) ) (check-sat) (get-model) How could I implement this using the C/C++ APIs? I've tried simply parsing using this: Z3_ast parsed = Z3_parse_smtlib2_string(c,<The above Z3>,0,0,0,0,0,0); z3::expr simpleExample(c, parsed); s.add