forked from leanprover/lean4
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: for flexible reducibility attributes
- Loading branch information
1 parent
7294646
commit 15cfe60
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
@[irreducible] def f (x : Nat) := x + 1 | ||
|
||
/-- | ||
error: type mismatch | ||
rfl | ||
has type | ||
f x = f x : Prop | ||
but is expected to have type | ||
f x = x + 1 : Prop | ||
-/ | ||
#guard_msgs in | ||
example : f x = x + 1 := | ||
rfl | ||
|
||
section | ||
attribute [local reducible] f | ||
example : f x = x + 1 := | ||
rfl | ||
end | ||
|
||
/-- | ||
error: type mismatch | ||
rfl | ||
has type | ||
f x = f x : Prop | ||
but is expected to have type | ||
f x = x + 1 : Prop | ||
-/ | ||
#guard_msgs in | ||
example : f x = x + 1 := | ||
rfl | ||
|
||
namespace Boo | ||
attribute [scoped semireducible] f | ||
end Boo | ||
|
||
/-- | ||
error: type mismatch | ||
rfl | ||
has type | ||
f x = f x : Prop | ||
but is expected to have type | ||
f x = x + 1 : Prop | ||
-/ | ||
#guard_msgs in | ||
example : f x = x + 1 := | ||
rfl | ||
|
||
open Boo in -- `f` should be `semireducible | ||
example : f x = x + 1 := | ||
rfl | ||
|
||
/-- | ||
error: type mismatch | ||
rfl | ||
has type | ||
f x = f x : Prop | ||
but is expected to have type | ||
f x = x + 1 : Prop | ||
-/ | ||
#guard_msgs in | ||
example : f x = x + 1 := | ||
rfl |
This file contains 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
This file contains 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