theorem proving - Z3 will not case split on hand-crafted data types -


i have defined own booleans, called boolean smt2, , and function boolean_and on them. conjecture , commutative:

(declare-sort boolean) (declare-const sk_x boolean) (declare-const sk_y boolean) (declare-const boolean_false boolean) (declare-const boolean_true boolean) (declare-fun boolean_and (boolean boolean) boolean)  ;; axiomatize booleans: false /= true , every bool true or false (assert (forall ((x boolean)) (or (= x boolean_false)                                   (= x boolean_true))))  (assert (not (= boolean_false boolean_true)))  ;; definition of , (assert (forall ((a boolean)) (= (boolean_and boolean_false a) boolean_false))) (assert (forall ((a boolean)) (= (boolean_and boolean_true a) a)))  ;; try prove , commutative (assert (not (= (boolean_and sk_x sk_y)                 (boolean_and sk_y sk_x))))  (check-sat) 

however, z3 reports unknown on problem after while, though thought should able use case split assertions on skolemised variables sk_x , sk_y.

curiously, if remove boolean axiomatization , replace declare-datatypes, z3 report unsat:

(declare-datatypes () ((boolean (boolean_true) (boolean_false))))  (declare-const sk_x boolean) (declare-const sk_y boolean) (declare-fun boolean_and (boolean boolean) boolean)  (assert (forall ((a boolean)) (= (boolean_and boolean_false a) boolean_false))) (assert (forall ((a boolean)) (= (boolean_and boolean_true a) a)))  (assert (not (= (boolean_and sk_x sk_y)                 (boolean_and sk_y sk_x))))  (check-sat) 

what doing wrong? how can z3 case split using axiomatization?

you not doing wrong. official release (v4.3.1) may fail on problems containing cardinality constraints such as

(assert (forall ((x boolean)) (or (= x boolean_false)                                   (= x boolean_true)))) 

this constraint asserting uninterpreted sort boolean has @ 2 elements. fixed problem. fix available in unstable branch. here instructions on how compile unstable branch. tomorrow, nightly builds contain fix.


Comments

Popular posts from this blog

sql - VB.NET Operand type clash: date is incompatible with int error -

SVG stroke-linecap doesn't work for circles in Firefox? -

python - TypeError: Scalar value for argument 'color' is not numeric in openCV -