Skip to content

Commit

Permalink
refactor: FunInd overhaul (#4789)
Browse files Browse the repository at this point in the history
This refactoring PR changes the structure of the `FunInd` module, with
the main purpose to make it easier to support mutual structural
recursion.

In particular the recursive calls are now longer recognized by their
terms (simple for well-founded recursion, `.app oldIH [arg, proof]`, but
tedious for structural recursion and even more so for mutual structural
recursion), but the type after replacing `oldIH` with `newIH`, where the
type will be simply and plainly `mkAppN motive args`).

We also no longer try to guess whether we deal with well-founded or
structural recursion but instead rely on the `EqnInfo` environment
extensions. The previous code tried to handle both variants, but they
differ too much, so having separate top-level functions is easier.

This also fuses the `foldCalls` and `collectIHs` traversals and
introduces a suitable monad for collecting the inductive hypotheses.
  • Loading branch information
nomeata authored Jul 21, 2024
1 parent 99f3629 commit 22ae04f
Show file tree
Hide file tree
Showing 4 changed files with 444 additions and 491 deletions.
Loading

0 comments on commit 22ae04f

Please sign in to comment.