mz_transform::analysis::equivalences

Trait ExpressionReducer

Source
pub trait ExpressionReducer {
    // Required method
    fn replace(&self, expr: &mut MirScalarExpr) -> bool;

    // Provided methods
    fn reduce_expr(&self, expr: &mut MirScalarExpr) -> bool { ... }
    fn reduce_child(&self, expr: &mut MirScalarExpr) -> bool { ... }
}
Expand description

A type capable of simplifying MirScalarExprs.

Required Methods§

Source

fn replace(&self, expr: &mut MirScalarExpr) -> bool

Attempt to replace expr itself with another expression. Returns true if it does so.

Provided Methods§

Source

fn reduce_expr(&self, expr: &mut MirScalarExpr) -> bool

Attempt to replace any subexpressions of expr with other expressions. Returns true if it does so.

Source

fn reduce_child(&self, expr: &mut MirScalarExpr) -> bool

Attempt to replace any subexpressions of expr’s children with other expressions. Returns true if it does so.

Implementations on Foreign Types§

Source§

impl ExpressionReducer for BTreeMap<&MirScalarExpr, &MirScalarExpr>

Source§

fn replace(&self, expr: &mut MirScalarExpr) -> bool

Perform any exact replacement for expr, report if it had an effect.

Source§

impl ExpressionReducer for BTreeMap<MirScalarExpr, MirScalarExpr>

Source§

fn replace(&self, expr: &mut MirScalarExpr) -> bool

Perform any exact replacement for expr, report if it had an effect.

Implementors§