lean4-htt/tests/elab/issue11342.lean
Garmelon 08eb78a5b2
chore: switch to new test/bench suite (#12590)
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.
2026-02-25 13:51:53 +00:00

36 lines
1.1 KiB
Text

set_option pp.mvars false
inductive N : Type where
| zero : N
| succ (n : N) : N
opaque double (n : N) : N := .zero
inductive Parity : N -> Type
| even (n) : Parity (double n)
| odd (n) : Parity (N.succ (double n))
-- set_option trace.Meta.Match.matchEqs true
partial def natToBin3 : (n : N) → Parity n → List Bool
| .zero, _ => []
| _, Parity.even j => [false, false]
| _, Parity.odd j => [true, true]
/--
error: Tactic `cases` failed with a nested error:
Dependent elimination failed: Failed to solve equation
n✝¹.succ = double n✝
at case `Parity.even` after processing
(N.succ _), _
the dependent pattern matcher can solve the following kinds of equations
- <var> = <term> and <term> = <var>
- <term> = <term> where the terms are definitionally equal
- <constructor> = <constructor>, examples: List.cons x xs = List.cons y ys, and List.cons x xs = List.nil
-/
#guard_msgs in
partial def natToBin4 : (n : N) → Parity n → List Bool
| .zero, _ => []
| .succ .zero, _ => []
| _, Parity.even j => [false, false]
| _, Parity.odd j => [true, true]