Provide simple axioms to Z3 -


is there way tell z3 logical axiom might applicable in situation? example, p(x) ==> \exists x p(x) valid. if p complicated enough, z3 can confused , unknown.

(declare-const size int) (declare-const h (array int int)) (assert  (forall ((j int) (k int)) (=> (and (<= 0 k) (< k size) (<= 0 j) (< j size) (not (= k j))) (not (= (select h j) (select h k)))))) (assert (not (exists ((g (array int int))) (forall ((j int) (k int)) (=> (and (<= 0 k) (< k size) (<= 0 j) (< j size) (not (= k j))) (not (= (select g j) (select g k)))))))) (check-sat) 

the first assertion says h array maps distinct integers 0..size-1 distinct integers. , second assertion says such array cannot exist. can simple valid axioms such p(x) ==> \exists x p(x) provided in smt files z3? might have misunderstood happening in example. according limited understanding, z3 might succeed in proving formula unsat if instantiates axiom mentioned.

this seems triggering problem, i.e., z3 not instantiate existentially quantified axiom (and not universally quantified one). have @ following simplified example:

(set-option :auto_config false) (set-option :smt.mbqi false)  (declare-fun f (int) bool)  (assert (forall ((x int))   (=> (<= 0 x) (f x)) ))  (assert (not (exists ((x int))   (=> (<= 0 x) (f x)) )))  ; (assert (f -10))  (check-sat) 

z3 (version 4.3.2, 64 bit, build hashcode 96f4606a7f2d) reports unknown, if uncomment last assertion, reports unsat. assume pattern z3 infers both axioms :pattern ((f x)), means, f x must syntactically occur before axioms can instantiated.

you can read more quantifier patterns in z3 guide.


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -