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.
24 lines
845 B
Lean4
24 lines
845 B
Lean4
import Lean.Meta.Sym
|
|
open Lean Meta Sym Internal
|
|
set_option grind.debug true
|
|
|
|
def test : SymM Unit := do
|
|
let f ← mkConstS `f
|
|
let f₁ := mkConst `f
|
|
let f₂ ← mkConstS `f
|
|
assert! isSameExpr f f₂
|
|
assert! !isSameExpr f f₁
|
|
let x₁ ← mkBVarS 0
|
|
let x₂ ← mkBVarS 0
|
|
assert! isSameExpr
|
|
(← mkLambdaS `x .default (← mkConstS ``Nat) (← mkMDataS {} (← mkProjS ``Prod 0 (← mkAppS f x₁))))
|
|
(← mkLambdaS `y .default (← mkConstS ``Nat) (← mkMDataS {} (← mkProjS ``Prod 0 (← mkAppS f₂ x₂))))
|
|
assert! !isSameExpr (← mkAppS f x₁) (mkApp f x₁)
|
|
assert!
|
|
mkLambda `x .default (mkConst ``Nat) (mkMData {} (mkProj ``Prod 0 (mkApp f x₁)))
|
|
==
|
|
(← mkLambdaS `y .default (← mkConstS ``Nat) (← mkMDataS {} (← mkProjS ``Prod 0 (← mkAppS f₂ x₂))))
|
|
|
|
#eval SymM.run do
|
|
test
|