mirror of
https://github.com/powdr-labs/powdr.git
synced 2026-04-20 03:03:25 -04:00
This PR move the `ExpressionEvaluator` to `executor-utils` and generalizes it such that it can evaluate an `AlgebraicExpression<T>` to any type, not just `T`. This makes it possible to use the evaluator in the backends. I used it in Plonky3 and Stwo, which leads to significant code deletion. The main feature of `ExpressionEvaluator` is that it handles intermediate polynomials by caching during evaluation. This is cheaper than using `Analyzed::identities_with_inlined_intermediate_polynomials`, which might build exponentially large expressions. The Plonky3 implementation already did the same; The stwo implementation still used `identities_with_inlined_intermediate_polynomials()` and now handles intermediates properly.