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

Remove normalization tests for Sort? #1106

Open
ocharles opened this issue Nov 20, 2020 · 8 comments
Open

Remove normalization tests for Sort? #1106

ocharles opened this issue Nov 20, 2020 · 8 comments

Comments

@ocharles
Copy link
Member

ocharles commented Nov 20, 2020

My understanding is normalisation is only defined in the context of well-typed expressions, but Sort doesn't have a type, so it's meaningless to ask for its normal form. Due to this, my test suite is currently stuck on dhall-lang/tests/normalization/success/unit/SortA.dhall, and I'm not sure how to proceed.

@ocharles ocharles changed the title Remove normalization tests for sort? Remove normalization tests for Sort? Nov 20, 2020
@Nadrieril
Copy link
Member

Nadrieril commented Nov 20, 2020

I just skip it. The test alpha-normalization/success/unit/FunctionNestedBindingXXFreeA.dhall is similar: it's not well-typed but might be useful for an implementation anyways.

@Gabriella439
Copy link
Contributor

My suggestion is:

  • Remove the SortA.dhall test

    It doesn't add much value, in my opinion

  • Make the FunctionNestedBindingXXFreeA.dhall type-correct

@Nadrieril
Copy link
Member

Nadrieril commented Nov 21, 2020

FunctionNestedBindingXXFreeA.dhall cannot be made type-correct. It's point is to check for the correct handling of free variables, for implementations that support that. dhall-rust used to support that, and this was a very useful test to have.

@Gabriella439
Copy link
Contributor

Oh yeah, good point. Never mind

@ocharles
Copy link
Member Author

ocharles commented Nov 22, 2020

Edit: sorry, ignore this comment. It was about type-inference tests, but this issue is about normalization tests.

@ocharles
Copy link
Member Author

So, just to wrap this one up, am I OK to submit a PR removing SortA.dhall? That at least solves my problem with the beta-equivalence tests.

@sjakobi
Copy link
Collaborator

sjakobi commented Nov 22, 2020

https://github.com/dhall-lang/dhall-lang/blob/master/standard/beta-normalization.md#constants specifies how to normalize Sort. So I think the test is useful for implementations that can handle it.

If it's important to separate the ill-typed test cases, maybe we can keep them separately in normalization/success/ill-typed.

@Nadrieril
Copy link
Member

I'd also add that the current type inference rules ensure that the resulting type is normalized. Since Sort is a possible such output, being able to normalize Sort is sensible

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

No branches or pull requests

4 participants