Skip to content

feat: structural recursion over nested datatypes - #4733

Merged
nomeata merged 62 commits into
masterfrom
joachim/strucural-over-nested
Jul 15, 2024
Merged

nomeata merged 62 commits into
masterfrom
joachim/strucural-over-nested

Conversation

@nomeata

@nomeata nomeata commented Jul 12, 2024 •

Copy link
Copy Markdown
Collaborator

This now works:

inductive Tree where | node : List Tree → Tree

mutual
def Tree.size : Tree → Nat
  | node ts => list_size ts

def Tree.list_size : List Tree → Nat
  | [] => 0
  | t::ts => t.size + list_size ts
end

It is still out of scope to expect to be able to use nested recursion (e.g. through List.map or List.foldl) here.

Depends on #4718.

@github-actions github-actions Bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Jul 12, 2024
@ghost

ghost commented Jul 12, 2024 •

Copy link
Copy Markdown

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2024-07-12 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. (2024-07-12 13:34:32)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 891824bc51726cb99e6229be078d6757111b9b57 --onto 5f70c1ca64a2c05a5866c47b9eb80a92034433ec. (2024-07-12 22:26:44)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase a6ae49c3abaade6f2f4420665b4a67d93069fd81 --onto 5f70c1ca64a2c05a5866c47b9eb80a92034433ec. (2024-07-13 06:55:02)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 1118978cbb344e6570729a70c74cd0d3121e8c35 --onto 5f70c1ca64a2c05a5866c47b9eb80a92034433ec. (2024-07-13 09:03:22)
  • ❗ Batteries/Mathlib CI will not be attempted unless your PR branches off the nightly-with-mathlib branch. Try git rebase 3ab2c714ec03550bf67f8fadb5344419fb40a748 --onto 5f70c1ca64a2c05a5866c47b9eb80a92034433ec. (2024-07-15 10:29:12)

@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc July 13, 2024 07:40 Inactive
This adds the types
* `IndGroupInfo`, a variant of `InductiveVal` with information that
   applies to a whole group of mutual inductives and
* `IndGroupInst` which extends `IndGroupInfo` with levels and parameters
   to indicate a instantiation of the group.

One purpose of this abstraction is to make it clear when a fuction
operates on a group as a whole, rather than a specific inductive within
the group.

This is extracted from #4718 and #4733 to reduce PR size and improve
bisectability.
@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc July 13, 2024 08:03 Inactive
github-merge-queue Bot pushed a commit that referenced this pull request Jul 13, 2024
This adds the types
* `IndGroupInfo`, a variant of `InductiveVal` with information that
   applies to a whole group of mutual inductives and
* `IndGroupInst` which extends `IndGroupInfo` with levels and parameters
   to indicate a instantiation of the group.

One purpose of this abstraction is to make it clear when a fuction
operates on a group as a whole, rather than a specific inductive within
the group.

This is extracted from #4718 and #4733 to reduce PR size and improve
bisectability.
@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc July 13, 2024 09:07 Inactive
@nomeata
nomeata marked this pull request as ready for review July 15, 2024 10:15
@github-actions
github-actions Bot temporarily deployed to lean-lang.org/lean4/doc July 15, 2024 10:18 Inactive
@nomeata
nomeata added this pull request to the merge queue Jul 15, 2024
Merged via the queue into master with commit de96b6d Jul 15, 2024

This branch was previously deployed

1 inactive deployment
lean-lang.org/lean4/doc — 74f4c2bf Deployed Jul 15, 2024 by github-actions[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant