Z3

Z3 python treats x**2 different than x*x?

本小妞迷上赌 提交于 2019-12-10 15:55:40
问题 It seems that Z3 Python interface doesn't like the ** operator , it can deal with x*x but not x**2 as shown in the example below >>> x,y = x,y=Reals('x y') >>> z3.prove(Implies(x -6 == 0,x**2 -36 == 0)) failed to prove [x = 6] >>> z3.prove(Implies(x -6 == 0,x*x -36 == 0)) proved 回答1: You are probably using version 4.3.0 on Linux or OSX. Version 4.3.0 has a configuration problem on these platforms. If that is the case, I suggest you download version 4.3.1. Version 4.3.1 will prove both queries

Exactly what quantifiers is SMT complete for?

北城余情 提交于 2019-12-10 14:57:06
问题 I've been looking at various SMT solvers, mainly Z3, CVC4, and VeriT. They all have vague descriptions of their ability to solve SMT problems with quantifiers. Their documentation is primarily example based (Z3), or consists of academic papers, describing possible changes that may or may not actually be implemented. I know that there are decidable fragments of First-order logic, such as: Finitely-bounded quantifiers Monadic first-order logic What I'd like to know is, which (if any) classes of

Quantifier in Z3

﹥>﹥吖頭↗ 提交于 2019-12-10 14:52:58
问题 Basically, I want to ask Z3 to give me an arbitrary integer whose value is greater than 10. So I write the following statements: (declare-const x (Int)) (assert (forall ((i Int)) (> i 10))) (check-sat) (get-value(x)) How can I apply this quantifier to my model? I know you can write (assert (> x 10)) to achieve this. But I mean I want a quantifier in my model so every time I declare an integer constant whose value is guaranteed to be over 10. So I don't have to insert statement (assert (> x 10

How to hide variable with Z3

十年热恋 提交于 2019-12-10 14:49:36
问题 Say I have t1<x and x<t2 is it possible to hide variable x so that t1<t2 in Z3? 回答1: You can use quantifier elimination for doing that. Here is an example: (declare-const t1 Int) (declare-const t2 Int) (elim-quantifiers (exists ((x Int)) (and (< t1 x) (< x t2)))) You can try this example online at: http://rise4fun.com/Z3/kp0X 回答2: Possible solution using Redlog of Reduce: 来源: https://stackoverflow.com/questions/11625388/how-to-hide-variable-with-z3

Z3: Performing Matrix Operations

 ̄綄美尐妖づ 提交于 2019-12-10 14:36:23
问题 My Situation I'm working on a project which needs to: Prove the correctness of 3D matrix transformation formulas involving matrix operations Find a model with the values of the unknown matrix entries. My Question What's the best way to express formulas using matrix operations so that they can be solved by z3 ? (The way used in Z3Py's Sudoku Example isn't very elegant and doesn't seem suitable for more complex matrix operations.) Thanks. - If anything's unclear, please leave a question comment

What is the reason behind the warning message in Z3: “failed to find a pattern for quantifier (quantifier id: k!18) ”

两盒软妹~` 提交于 2019-12-10 13:43:38
问题 I find an issue as shown in the following simple SMT-LIB program. The SMT-LIB code: (declare-fun isDigit (Int) Bool) (assert (forall ((x Int)) (=> (isDigit x) (and (>= x 0) (< x 10)) ) ) ) (assert (forall ((x Int)) (=> (and (>= x 12) (< x 15)) (exists ((y Int)) (and (>= y 1) (< y 6) (isHost (- x y)) ) ) ) ) ) (check-sat) (get-model) This gives the following warning: WARNING: failed to find a pattern for quantifier (quantifier id: k!18) sat ........ ........ I am wondering about the warning

Traversing Z3_ast tree in C/C++

Deadly 提交于 2019-12-10 12:46:43
问题 In short, I need to be able to traverse Z3_ast tree and access the data associated with its nodes. Cannot seem to find any documentation/examples on how to do that. Any pointers would be helpful. At length, I need to parse smt2lib type formulae into Z3, make some variable to constant substitutions and then reproduce the formula in a data structure which is compatible with another unrelated SMT sovler (mistral to be specific, I don't think details about mistral are important to this question

Error with z3.dll

纵然是瞬间 提交于 2019-12-10 12:09:07
问题 I try to use Z3 Prover for a university project in C# but when I start to create a Context Object I get this Error: System.DllNotFoundException: Die DLL "z3.dll": Das angegebene Modul wurde nicht gefunden. (Ausnahme von HRESULT: 0x8007007E) kann nicht geladen werden. bei Microsoft.Z3.Native.LIB.Z3_del_context(IntPtr a0) bei Microsoft.Z3.Context.Finalize() bei Microsoft.Z3.Native.LIB.Z3_del_context(IntPtr a0) bei Microsoft.Z3.Context.Finalize() Is here anyone, who knows a solution? Thankyou!

Z3py: print large formula with 144 variables

会有一股神秘感。 提交于 2019-12-10 10:47:08
问题 I use the Z3 theorem prover and I have a large formula (114 variables). Can I print a large formula with all clauses? A normal print str(f) truncates the output, and only "..." is printed at the end, not all the clauses. I tested print f.sexpr() and this always prints all the clauses. However only in the sexpr syntax. Can I print all the clauses of a formula but avoid the s-expression syntax? Note: the code example is much to small to show the problem, but posting a large formula takes too

Using theory plugins with solvers

流过昼夜 提交于 2019-12-10 10:11:37
问题 Recent versions of Z3 have decoupled the notions of Z3_context and Z3_solver . The API mostly reflects these changes; for instance push is deprecated on contexts and respecified as taking a solver as an extra argument. The interface for theories has not been updated, however. Theories are still created from contexts, and as far as I can tell, never explicitly attached to solvers. One could think that a theory created from a context will always be attached to all solvers created from the