egraphs-good / egglog

egraphs + datalog!
https://egraphs-good.github.io/egglog/
MIT License
417 stars 46 forks source link

Proposal: Change `Set` to store an `Expr` as the first child #339

Open oflatt opened 7 months ago

oflatt commented 7 months ago

Right now, the representation of Action::Set looks like this: Set(Head, Vec<GenericAtomTerm<Leaf>>, GenericAtomTerm<Leaf>) While this is good because it disallows variables or literals as the left child to the set, it's bad because it makes it hard to map over set terms.

The map_exprs function is a bit inconsistent right now because it doesn't map over the first argument of Set.