lean4-htt/tests/lean/run/issue10723.lean
Joachim Breitner 1b4360c32a
fix: unfold more auxillary theorems in termination checking (#10733)
This PR unfolds auxillary theorems more aggressively during termination
checking. This fixes #10721.
2025-10-10 11:09:28 +00:00

29 lines
677 B
Text

import Lean.Syntax
open Lean
private partial def onlyIdent' : Syntax → Bool
| .node _ _ args =>
let nonEmpty := args.filter (!isEmpty ·)
if h : nonEmpty.size = 1 then onlyIdent' nonEmpty[0]
else false
| .ident .. => true
| _ => false
where
isEmpty : Syntax → Bool
| .node _ _ xs =>
xs.all isEmpty
| _ => false
partial def onlyIdent'' : Syntax → Bool
| .node _ _ args =>
let nonEmpty := args.filter (!isEmpty () ·)
if h : nonEmpty.size = 1 then onlyIdent'' nonEmpty[0]
else false
| .ident .. => true
| _ => false
where
isEmpty : Unit → Syntax → Bool
| _, .node _ _ xs =>
xs.all (isEmpty ())
| _, _ => false