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.
39 lines
758 B
Text
39 lines
758 B
Text
structure Point where
|
||
x : Nat
|
||
y : Nat
|
||
|
||
def f (x : Nat) : Point :=
|
||
let y := x + 1
|
||
{ x, y }
|
||
|
||
theorem ex1 : f x = { x, y := x + 1 } :=
|
||
rfl
|
||
|
||
def g (p : Point) : Nat :=
|
||
p.x + p.y
|
||
|
||
def Set (α : Type u) : Type u :=
|
||
α → Prop
|
||
|
||
def Set.empty : Set α :=
|
||
fun a => False
|
||
|
||
def Set.insert (s : Set α) (a : α) : Set α :=
|
||
fun x => x = a ∨ s a
|
||
|
||
syntax (name := finSet) "{" term,* "}" : term
|
||
|
||
macro_rules (kind := finSet)
|
||
| `({ $as,* }) => do
|
||
as.getElems.foldlM (β := Lean.TSyntax _) (init := ← `(Set.empty)) fun s a => `(Set.insert $s $a)
|
||
|
||
#check { 1, 2, 3 }
|
||
|
||
#check fun x y => g {x, y}
|
||
|
||
#check fun x y : Nat => {x, y}
|
||
|
||
#check fun x y : Nat => {x, y : Point}
|
||
|
||
theorem ex2 (x y : Nat) : { x, y } = (Set.empty.insert x |>.insert y) :=
|
||
rfl
|