OCamlPro / alt-ergo

OCamlPro public development repository for Alt-Ergo
https://alt-ergo.ocamlpro.com/
Other
126 stars 33 forks source link

Simple ADTs with a single constructor are records #1146

Closed Halbaroth closed 1 month ago

Halbaroth commented 1 month ago

This PR fixes a bug in D_cnf that have been exposed by #1130. Before merging Enum into ADT the situation was as follows:

The last corner case includes a corner corner case: an ADT with a single constructor without payload (so basically the unit type with an extra step...)

The D_cnf included a bug. It produced single constructors without payload of type ADT instead of type record but the check done in is_mine_symb prevented from sending it to Adt. As I removed this check, we got an assert on the following input:

(set-logic ALL)
(declare-datatype t ((Record)))
(define-fun a () t Record)
(check-sat)

After this patch, the situation is as follows: