Z3

Issues with utilizing Z3 for MAX-SAT

巧了我就是萌 提交于 2020-01-13 17:46:09
问题 I am interested in MAX-SAT and was hoping Z3 would have this as a built-in feature. Are there any plans to do this in the near future? In the absence of the above, I have tried using the example maxsat application from the command line. Unfortunately, whenever I do exec.sh "filename.z3", I always get the following response: "checking whether hard constraints are satisfiable...result: 0". What am I doing wrong? I assure you that this response appears to be quite independent of the actual

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

Z3_parse_smtlib_string usage issues

◇◆丶佛笑我妖孽 提交于 2020-01-11 07:15:16
问题 In the following code, I put a clearly unsatisfiable Z3 declaration and then try to use the C++/C Z3 APIs to see it programmatically solved. The problem is that this code always triggers the check that outputs: "SAT?!". i.e. the clearly unsatisfiable expression is determined to be satisfiable in the current usage of the API calls. How can I get this kind of operation to work as expected? #include "z3++.h" int main(){ z3::context c; std::string testing = "(declare-const p0 Bool)(assert(= p0

Z3 with string expressions

狂风中的少年 提交于 2020-01-10 05:32:08
问题 I'm trying to use Z3 to determine if an expression is satisfiable. I could easily do this by defining the context then the int_const variables and the formula. To evaluate an expression programmatically you would have to write everything in code. Let's say the logical expression is given in the form of a string, what then? For example, "x == y && !x == z" would be expressed in the C API as: context c; expr x = c.int_const("x") //Same for other variables ... formula = (x == y) && (!x == z);

Solver timeout within loop using z3 Python API

痞子三分冷 提交于 2020-01-07 06:28:05
问题 Per an earlier suggestion, I'm trying to set early timeout for a solver while using z3Py. Again, without all the particulars, this is what I'm attempting: for bits in range(A, B, incrmt) s = Solver(); s.set("timeout", 30) #30, 3000, 30000, 60000 no change s.add(some constraints) if(s.check() == sat): print "Sat, %d," %(bits) else: print "Sat Unknown, %d," %(bits) break sys.stdout.flush() Essentially, timeout never occurs (even with ridiculously small times in ms). 回答1: Are you using Z3 on

Building custom theories in Z3

谁都会走 提交于 2020-01-07 06:27:09
问题 This question is a follow up to the following question. Procedural Attachment in Z3 I have a predicate (I use the name "heavier" in this case) over two integers that I need to evaluate using a custom algorithm. I have written the following piece of code to do it. But I see that the parameters that get passed into the function CMTh_reduce_app() are not actual integers, but consts of type integer. What I need is 2 integers, so that I can evaluate the predicate and return the result (The

Procedural Attachment in Z3

 ̄綄美尐妖づ 提交于 2020-01-06 19:47:12
问题 I am using z3py I have a predicate over two integers that needs to be evaluated using a custom algorithm. I have been trying to get it implemented, without much success. Apparently, what I need is a procedural attachment, which is now deprecated. Could anybody tell me how I might impelement this in z3py? I understand that it involves use of Tactics, but I am afraid I haven't managed to figure out how to use them. I wouldn't mind using the deprecated way either, as long as it works. 回答1: There

Error when building z3 on unix: cannot find -lrt

女生的网名这么多〃 提交于 2020-01-06 09:55:05
问题 During make, I get an error with: g++ -o bin/external/z3 obj/external/act_cache.o : : obj/external/smtlib_frontend.o obj/external/z3_log_frontend.o -lrt -lpthread -fopenmp -static The message is /usr/lib/ ..... /i586-suse-linux/bin/ld: cannot find -lrt followed by similar messages about -lpthread -lm -lc . 回答1: The problem may be the -static option. See the following thread: http://www.linuxforums.org/forum/programming-scripting/35135-cant-find-some-libraries.html The new build system for Z3

Error when building z3 on unix: cannot find -lrt

这一生的挚爱 提交于 2020-01-06 09:54:47
问题 During make, I get an error with: g++ -o bin/external/z3 obj/external/act_cache.o : : obj/external/smtlib_frontend.o obj/external/z3_log_frontend.o -lrt -lpthread -fopenmp -static The message is /usr/lib/ ..... /i586-suse-linux/bin/ld: cannot find -lrt followed by similar messages about -lpthread -lm -lc . 回答1: The problem may be the -static option. See the following thread: http://www.linuxforums.org/forum/programming-scripting/35135-cant-find-some-libraries.html The new build system for Z3

Error when building z3 on unix: cannot find -lrt

岁酱吖の 提交于 2020-01-06 09:54:05
问题 During make, I get an error with: g++ -o bin/external/z3 obj/external/act_cache.o : : obj/external/smtlib_frontend.o obj/external/z3_log_frontend.o -lrt -lpthread -fopenmp -static The message is /usr/lib/ ..... /i586-suse-linux/bin/ld: cannot find -lrt followed by similar messages about -lpthread -lm -lc . 回答1: The problem may be the -static option. See the following thread: http://www.linuxforums.org/forum/programming-scripting/35135-cant-find-some-libraries.html The new build system for Z3