[IR] Normalize guards in conjunctive normal form
Closed this issue · 2 comments
joroKr21 commented
The following transformations of guards can improve join combination. Consider boolean expressions returned in guards:
- Eliminate double negation (
!!x => x
); - Move negation inside conjunction / disjunction (
!(x || y) => !x && !y
) - Distribute disjunction over conjunction (
(x && y) || z => (x || z) && (y || z)
) - Split guards that return a conjunction in two guards. Repeat from 1. in sub-guards.
MatchEquiJoin
should collect all guards of the formf(x) == g(y)
and emitk(x) = (f1(x), ... fn(x))
i.e. the join with largest possible selectivity.
aalexandrov commented
aalexandrov commented
Resolved via #363.