egraphs-good / eggcc

MIT License
42 stars 8 forks source link

ContextOf (propagates contexts up from leaves) #436

Closed kirstenmg closed 5 months ago

kirstenmg commented 5 months ago

Like ExprHasRefId or IdOf, ContextOf propagates context information up from leaves in the current context, so we know the context of an expression. We do not need a ListExpr version of ContextOf, as the only ListExpr child in the schema is of Switch; Switch takes its context from its predicate rather than its branches.

This PR contains some commented-out code that checks that one expression doesn't get two nonequivalent contexts, since it is not certain whether that's a problem.