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

Add a test case about overriding the prelude #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Lean4CheckerTests/OverridenPrelude.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
prelude

set_option autoImplicit false

inductive Nat where
| zero : Nat
| succ (n : Nat) : Nat

-- The kernel has a hard-coded interpretation for this function
-- which differs from the one we give here
def Nat.add : (@& Nat) → (@& Nat) → Nat := fun _ _ => .succ .zero

inductive Empty : Type
structure Unit : Type

def T (n : Nat) : Type :=
Nat.rec Empty (fun _ _ => Unit) n

def test (n : Nat) : T (Nat.add n .zero) := Unit.mk
def test0 : T (Nat.add .zero .zero) := test .zero
def empty : Empty := test0

theorem boom (P : Prop) : P := Empty.rec empty
2 changes: 2 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,6 @@ rm -f .lean4checker.tmp
check_command "lake exe lean4checker Lean4CheckerTests.ReduceBool" "uncaught exception: (kernel) unknown declaration 'foo'"
rm -f .lean4checker.tmp

check_command "lake exe lean4checker Lean4CheckerTests.OverridenPrelude" "TODO"

echo "All commands produced the expected errors."
Loading