(e: Expression)
| 237 | } |
| 238 | |
| 239 | function leafCountOf(e: Expression): number { |
| 240 | if (!e.ops) return 1; |
| 241 | let n = 1; |
| 242 | for (const op of e.ops) n += leafCountOf(op); |
| 243 | return n; |
| 244 | } |
| 245 | |
| 246 | function negate(ce: ComputeEngine, e: Expression): Expression { |
| 247 | if (isNumber(e)) return e.neg().evaluate(); |