smt

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

printing internal solver formulas in z3

一笑奈何 提交于 2019-12-18 05:55:49
问题 The theorem proving tool z3 is taking a lot of time to solve a formula, which I believe it should be able to handle easily. To understand this better and possibly optimize my input to z3, I wanted to see the internal constraints that z3 generates as part of its solving process. How do I print the formula that z3 produces for its back-end solvers, when using z3 from the command line? 回答1: Z3 command line tool does not have such option. Moreover, Z3 contains several solvers and pre-processing

(get-unsat-core) returns empty in Z3

喜你入骨 提交于 2019-12-18 04:11:25
问题 I am using Z3 to extract the unsat-core of an unsatisfiable formula. I am using Z3@Rise interface (web based) to write the following code, (set-logic QF_LIA) (set-option :produce-unsat-cores true) (declare-fun ph1 () Int) (declare-fun ph1p () Int) (declare-fun ph3 () Int) (declare-fun ph3p () Int) (declare-fun ph4 () Int) (declare-fun ph4p () Int) (define-fun one () Bool (= ph3p (+ ph1 1))) (define-fun two () Bool (= ph3 (+ ph1 1))) (define-fun three () Bool (= ph1p (+ ph1 1))) (define-fun

Incremental SMT solver with ability to drop specific constraint

本秂侑毒 提交于 2019-12-14 03:48:33
问题 Is there an incremental SMT solver or an API for some incremental SMT solver where I can add constraints incrementally, where I can uniquely identify each constraint by some label/name? The reason I want to identify the constraints uniquely is so that I can drop them later by specifying that label/name. The need for dropping constraints is due to the fact that my earlier constraints become irrelevant with time. I see that with Z3 I cannot use the push/pop based incremental approach because it

Get fractional part of real in QF_UFNRA

爱⌒轻易说出口 提交于 2019-12-13 13:48:52
问题 Using smtlib I would like to make something like modulo using QF_UFNRA. This disables me from using mod, to_int, to_real an such things. In the end I want to get the fractional part of z in the following code: (set-logic QF_UFNRA) (declare-fun z () Real) (declare-fun z1 () Real) (define-fun zval_1 ((x Real)) Real x ) (declare-fun zval (Real) Real) (assert (= z 1.5)); (assert (=> (and (<= 0.0 z) (< z 1.0)) (= (zval z) (zval_1 z)))) (assert (=> (>= z 1.0) (= (zval z) (zval (- z 1.0))))) (assert

Proving inductive facts in Z3

落花浮王杯 提交于 2019-12-13 13:42:12
问题 I am trying to prove an inductive fact in Z3, an SMT solver by Microsoft. I know that Z3 does not provide this functionality in general, as explained in the Z3 guide (section 8: Datatypes), but it looks like this is possible when we constrain the domain over which we want to prove the fact. Consider the following example: (declare-fun p (Int) Bool) (assert (p 0)) (assert (forall ((x Int)) (=> (and (> x 0) (<= x 20)) (= (p (- x 1)) (p x) )))) (assert (not (p 20))) (check-sat) The solver

Extending `z3` with one way functions

喜夏-厌秋 提交于 2019-12-13 04:39:44
问题 I'm looking to use a one-way function in a z3 Python program. I'd like z3 to respect the following properties/tactics: if x = y , then f(x) = f(y) f is a computable Python function that I can provide when x is known if f(x) = y , attempt to resolve by matching f(*y) = f(x) implying x = *y from prior assignments (never attempt to guess x that computes to y ) Are there built in features to support this construct or anything else that may help introduce it? 来源: https://stackoverflow.com

Z3 Java API - get unsat core

不羁岁月 提交于 2019-12-13 03:59:21
问题 I am trying to figure out how to get the unsat core using the Java API for Z3. Our scenario is as follows (code is underneath, which works in rise4fun): We create the SMT2 input programtically The input contains function definitions, datatype declarations, and assertions We parse this using the parseSMTLIB2String API We ensure that the context and the solver have unsat_core -> true Z3 returns UNSAT for the provided input, which is correct The UNSAT core is always empty though. The same input