Add a test case about overriding the prelude#3
Open
nomeata wants to merge 2 commits intoleanprover:masterfrom
Open
Add a test case about overriding the prelude#3nomeata wants to merge 2 commits intoleanprover:masterfrom
nomeata wants to merge 2 commits intoleanprover:masterfrom
Conversation
Collaborator
|
Thanks, @nomeata. This PR has revealed that CI wasn't set up properly for PRs from forks. I've pulled out your changes to the file layout, and fixed CI, and then rebased your PR back onto All that remains here is the failing test. |
Probably not unexpected but without further protection against the `prelude` command, one can easily prove unsound things, as this test demonstrates. It seems that either `lean4checker` should somehow ensure that only an official prelude is used, or else the kernel (which implements `Nat.add` differently) should check that the definition is indeed as expected. I had to restructure the tests into their own library with a `glob`, as _importing_ this file from another file that also imports the normal prelude seems to fail with ``` ./././Lean4CheckerTests.lean:1:0: error: import Lean4CheckerTests.OverridenPrelude failed, environment already contains 'Eq.refl' from Init.Prelude ```
cdf4889 to
0da5599
Compare
0da5599 to
09aea16
Compare
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.
This is well known, but but without further protection against the
preludecommand, one can easily prove unsound things, as this testdemonstrates.
Until the kernel itself is guarded against this (tracked at
leanprover/lean4#188), I wonder if
lean4checkershould havea defense, and warn if
preludeis used, or something along these lines?I had to restructure the tests into their own library with a
glob, asimporting this file from another file that also imports the normal
prelude seems to fail with