Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify is_mine_symb #1130

Merged
merged 1 commit into from
Jun 12, 2024
Merged

Conversation

Halbaroth
Copy link
Collaborator

The argument ty of is_mine_symbol was only used by
Enum and Adt theories because they shared the Construct symbol.
As we merged these theories, we can remove this argument now.

This PR is rebased on #1094

@Halbaroth Halbaroth changed the title Simplify is mine symb Simplify is_mine_symb May 21, 2024
@Halbaroth Halbaroth force-pushed the simplify-is_mine_symb branch from 1a86a93 to 2ca94c2 Compare May 23, 2024 13:26
@Halbaroth Halbaroth marked this pull request as ready for review May 23, 2024 13:26
@Halbaroth Halbaroth requested a review from bclement-ocp June 12, 2024 13:03
@bclement-ocp
Copy link
Collaborator

@Halbaroth Please rebase

@Halbaroth
Copy link
Collaborator Author

ah we have the same request :)

@Halbaroth Halbaroth force-pushed the simplify-is_mine_symb branch from 2ca94c2 to e843595 Compare June 12, 2024 13:09
@Halbaroth
Copy link
Collaborator Author

Done

The argument `ty` of `is_mine_symbol` was only used by
`Enum` and `Adt` theories because they shared the `Construct` symbol.
As we merged these theories, we can remove this argument now.
@Halbaroth Halbaroth merged commit 85308d4 into OCamlPro:next Jun 12, 2024
14 checks passed
Halbaroth added a commit to Halbaroth/alt-ergo that referenced this pull request Jun 15, 2024
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
Halbaroth added a commit to Halbaroth/alt-ergo that referenced this pull request Jun 15, 2024
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
Halbaroth added a commit that referenced this pull request Jun 18, 2024
* Simple ADTs with a single constructor are records

This PR fixes a bug in `D_cnf` that have been exposed by #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
@bclement-ocp bclement-ocp added this to the 2.6.0 milestone Jul 11, 2024
Halbaroth added a commit to Halbaroth/alt-ergo that referenced this pull request Jul 24, 2024
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants