ninehusky / chompy

chomp
0 stars 0 forks source link

Find elegant way to encode conditional equalities #14

Open ninehusky opened 2 hours ago

ninehusky commented 2 hours ago

We need a way of creating what essentially behave as "kind of e-classes"; ways of relating two eclasses together so that we don't re-explore equivalence between two e-classes when not needed.

ninehusky commented 2 hours ago

I've kind of already started on this -- the cond-equal relation links terms together. Now, we need to implement something where if two cvecs don't match, before checking masks/predicates, we can check for the existence of (cond-equal term1 term2).

ninehusky commented 1 hour ago

wait this title is a duplicate of #15. What I actually mean by this is we need to do more than this -- we need to (1) implement this check in the cvec matching process, and (2) use it to generate Egglog rules which conditionally rewrite.

The tricky thing with (2) is that we need to go from some predicate language (represented in Egglog) to actual egglog code operating over terms. This is not critical for #7 afaict.