1

The following SMT folumas pass Z3 constraint solving while CVC4 flags an parsing error: "Symbol 'None' previously declared as a variable". I have tested using both CVC4 1.4 and CVC 1.5 on windows. Any suggestions or thoughts?

(set-logic ALL)
(declare-datatypes () ((Enum13 (Green) (Yellow) (None))))
(declare-datatypes () ((Enum0 (True) (False) (None))))
(declare-datatypes () ((Enum9 (Star_3) (Star_2) (Star_1) (None))))
(declare-fun Decomp
             (Enum9 Enum13 Enum0)
             Enum13)
(declare-fun var_36 () Enum0)
(declare-fun var_37 () Enum13)
(declare-fun var_71 () Enum9)
(declare-fun var_38 () Enum13)
(declare-fun var_31 () Real)
(assert (and true
     true
     true
     (= var_38
        (Decomp var_71 var_37 var_36))))
(assert (>= var_31 0.0))
(assert (<= var_31 700.0))
(check-sat)
Cherry
  • 21
  • 1

1 Answers1

0

CVC4 does not accept datatype definitions where the names of constructors are duplicated. So, "None" cannot be both a Enum13, Enum0, and Enum9. Instead you could use unique names like None13, None0, None9 and CVC4 would not give a syntax error.

Btw, the latest version of CVC4 accepts SMT LIB 2.6 by default, where the format for datatypes is bit different: http://smtlib.cs.uiowa.edu/papers/smt-lib-reference-v2.6-r2017-07-18.pdf To use the old format you can still use --lang=smt2.5

Hope this helps, Andy

  • Thanks for the answer. However, this does not look like an intuitive and efficient way to declare an enumerated type. Will this be considered as a limitation of CVC4 compared to Z3? – Cherry Aug 23 '17 at 02:22