While Cozy's IR does have an ELet node type that is fully supported by many parts of the code, the synthesizer does not generate code containing ELet nodes. Supporting ELet may allow the synthesizer to generate much better code in some cases by factoring out re-used variables.
This change will require:
[x] Add support for ELet to contexts.py
[x] Update the cost model to support ELet intelligently (properties of the bound variable should be available when estimating cost in the body)
[x] Enumerate ELet expressions in enumeration.py
[x] Add a test ensuring that the synthesizer can discover and use ELet expressions
While Cozy's IR does have an
ELet
node type that is fully supported by many parts of the code, the synthesizer does not generate code containingELet
nodes. SupportingELet
may allow the synthesizer to generate much better code in some cases by factoring out re-used variables.This change will require:
ELet
tocontexts.py
ELet
intelligently (properties of the bound variable should be available when estimating cost in the body)ELet
expressions inenumeration.py
ELet
expressions