pub fn check_termination_mutual(
ctx: &Context,
defs: &[(String, Term)],
) -> KernelResult<()>Expand description
Check that a MUTUAL block of fixpoints terminates — the mutual Giménez guard.
Every member’s columns are computed first; then each body is checked so that a call to ANY
member — itself OR a sibling — decreases the SHARED lexicographic measure with respect to
the CURRENT body’s columns. Any infinite call chain would then demand an infinite strictly
descending sequence in Terms^K, which cannot exist — so the whole block terminates.
Even.rec’s fixpoint calling Odd.rec on the sub-proof, and vice versa, is exactly what
this guards.
K is the MINIMUM column count over the block: every member’s measure must land in one
common Terms^K, or the comparison would be between tuples of different shapes.