Skip to content

Segfault with ill-founded datatype definition #7432

Closed
@bclement-ocp

Description

@bclement-ocp

Z3 (4.13.3) crashes with a segmentation fault on the following file:

$ cat wf.smt2
(set-logic ALL)

(declare-datatypes ((list 1) (tree 0)) ((par (alpha) (
  (nil)
  (cons (head alpha) (tail (list alpha)))
))

(
  (treeqtmk (elem Int) (children (list tree)) (rank Int) )
)))
$ ~/Downloads/z3-4.13.3-x64-glibc-2.35/bin/z3 wf.smt2 
Segmentation fault (core dumped)

The file should be rejected according to the current SMT-LIB criterion, but I would expect it to be accepted given that the following non-mutually-recursive definition is accepted:

$ cat wf2.smt2
(set-logic ALL)

(declare-datatypes ((list 1)) ((par (alpha) (
  (nil)
  (cons (head alpha) (tail (list alpha)))
))))

(declare-datatypes ((tree 0)) ((
  (treeqtmk (elem Int) (children (list tree)) (rank Int))
)))

$ ~/Downloads/z3-4.13.3-x64-glibc-2.35/bin/z3 wf2.smt2 

$ echo $?
0

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