I want to generate expression trees that have "reverse" references from child to parent. Is there a way to customize the Proto generator or domain so that the expression wrapper class (using proto::extends<>
) contains a reference to the parent expression?
The goal behind this is to create expression trees that cache evaluated results, so that they can be re-evaluated efficiently. My strategy is to update terminal values, and then walk up the tree marking parent nodes as "dirty" so that they will be re-evaluated when the root expression is evaluated.