Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make lambda lifting correct when free variables occur in the types of binders #1609

Conversation

janmasrovira
Copy link
Collaborator

@janmasrovira janmasrovira commented Nov 7, 2022

Closes #1584.

This pr includes:

  • Types in binders are handled properly during lambda lifting.
  • When closing a term, we also take into account free variables that occur in the binders.
  • Binder list is now implemented as a list. Some useful functions have been added (e.g. to perform multiple lookups in a row)
  • Some extra PrettyCode instances that can be useful for debugging.

@janmasrovira janmasrovira added fix:bug core Related to JuvixCore labels Nov 7, 2022
@janmasrovira janmasrovira self-assigned this Nov 7, 2022
@janmasrovira janmasrovira added the enhancement New feature or request label Nov 7, 2022
@janmasrovira janmasrovira marked this pull request as ready for review November 7, 2022 18:02
@lukaszcz lukaszcz force-pushed the 1584-make-lambda-lifting-correct-when-free-variables-occur-in-the-types-of-binders branch from 388ed1d to ce599e1 Compare November 8, 2022 08:29
Copy link
Collaborator

@lukaszcz lukaszcz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crashes, unfortunately. I added a test which should help in finding the bug.

src/Juvix/Compiler/Core/Extra.hs Outdated Show resolved Hide resolved
src/Juvix/Compiler/Core/Extra.hs Show resolved Hide resolved
@lukaszcz lukaszcz force-pushed the 1584-make-lambda-lifting-correct-when-free-variables-occur-in-the-types-of-binders branch from 88c29a8 to 4f1cbb2 Compare November 9, 2022 12:02
@janmasrovira janmasrovira merged commit aa00d34 into main Nov 9, 2022
@janmasrovira janmasrovira deleted the 1584-make-lambda-lifting-correct-when-free-variables-occur-in-the-types-of-binders branch November 9, 2022 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to JuvixCore enhancement New feature or request fix:bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make lambda-lifting correct when free variables occur in the types of binders
2 participants