mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
This PR sets up the new integrated test/bench suite. It then migrates all benchmarks and some related tests to the new suite. There's also some documentation and some linting. For now, a lot of the old tests are left alone so this PR doesn't become even larger than it already is. Eventually, all tests should be migrated to the new suite though so there isn't a confusing mix of two systems.
47 lines
731 B
Lean4
47 lines
731 B
Lean4
def f (x y : Nat) := x + 2*y
|
|
|
|
namespace Foo
|
|
|
|
local infix:65 (priority := high) "+" => f
|
|
|
|
theorem ex1 (x y : Nat) : x + y = f x y := rfl
|
|
|
|
/-- info: 1+2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
end Foo
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
theorem ex2 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
|
|
|
open Foo
|
|
|
|
theorem ex3 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
section
|
|
def g (x y : Nat) := 3*(x+y)
|
|
|
|
local infix:65 (priority := high) " + " => g
|
|
|
|
theorem ex4 (x y : Nat) : x + y = g x y := rfl
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|
|
|
|
end
|
|
|
|
theorem ex5 (x y : Nat) : x + y = HAdd.hAdd x y := rfl
|
|
|
|
/-- info: 1 + 2 : Nat -/
|
|
#guard_msgs in
|
|
#check 1 + 2
|