smt

Which is better practice in SMT: to add multiple assertions or single and?

此生再无相见时 提交于 2019-12-24 05:04:33
问题 Lets say I have two clauses that I want to model in SMT, is it better to add them as separate assertions like (assert (> x y)) (assert (< y 2)) or to add one assertion with and operator like this (assert (and (> x y) (< y 2) )) Does this matter for large scale problems in terms of SMT solver performance. I am using Z3. 回答1: The conjunction gets split into multiple assertions, so it doesn't really matter too much. If you introduce a large conjunction, Z3's parser will create a term that

Z3 int2bv operation

回眸只為那壹抹淺笑 提交于 2019-12-24 04:59:14
问题 I am experiencing some issues with the bitvector operations. In particular, given the following model. I was expecting var0 to be 11 . (declare-const var1 Int) (declare-const var0 Int) (assert (= var1 10)) (assert (= var0 ((_ bv2int 32) (bvor ((_ int2bv 32) var1) ((_ int2bv 32) 1))))) (check-sat) (get-model) (exit) However, the solution given by Z3 for fun was: sat (model (define-fun var1 () Int 10) (define-fun var0 () Int (- 1)) ) This means, -1 instead of 10. Am I doing something wrong? 回答1

How to represent logarithmic formula in z3py

佐手、 提交于 2019-12-23 22:16:09
问题 I am very new to z3py. I am trying to code the following logarithmic expressions in z3py . log(x,y) I did search stack overflow a lot and came across a similar question, but unfortunately I could not get a satisfactory enough answer. Please help me! 回答1: More generally, how can we define logs with Z3? The only way I have gotten any traction at all is to use an approximate value for e , define exp(x) as (^ e x) , and then define log as a total function that is the inverse of exp . In SMT-LIB 2

Finding suboptimal solution (best solution so far) with Z3 command line tool and timeout

元气小坏坏 提交于 2019-12-23 18:28:52
问题 I saw a post which spoke about how Z3's python API can be used to get suboptimal solution for a minimization problem I have a MAXSMT problem, and I want to know how Z3 command line tool can be used to find a suboptimal solution when timeout is specified? Is using -t:timeout option alone suppose to give me a suboptimal solution? The Z3 solver took 150 seconds to find an optimal solution for my MaxSMT problem I used z3 -t:140000 smt2 <filename> to set the timeout as 140 seconds. But the z3

Z3/SMT: When should I prefer push/pop to reset?

别来无恙 提交于 2019-12-23 16:13:35
问题 I am using Z3 to solve the path conditions produced by a symbolic executor, which explores the state space in depth-first order, quite similarly to CUTE, DART or (possibly) SAGE. We are experimenting different ways of using Z3. At one extreme, we send every query to Z3 and (reset) it right after. At the other, we (push) every additional branch constraint, and (pop) (pop) upon backtrack the minimum necessary to correctly weaken the path condition. The problem is, no strategy seems to work

Is it possible to get a legit range info when using a SMT constraint with Z3

痴心易碎 提交于 2019-12-23 16:09:24
问题 So basically I am trying to solve the following SMT constraint with a generic constraint solver like Z3: >>> from z3 import * >>> a = BitVec("a", 32) >>> b = BitVec("b", 32) >>> c1 = (a + 32) & (b & 0xff) >>> c2 = (b & 0xff) >>> s = Solver() >>> s.add(c1 == c2) >>> s.check() sat >>> s.model() [b = 0, a = 4294967199] Note that obviously, the constraint should be sat whenever b falls within the range of [0x00000000, 0xffffff00] . So here is my question, is it in general feasible for a SMT

Is z3 the most efficient solver for quantifier-free integer propositional logic? [closed]

北城以北 提交于 2019-12-23 15:44:34
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 12 months ago . Sorry that this question is subjective, but given that the Stack Overflow has the largest Z3 user base, I want to give it a try. I have a big constraint satisfaction problem that consists of many integer propositional logic formulas and a few first order logic formulas that

How to estimate time spent in SAT solving part in z3 for SMT?

▼魔方 西西 提交于 2019-12-23 15:19:52
问题 I have profiled my problems, which are in (pseudo-nonlinear) integer real fragment using the profiler gprof (stats here including the call graph) and was trying to separate out the time taken into two classes: I)The SAT solving part (including [purely] boolean propagation and [purely] boolean conflict clause detection, backjumping, any other propositional manipulation) II)The theory solving part (including theory consistency checks, generation of theory conflict-clauses and theory propagation

Why does a query result changes if comment an intermediate `(check-sat)` call?

人走茶凉 提交于 2019-12-23 13:35:30
问题 While debugging UNSAT query I noticed an interesting difference in the query status. The query structure is: assert(...) (push) ; commenting any of these two calls (check-sat) ; makes the whole query UNSAT, otherwise it is SAT assert(...) (check-sat) ; SAT or UNSAT depending on existence of previous call (exit) There are no pop calls in the query. The query that triggers this behaviour is here. Ideas why? Note: I don't actually need incrementality, it is for debugging purposes only. Z3

Z3 Java API defining a function

折月煮酒 提交于 2019-12-23 12:38:41
问题 I need your help defining a function with the Z3 Java API. I try to solve something like this (which is working fine with the z3.exe process): (declare-fun a () Real) (declare-fun b () Real) (declare-fun c () Bool) (define-fun max2 ((x Real) (y Real)) Real (ite (<= x y) y x)) (assert (and (>= a 0.0) (<= a 100.0))) (assert (or (= (max2 (+ 100.0 (* (- 1.0) a)) (/ 1.0 1000.0)) 0.0) c (not (= b 0.0)))) (check-sat-using (then simplify bit-blast qfnra)) (get-model) The result of this smt-file is: