Add test that the kernel checks relevances in Case binders#21883
Open
SkySkimmer wants to merge 1 commit intorocq-prover:masterfrom
Open
Add test that the kernel checks relevances in Case binders#21883SkySkimmer wants to merge 1 commit intorocq-prover:masterfrom
SkySkimmer wants to merge 1 commit intorocq-prover:masterfrom
Conversation
Before 6fae78c (8.17) relevance of Case binders was checked by checking the lambdas produced by expand_case. Before 0cfe16a (8.18) expand_case would use the relevance from the Case instead of from the inductive data (after it used the relevance from the inductive unsubstituted by the univ instance until 269daf2 (9.0)). If we had skipped 6fae78c the later patches would have introduced an inconsstency as typechecking would have trusted the Case relevances, but they would be used in conversion. I think it's worth a test to ensure we don't introduce this possible bug by mistake. To make testing practical the check is turned into a regular error instead of assert failure.
9bbdf28 to
8749a74
Compare
Contributor
|
Can you add the check there as well? Lines 314 to 316 in 5a4f0c2 (maybe the functions can even be merged together) |
Contributor
Author
Is that expected to be called on unchecked data? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before 6fae78c (8.17) relevance of Case binders was checked by checking the lambdas produced by expand_case.
Before 0cfe16a (8.18) expand_case would use the relevance from the Case instead of from the inductive data (after it used the relevance from the inductive unsubstituted by the univ instance until 269daf2 (9.0)).
If we had skipped 6fae78c the later patches would have introduced an inconsstency as typechecking would have trusted the Case relevances, but they would be used in conversion.
I think it's worth a test to ensure we don't introduce this possible bug by mistake.
To make testing practical the check is turned into a regular error instead of assert failure.
The test is an output test as otherwise we risk producing some other error if something changes.