curry.toolchain.flat2icurry.caselifting module
Case lifting, the third pass. It follows FlatCurry.CaseLifting of the
Curry package icurry with the default options: nested cases, lets, and
free declarations are lifted, and so is a case whose scrutinee is not a
variable.
The state carries the module name, the names of the original top-level functions, the functions made so far for the current top-level function, the name of that function, and one counter shared by all four kinds of generated functions. A generated name that collides with an original top-level name is skipped, and the counter still advances. A generated function is lifted itself before it is added, and it is added at the front of the list, so the output order is the reverse of the order of creation.
- curry.toolchain.flat2icurry.caselifting.lift_prog(prog)[source]
Lifts the nested cases, lets, and free declarations of a program.
- curry.toolchain.flat2icurry.caselifting.unbound_vars(e)[source]
The variables an expression does not bind, as the Curry
unboundVars. The walk runs on a stack of its own (utility.trampoline.trampoline()).