0

I am trying experiment with CVC4 a bit.

(set-option :produce-models true)
(set-option :produce-assignments true)
(set-logic QF_UFDT)
(declare-datatypes ()
  (Color (Red) (Black))
)
(declare-const x C)
(declare-const y C)
(assert (not (= x y)))
(check-sat)
(get-value (x y))
(assert (distinct x y))
(check-sat)
(get-value (x y))

When I run this using CVC4 I am getting the following output

sat
((x R) (y R))
sat
((x R) (y R))

I am confused by this behaviour by this output. If I am asserting x and y should not be equal their values must be different right? Same is the case with distinct assertion. Is CVC4 treating x and y as two different "objects" and hence giving the output it is giving?

Minhaj Patel
  • 579
  • 1
  • 6
  • 21
ankitrokdeonsns
  • 638
  • 4
  • 18

1 Answers1

1

I don't see the same results. This is the message I get with the latest development version of CVC4 (http://cvc4.cs.stanford.edu/downloads/):

(error "Parse Error: stack.smt2:5.8: Sequence terminated early by token: 'Color'.

    (Color (Red) (Black))
     ^
")

There are a few syntax errors in your example, here is a corrected version:

(set-option :produce-models true)
(set-option :produce-assignments true)
(set-logic QF_UFDT)
(declare-datatypes () (
  (Color (Red) (Black))
))
(declare-const x Color)
(declare-const y Color)
(assert (not (= x y)))
(check-sat)
(get-value (x y))
(assert (distinct x y))
(check-sat)
(get-value (x y))

On this input, cvc4 with the option "--incremental" (which enables multiple queries), gives this response:

sat
((x Red) (y Black))
sat
((x Red) (y Black))

Hope this helps, Andy