smt

Label on SMT-LIB 2.0 assertions in z3

南楼画角 提交于 2020-01-15 05:24:29
问题 Could you tell me how to name assertions in a z3 SMT-LIB 2.0 benchmark? I would prefer to use the standard syntax of SMT-LIB, but as z3 seems not to understand it, I'm just looking for one working with z3. The need is to get unsat cores with labels. Here is an example of benchmark I tested: (set-option enable-cores) (set-logic AUFLIA) (declare-fun x () Int) (declare-fun y () Int) (declare-fun z () Int) (assert (! (<= 0 x) :named hyp1)) (assert (! (<= 0 y) :named hyp2)) (assert (! (<= 0 z)

parthood definition in Z3

女生的网名这么多〃 提交于 2020-01-14 02:53:06
问题 I'm trying to define in Z3 the parthood relation (called C in the code below) between pairs of sets (defined using array). I wrote 3 asserts to define reflexivity, transitivity, and antisymmetry but Z3 returns "unknown" and I don't understand why. (define-sort Set () (Array Int Bool)) (declare-rel C (Set Set)) ; reflexivity (assert (forall ((X Set)) (C X X))) ; transitive (assert (forall ((X Set)(Y Set)(Z Set)) (=> (and (C X Y) (C Y Z)) (C X Z) ) )) ; antisymmetric (assert (forall ((X Set)(Y

how to get multiple solutions for z3 solver in smt2 format example?

喜夏-厌秋 提交于 2020-01-11 13:41:31
问题 How to generate multiple models for bit vector formula using z3 solver in smt2 format? While implementing IDEA Code for Bit Vector it is generating one model. How to generate all possible models for the same if exists? ex.smt2 file (set-logic QF_BV) (set-info :smt-lib-version 2.0) (declare-const A0 (_ BitVec 16)) (declare-const A1 (_ BitVec 16)) (declare-const A2 (_ BitVec 16)) (declare-const B0 (_ BitVec 16)) (declare-const B1 (_ BitVec 16)) (declare-const B2 (_ BitVec 16)) (declare-const C0

how to print output in hexadecimal format

白昼怎懂夜的黑 提交于 2020-01-05 06:42:15
问题 this Boolector program printing output in binary format. But I need in hexadecimal format. so how to print hexdecimal format in boolector. (set-logic QF_BV) (set-info :smt-lib-version 2.0) (declare-const val1 (_ BitVec 16)) (declare-const val2 (_ BitVec 16)) (declare-const gen_mul (_ BitVec 16)) (declare-const eval1 (_ BitVec 32)) (declare-const eval2 (_ BitVec 32)) (declare-const org_mul (_ BitVec 32)) (declare-const rem17 (_ BitVec 32)) (declare-const res (_ BitVec 16)) (assert (= gen_mul

Interpretation of Z3 Statistics

我怕爱的太早我们不能终老 提交于 2019-12-30 04:49:08
问题 I obtained several statistics from runs of Z3. I need to understand what these mean. I am rather rusty and non up to date for the recent developments of sat and SMT solving, for this reason I tried to find explanations myself and I might be dead wrong. So my questions are mainly: 1) What do the measures' names mean? 2) If wrong, can you give me pointers to understand better to what they refer to? Other observations are made below and conceptually belong to the two questions above. Thanks in

Can Z3 check the satisfiability of formulas that contain recursive functions?

大兔子大兔子 提交于 2019-12-29 07:56:19
问题 I'm trying out some of the examples of a Z3 tutorial that involve recursive functions. I've tried out the following example. Fibonacci (Section 8.3) IsNat (Section 8.3) Inductive (Section 10.5) Z3 times out on all of the above examples. But, the tutorial seems to imply that only Inductive is non-terminating. Can Z3 check the satisfiability of formulas that contain recursive functions or it cannot handle any inductive facts? 回答1: These examples from the Z3 tutorial are there to illustrate

Can Z3 check the satisfiability of formulas that contain recursive functions?

旧时模样 提交于 2019-12-29 07:56:09
问题 I'm trying out some of the examples of a Z3 tutorial that involve recursive functions. I've tried out the following example. Fibonacci (Section 8.3) IsNat (Section 8.3) Inductive (Section 10.5) Z3 times out on all of the above examples. But, the tutorial seems to imply that only Inductive is non-terminating. Can Z3 check the satisfiability of formulas that contain recursive functions or it cannot handle any inductive facts? 回答1: These examples from the Z3 tutorial are there to illustrate

Read func interp of a z3 array from the z3 model

柔情痞子 提交于 2019-12-28 04:20:29
问题 Suppose I have 2 arrays in a formula whose satisfiability I want to check using z3. If z3 returns sat, I want to read in the first array in the z3 model and pretty print it as a key, value pair and a default value. Later I want to convert it to a map and do further analysis on it. Here's the example I run: void find_model_example_arr() { std::cout << "find_model_example_involving_array\n"; context c; sort arr_sort = c.array_sort(c.int_sort(), c.int_sort()); expr some_array_1 = c.constant(

Z3: eliminate don't care variables

梦想的初衷 提交于 2019-12-25 03:27:47
问题 I have a test.smt2 file: (set-logic QF_IDL) (declare-const a Int) (declare-const b Int) (declare-const c Int) (assert (or (< a 2) (< b 2 )) ) (check-sat) (get-model) (exit) Is there anyway to tell Z3 to only output a=1 (or b=1)? Because when a is 1, b's value does not matter any more. I executed z3 smt.relevancy=2 -smt2 test.smt2 (following How do I get Z3 to return minimal model?, although smt.relevancy seems has default value 2), but it still outputs: sat (model (define-fun b () Int 2)

Parse SMT-LIB2 String using Declarations in Existing Context

我与影子孤独终老i 提交于 2019-12-24 14:08:36
问题 I have an existing Z3 4.1 context created in the .NET API, with many function declarations, sort declarations, assumptions asserted, etc. What is the cleanest way to parse an SMT-LIB2 string using all the existing declarations in this context? Specifically, is there a way to iterate over all the declarations in a context? I did not see any methods in Context that would allow me to access the declarations. Currently, I am doing the following: Context z3 = new Context(); // ... declare sorts,