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

Unify flatten_*op rules into flatten_generic #585

Merged
merged 3 commits into from
Jan 12, 2025
Merged

Conversation

ozgurakgun
Copy link
Contributor

Any reason not to do this? @niklasdewally

@niklasdewally
Copy link
Collaborator

niklasdewally commented Jan 10, 2025

LGTM! There is also flatten_eq, but I think that staying as is is ok.

On the topic, we could probably remove flatten_minuseq, and flatten those instead using flatten_generic and flatten_eq, with neg as a unop.

Should be trivial (we have introduction rules for minuseq as well), but might be a job for a seperate PR.

@niklasdewally
Copy link
Collaborator

niklasdewally commented Jan 10, 2025

LGTM! There is also flatten_eq, but I think that staying as is is ok.

On the topic, we could probably remove flatten_minuseq, and flatten those instead using flatten_generic and flatten_eq, with minus as a unop.

Should be trivial (we have introduction rules for minuseq as well), but might be a job for a seperate PR.

@ozgurakgun I've pushed a commit for this onto this PR

@niklasdewally niklasdewally self-requested a review January 10, 2025 22:58
Instead, use `flatten_generic` to flatten `Neg` expressions, and
`introduce_minuseq_from_aux_var` and `introduce_minuseq_from_eq` to
create FlatMinusEq expressions.

This is consistent with other expressions, which have simpler
introduction functions that expect flat input, and rely on
`flatten_generic` to make the input flat.
@ozgurakgun ozgurakgun merged commit e012905 into main Jan 12, 2025
14 checks passed
@ozgurakgun ozgurakgun deleted the unify-flatten branch January 12, 2025 19:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants