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

Bugfix: normalize SAW core types when necessary to type elimination forms #1426

Merged
merged 1 commit into from
Aug 24, 2021

Conversation

eddywestbrook
Copy link
Contributor

This fix addresses issue #1420, where the type-checker does not normalize the types of globals when it tries to type-check applications or pair or record projections. For example, the definitions

FunType : (a b:sort 0) -> sort 0;
FunType a b = a -> b;

myId : FunType Nat Nat;
myId x = x;

applyId : Nat -> Nat;
applyId x = myId x;

will fail to type-check, because the type of myId is not normalized to a function type when myId is applied to x.

The fix is to update calls to recognizers asSort, asPi, asPairType, and asRecordType in the type-checker so that the types passed to these recognizers are normalized when the recognizers fail.

… to match a given recognizer; this ensures that globals with non-normalized types (e.g., with types that are computed) which evaluate to function, pair, or record types can still be eliminated via applications or the appropriate projections, respectively
Copy link
Contributor

@brianhuffman brianhuffman left a comment

Choose a reason for hiding this comment

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

Looks good

@eddywestbrook eddywestbrook added the ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully. label Aug 24, 2021
@eddywestbrook eddywestbrook merged commit 4222c6e into master Aug 24, 2021
@mergify mergify bot deleted the bugfix-normalize-elim-types branch August 24, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge If at least one person approves this PR, automatically merge it when CI finishes successfully.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants