Z3Prover / z3

The Z3 Theorem Prover
Other
10.41k stars 1.47k forks source link

Wrong model given for formula on datatypes #1547

Closed jad-hamza closed 6 years ago

jad-hamza commented 6 years ago
(declare-datatypes () ((X A B)))

(declare-const x X)

(assert (not (is-A x))) 
(assert (not (is-B x)))

(check-sat)
(get-model)

This should be unsat but succeeds with:

sat
(model 
  (define-fun x () X
    B)
)
NikolajBjorner commented 6 years ago

We are moving to SMT-LIB2.6 versions of recognizers. For now, try the following:

 (declare-datatypes () ((X A B)))
 (declare-const x X)
 (assert (not ((_ is A) x))) 
 (assert (not ((_ is B) x)))
(check-sat)
jad-hamza commented 6 years ago

Thanks!