pub fn negate_split_expr(expr: &PartitionExpr) -> Result<PartitionExpr>Expand description
Rewrites NOT(expr) into an equivalent PartitionExpr without introducing a unary NOT node.
Why this function exists:
PartitionExpronly models binary operators.- Cut logic needs
R AND NOT(S). - We therefore rewrite
NOT(S)into an equivalent binary-expression tree.
Rewrite rules:
- Atomic comparisons:
=<->!=<<->>=<=<->>><-><=>=<-><
- Boolean composition:
NOT(A AND B)=>NOT(A) OR NOT(B)NOT(A OR B)=>NOT(A) AND NOT(B)
Failure behavior:
- For
AND/OR, both sides must beOperand::Expr; otherwise returnsNoExprOperand. - Any unsupported shape bubbles up as an error and the caller degrades to no-split.