Test "perf/args-before-unfold"
Expected: 馃憤 accept 路 Size: 44.7鈥疜B 路 Lines: 1.2鈥痥 路 lean4export: 3.2.0 路 Lean: 4.38.0-nightly-2026-12-03 路 Timeout: 40.0鈥痵 路 馃搫 Declaration 路 馃敆 Source
The declaration to check compares
count #n and count (N.add #(n-1) #1)
where #k is the numeral with k successors, and count #k evaluates to #k
in 螛(k虏) reductions.
N.add #(n-1) #1 reduces to #n in n steps, so the two arguments agree for
螛(n), and the applications agree with them without count ever being
unfolded. Evaluating both applications costs 螛(n虏). The test asks whether
a checker tries the arguments of a shared head constant before unfolding it.
N=1000 in the Lean source. From Courant and Leroy, POPL 2026, 搂10.