Skip to content

Datatype declarations: Trying to get cvc4 and z3 to agree #2135

@LeventErkok

Description

@LeventErkok

@ajreynol

I'm having issues generating code that is good for both z3 and cvc4. I raised this in the cvc4 repo, and it seems perhaps this is a z3 problem:

cvc5/cvc5#2832

The crux of the issue seems to be the following:

(set-option :produce-models true)
(set-logic ALL)
(declare-datatypes ((SBVEither 2)) ((par (T1 T2)
                                    ((left_SBVEither  (get_left_SBVEither  T1))
                                     (right_SBVEither (get_right_SBVEither T2))))))

(declare-fun s0 () (_ BitVec 8))
(define-fun s1 () (SBVEither (_ BitVec 8) (_ BitVec 8)) (as (left_SBVEither s0) (SBVEither (_ BitVec 8) (_ BitVec 8))))
(check-sat)
(get-model)

CVC4 is OK with this, but z3 says:

(error "line 8 column 61: invalid indexed identifier, '_' expected")

I think CVC4 is right here; but I've been bitten by these syntax problems before so would appreciate some feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions