def _finalize(self, cluster, *args, **kwargs): """ Finalize the DSE output: :: * Pow-->Mul. Convert integer powers in an expression to Muls, like a**2 => a*a. * Freezing. Make sure that subsequent SymPy operations applied to the expressions in ``cluster.exprs`` will not alter the effect of the DSE passes. """ exprs = [pow_to_mul(e) for e in cluster.exprs] return cluster.rebuild([freeze(e) for e in exprs])