lean4-htt/tests/lean/run/8938.lean
Sebastian Ullrich ba7135d73c
fix: exposed wellfounded recursion (#9173)
This PR fixes an incompatibility in the experimental module system when
trying to combine wellfounded recursion with public exposed definitions.
2025-07-03 16:48:15 +00:00

22 lines
590 B
Text

module
/-! Wellfounded recursion should not break under `@[expose] public`. -/
@[expose] public def ackermann : Nat → Nat → Nat
| 0, m => m+1
| n + 1, 0 => ackermann n 1
| n + 1, m + 1 => ackermann n (ackermann (n + 1) m)
termination_by n m => (n,m)
/-- info: ackermann.eq_2 (n : Nat) : ackermann n.succ 0 = ackermann n 1 -/
#guard_msgs in
#check ackermann.eq_2
@[expose] public def foo : Nat → Nat → Nat
| 0, m => m
| n + 1, m => foo n (m+1)
termination_by n m => (n, m)
/-- info: foo.eq_2 (x✝ n : Nat) : foo n.succ x✝ = foo n (x✝ + 1) -/
#guard_msgs in
#check foo.eq_2