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.
37 lines
1015 B
Lean4
37 lines
1015 B
Lean4
/-!
|
|
This file contains tests for typical mistakes one might do when using `inductive_fixpoint`/`coinductive_fixpoint`/`partial_fixpoint` machinery, that is:
|
|
- Try to use `coinductive_fixpoint`/`inductive_fixpoint` to define functions instead of predicates
|
|
- Apply `coinductive_fixpoint`/`inductive_fixpoint` to non-recursive functions
|
|
- Mix `partial_fixpoint` with `coinductive_fixpoint`/`inductive_fixpoint` in the same clique
|
|
-/
|
|
|
|
/--
|
|
error: `coinductive_fixpoint` can be only used to define predicates
|
|
-/
|
|
#guard_msgs in
|
|
def f (x : Nat) : Nat :=
|
|
f (x + 1)
|
|
coinductive_fixpoint
|
|
|
|
/--
|
|
error: `inductive_fixpoint` can be only used to define predicates
|
|
-/
|
|
#guard_msgs in
|
|
def g (x : Nat) : Nat :=
|
|
g (x + 1)
|
|
inductive_fixpoint
|
|
|
|
/--
|
|
warning: unused `coinductive_fixpoint`, function is not recursive
|
|
-/
|
|
#guard_msgs in
|
|
def h (x : Nat) : Prop := x > 42
|
|
coinductive_fixpoint
|
|
|
|
/--
|
|
warning: unused `inductive_fixpoint`, function is not recursive
|
|
-/
|
|
#guard_msgs in
|
|
def h' (x : Nat) : Prop := x > 42
|
|
inductive_fixpoint
|