z3 - How to simplify the result of (eval (f x y))? -


how can simplify boolean expression obtained result of evaluating uninterpreted function? instance, in example: http://rise4fun.com/z3/g8sl,

(eval (f x y))  

yields (not (and (not x) (not y)))

i want instead expression (or x y).

(simplify (eval (f x y))  

gives error.

this not supported in smt-lib 2.0 front-end. should consider 1 programmatic front-ends z3. example, here how using z3 python front-end (also available here):

b = boolsort() f = function('f', b, b, b) x, y = bools('x y') b1, b2 = bools('b1 b2')  s = solver() s.add(forall([b1, b2], implies(or(b1, b2), f(b1, b2)))) s.add(exists([b1, b2], not(f(b1, b2))))  print(s.check()) m = s.model() print(m.evaluate(f(x, y))) print(simplify(m.evaluate(f(x, y)), elim_and=true)) 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -