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

Destructive rewriting in egglog ? #411

Open
remi-delmas-3000 opened this issue Aug 9, 2024 · 1 comment
Open

Destructive rewriting in egglog ? #411

remi-delmas-3000 opened this issue Aug 9, 2024 · 1 comment

Comments

@remi-delmas-3000
Copy link

remi-delmas-3000 commented Aug 9, 2024

Hi, is there a notion of destructive rewrite rules in egglog ? i.e. rules that delete their antecedent from the e-class after they've been applied ?

Is deleting from an e-class cheap enough that this could be implemented as a new type of rule ?

Imagine applying negative normal form conversion through rewrite rules, where you'll want to push negations down using (not (and x y)) ~~> (or (not x) (not y)) and never look back, deleting (not (and x y) forever.

@saulshanabrook
Copy link
Member

Yes you can use delete or subsume. subsume is like delete, but it will leave the term in the database, but will never match on it again and you can't extract it. So it's useful if you want to make sure a term can never re-appear, whereas with delete you can re-add it later.

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

No branches or pull requests

2 participants