Skip to content

Mutual recursion termination verification (#45)#177

Merged
aallan merged 1 commit into
mainfrom
feature/mutual-recursion-decreases
Mar 2, 2026
Merged

Mutual recursion termination verification (#45)#177
aallan merged 1 commit into
mainfrom
feature/mutual-recursion-decreases

Conversation

@aallan

@aallan aallan commented Mar 2, 2026

Copy link
Copy Markdown
Owner

Summary

  • Where-block functions now have their contracts verified (requires, ensures, decreases) — adds 3 new verified contracts from is_odd
  • The decreases verifier tracks mutual recursion groups instead of a single function name, enabling cross-call measure checking
  • Cross-calls use the callee's decreases expression and parameter types to verify the measure strictly decreases
  • Verification coverage: 96 T1, 3 T3, 99 total (97.0% static) — up from 92 T1, 4 T3, 96 total (95.8%)

Closes #45 — completes C8c (verification depth).

Test plan

  • All 1,287 tests pass (4 new mutual recursion tests added)
  • mypy clean
  • All 15 examples pass check + verify
  • mutual_recursion.vera: all 8 contracts verified T1, 0 T3
  • Tagged v0.0.52 on branch

Generated with Claude Code

Verify decreases clauses across mutually recursive where-block
function groups. Where-block functions now have their contracts
verified (requires, ensures, decreases). The call walker tracks
group names instead of a single function name, and cross-calls
use the callee decreases expression and parameter types.

Verification coverage: 96 T1, 3 T3, 99 total (97.0% static).

Co-Authored-By: Claude <noreply@anthropic.invalid>
@aallan aallan merged commit 02a4e51 into main Mar 2, 2026
10 checks passed
@aallan aallan deleted the feature/mutual-recursion-decreases branch March 2, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Decreases clause termination verification

1 participant