Closed jaccokrijnen closed 6 months ago
Note that the old definition of dead_code did not have this problem, but would require an extra lemma to be proven (that uniqueness and well_scopped imply a property similar to what we require to add in the new version of dead_code). Therefore, it doesn't seem simpler to revert to the old definition.
DeadCode2 needs different rules for LetRec, since its scoping has to be checked in all bindings of the resulting let term.
These rules are problematic for LetRec:
Because scoping in letrec is non-linear. For example:
We can construct a wrong post-term using
dc_keep_binding
and thendc_delete_binding
:Since x2 still appears in the RHS of x1.