Z3

different run time for the same code in Z3

六眼飞鱼酱① 提交于 2019-12-12 04:12:07
问题 I used fixedpoint of z3, and I found that the running time of the fixedpoint is always different. Have you meet the same problem? why does this happen? 回答1: Sounds unexpected if you get large variety for the same code starting from the same state. If you start from different states (that is, if you have made miscellaneous calls to Z3 whether over the text API or programmatic API, between the rounds). Z3 should otherwise not exhibit hugely non-deterministic behavior. Non-deterministic behavior

(check-sat) then (check-sat-using qfnra-nlsat)

自闭症网瘾萝莉.ら 提交于 2019-12-12 03:37:01
问题 What I want to do: I would like to call (check-sat) , and then if the result is unknown , call (check-sat-using qfnra-nlsat) . Why do I want to do this?: For my application the Z3 default tactics applied with (check-sat) are superior to anything I have devised using (check-sat-using) . However, there are a few situations where (check-sat) returns unknown , but (check-sat-using ...) with judiciously chosen tactics finds a result. Here is an example: (declare-fun x () Real) (declare-fun y ()

Simplify function interpretation in model

↘锁芯ラ 提交于 2019-12-12 03:36:25
问题 In SMT: check uniqueness and totality of function I gave a function axiomatization and asked Z3 for a model. However because solving something with quantifiers in it is undecidable in general, Z3 times out. Here is a modified version in which the "int" case is modelled as a single value: (declare-datatypes () ((ABC int error none))) (declare-fun f (ABC ABC) ABC) (assert (forall ((x ABC)) (=> (or (= x int) (= x error) (= x none)) (= (f none x) none)))) (assert (forall ((x ABC)) (=> (or (= x

Z3py SMT coding following variables and the formulas

Deadly 提交于 2019-12-12 03:35:36
问题 I am really new to Z3 and SMT solvers. I have the following problem which I don't know how to code in Z3py. In the above diagram N is set of nodes, thus N = {Node1, Node2, Node3, Node4, Node5, Node6, Node7} I is set of Inputs, I = {I 1 , I 2 , I 3 , I 4 } O is set of Outputs, O = {O 1 , O 2 , O 3 } G is a group where for any consecutive 2 outputs (O i , O j ), if O i is first output generated and O j is second output generated then, G k is set of nodes that were scheduled after the generation

Compile errors for Z3's JavaExample.java test of java bindings

江枫思渺然 提交于 2019-12-12 02:27:56
问题 I am trying to use Z3's java binding, particularly trying to run the Java example JavaExample.java that's distributed in Z3's 4.4.2 version. JavaExample.java was compiling fine when I was using the 4.4.2 com.microsoft.z3.jar file. However, it would not run because the default libz3java.dll was 32-bit and my environment is 64-bit. I tried building a 64-bit Z3 with the -x flag for its Makefile maker scripts/mk_make.py but that generated an error when I ran nmake (posted about that here). Anyway

How to declare constraints with variable as array index in Z3Py?

江枫思渺然 提交于 2019-12-12 02:08:22
问题 Suppose x,y,z are int variables and A is a matrix, I want to express a constraint like: z == A[x][y] However this leads to an error: TypeError: object cannot be interpreted as an index What would be the correct way to do this? ======================= A specific example: I want to select 2 items with the best combination score, where the score is given by the value of each item and a bonus on the selection pair. For example, for 3 items: a, b, c with related value [1,2,1], and the bonus on

Whether two boolexpr are equal

不问归期 提交于 2019-12-12 01:26:28
问题 Given two boolexpr b1,b2 say b1=x1>=4&&x2>=5 b2=x2>=5&&x1>=4 Can we use .net API for Z3 to know whether b1 and b2 are actually the same constraint? )(meaning that the value of x1 and x2 allowed by b1 and b2 are the same) 回答1: Yes. You want to prove that b1 equals b2, which you can do by showing the negation of b1 == b2 is unsatisfiable. Here's an example showing how to do this in Z3Py, and you can use basically the same steps in the .NET API: http://rise4fun.com/Z3Py/M4R1 x1, x2 = Reals('x1

Z3 Installation issue on windows 10

寵の児 提交于 2019-12-12 01:16:42
问题 I am trying to install Z3 package(https://github.com/Z3Prover/z3.git) I ran the following commands ./configure cd build make make install Installation was successfull. However when i run Ocamlfind list z3 component is not listed. So when i try to build my project which uses z3 , its failing with error ocamlfind: Package `Z3' not found. I did the following workarounds, a) added the z3.exe location to path b) I ran the following python command, but i got an error message saying its not able to

Measure and bound time spent in arithmetic sub-solvers

我是研究僧i 提交于 2019-12-12 00:32:05
问题 Q1: Is it possible to query the times Z3 spent in different sub-solvers? Calling (get-info :all-statistics) gives the overall run time of Z3, but I would like to break it down into individual sub-solvers. I am particularly interested in the time spent in arithmetic-related sub-solver, more precisely, in those that give rise to the statistics grobner and nonlinear-horner . Q2: Furthermore, is it possible to put a timeout on sub-solver? I could imagine something like defining a timeout per

integer division gives incorrect result

倖福魔咒の 提交于 2019-12-11 21:30:04
问题 I try to check satisfiability of x div y == 2 and x / y == 2 but got incorrect results both times. Looks like Z3 doesn't support these yet ? (declare-fun x () Int) (declare-fun y () Int) (assert (= (div x y ) 2)) (check-sat) (get-model) (exit) sat (model (define-fun y () Int 0) (define-fun x () Int 38) ) (declare-fun x () Int) (declare-fun y () Int) (assert (= (/ x y ) 2)) (check-sat) (get-model) (exit) sat (model (define-fun y () Int 0) (define-fun x () Int 1) ) 回答1: Integer division is