pub fn normalize(expr: &AlgExpr) -> AlgExprExpand description
Produce a canonical form for expr:
- For commutative
AddandMul, sort the operand string representations so thata + bandb + aboth become the same canonical form. - Flatten nested
Add(Add(a,b),c)→Add(a, Add(b,c)). - Flatten nested
Mul(Mul(a,b),c)→Mul(a, Mul(b,c)).