(ce: ComputeEngine, e: Expression)
| 229 | * arithmetic produces unfolded artifacts (e.g. `a + 0·b`). |
| 230 | */ |
| 231 | export function recanonicalize(ce: ComputeEngine, e: Expression): Expression { |
| 232 | if (e.symbol || !e.ops) return e; |
| 233 | return ce.function( |
| 234 | e.operator, |
| 235 | e.ops.map((o) => recanonicalize(ce, o)) |
| 236 | ); |
| 237 | } |
| 238 | |
| 239 | function leafCountOf(e: Expression): number { |
| 240 | if (!e.ops) return 1; |
no test coverage detected