forked from OCamlPro/alt-ergo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simple ADTs with a single constructor are records (OCamlPro#1146)
* Simple ADTs with a single constructor are records This PR fixes a bug in `D_cnf` that have been exposed by OCamlPro#1130. Before merging `Enum` into `ADT` the situation was as follows: - simple ADT with several constructors and with at least one payload was sent to the `Adt` theory - simple ADT with several constructors but no payload was sent to `Enum` theory - simple ADT with a single constructor was sent to the `Record` theory. 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: ```smt2 (set-logic ALL) (declare-datatype t ((Record))) (define-fun a () t Record) (check-sat) ``` After this patch, the situation is as follows: - simple ADT with several constructors is sent to the `Adt` theory - simple ADT with only one constructor is sent to the `Record` theory - mutually recursive ADT whose all the types are record is sent to the `Record` theory
- Loading branch information
Showing
10 changed files
with
530 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.