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

Rework elaboration #136

Merged
merged 15 commits into from
Dec 23, 2024
Merged

Rework elaboration #136

merged 15 commits into from
Dec 23, 2024

Conversation

rossberg
Copy link
Collaborator

@rossberg rossberg commented Dec 23, 2024

This PR reworks substantial parts of the EL-to-IL elaborator. Most importantly, it replaces the previous ad-hoc uses of backtracking with a more systematic approach that allows more programs to type-check as expected. Error messages now provide information about which alternatives have been tried.

In IL and AL, the PR adds an expression form LiftE e, which lifts a t? to a t*.

The PR also introduces a new EL expression form [e] for expressing lists. It is equivalent to a singleton e implicitly injected into list type, but with more restrictive type checking. It can be use to disambiguate multi-nested expressions in a way that was previously impossible. For example, a [i*]* : nat** can now be distinguished from [i]** : nat**.

I'd like to do further improvements and clean-ups as follow-ups, but this PR should be useful already.

@rossberg rossberg merged commit e2d79d4 into main Dec 23, 2024
9 checks passed
@rossberg rossberg deleted the elab-redo.2 branch December 23, 2024 16:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant