Skip to main content

Module simplify

Module simplify 

Source
Expand description

Predicate-simplification pass.

Rewrites Filter predicates to a simpler, semantically-equivalent form:

  • Boolean-algebra identities (x AND TRUE → x, x AND FALSE → FALSE, …)
  • Constant numeric comparison folding (1 = 1 → TRUE)
  • De-Morgan / NOT-elimination (NOT(NOT x) → x, NOT(a < b) → a >= b)
  • Idempotence (x AND x → x)
  • Complement laws (x AND NOT x → FALSE, x OR NOT x → TRUE)
  • Single-element IN folding (a IN (1) → a = 1)
  • Per-column range coalescing across conjuncts (a > 5 AND a > 3 → a > 5, a > 10 AND a < 5 → FALSE)
  • Equality dominance (a = 5 AND a > 3 → a = 5)

Structs§

PredicateSimplification
Simplify predicates in Filter and Join nodes to their canonical form.