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.
23 lines
782 B
Text
23 lines
782 B
Text
module
|
||
variable {α : Type u} {l : List α} {P Q : α → Bool}
|
||
|
||
attribute [grind =] List.countP_nil List.countP_cons
|
||
|
||
theorem List.countP_le_countP (hpq : ∀ x ∈ l, P x → Q x) :
|
||
l.countP P ≤ l.countP Q := by
|
||
induction l <;> grind
|
||
|
||
-- TODO: how to explain to the user that `l.countP P ≤ l.countP Q` is a bad pattern
|
||
grind_pattern List.countP_le_countP => l.countP P, l.countP Q
|
||
|
||
theorem List.countP_lt_countP (hpq : ∀ x ∈ l, P x → Q x) (y:α) (hx: y ∈ l) (hxP : P y = false) (hxQ : Q y) :
|
||
l.countP P < l.countP Q := by
|
||
induction l <;> grind
|
||
|
||
/--
|
||
info: List.countP_nil: [@List.countP #1 #0 (@List.nil _)]
|
||
---
|
||
info: List.countP_cons: [@List.countP #3 #2 (@List.cons _ #1 #0)]
|
||
-/
|
||
#guard_msgs (info) in
|
||
attribute [grind? =] List.countP_nil List.countP_cons
|