pub trait SimplificationStrategy: Send + Sync {
// Required method
fn simplify(&self, args: &[Expression]) -> Expression;
// Provided methods
fn applies_to(&self, args: &[Expression]) -> bool { ... }
fn name(&self) -> &str { ... }
}Expand description
Simplification strategy for a specific function or function family
Implements pattern-based algebraic rewrites (e.g., log(x^n) → n*log(x)) Distinct from FunctionProperties which store declarative mathematical data.
Required Methods§
Sourcefn simplify(&self, args: &[Expression]) -> Expression
fn simplify(&self, args: &[Expression]) -> Expression
Provided Methods§
Sourcefn applies_to(&self, args: &[Expression]) -> bool
fn applies_to(&self, args: &[Expression]) -> bool
Check if simplification strategy applies to given arguments
Allows early rejection of inapplicable strategies