Skip to content
Snippets Groups Projects

gen_tree: add comment explaining intended usage

Merged Ralf Jung requested to merge ralf/gen-tree into master
All threads resolved!

#227 (closed) shows that this is not obvious, and this is entirely fair.

However, this seems surprisingly inconsistent. The more consistent thing would be to use a GenNode for each constructor, including non-recursive ones; then one also does not have to ever duplicate types in the big sum that is T and one can always use the number in the node to indicate the constructor. Should we recommend that instead? If so, we should probably adjust the users, at least in the core std++ and Iris repos, to follow that pattern. We might even want to use a different definition then:

Inductive gen_tree (T : Type) : Type :=
  | GenNode : nat → list T → list (gen_tree T) → gen_tree T.

The list of T can be used to store arbitrary data of other types, and then the list of children is used for recursion only.

Edited by Ralf Jung

Merge request reports

Merge request pipeline #116917 passed

Merge request pipeline passed for 3b269ef3

Approval is optional

Merged by Ralf JungRalf Jung 1 month ago (Feb 18, 2025 7:32am UTC)

Merge details

  • Changes merged into master with d99d3967.
  • Deleted the source branch.
  • Auto-merge enabled

Pipeline #116918 passed

Pipeline passed for d99d3967 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • The comment looks good to me.

    With regarding to changing the definition, I do not have a very strong opinion. Just to say, the original definition is the same as the one in math-comp, https://github.com/math-comp/math-comp/blob/master/ssreflect/choice.v#L171 We should actually credit that in the comments.

  • Ralf Jung resolved all threads

    resolved all threads

  • Ralf Jung added 1 commit

    added 1 commit

    Compare with previous version

  • Author Owner

    Let's just stick with the current definition for now then, and maybe file an issue tracking this possible change.

  • Ralf Jung enabled an automatic merge when all merge checks for 3b269ef3 pass

    enabled an automatic merge when all merge checks for 3b269ef3 pass

  • Ralf Jung mentioned in issue #227 (closed)

    mentioned in issue #227 (closed)

  • Ralf Jung mentioned in commit d99d3967

    mentioned in commit d99d3967

  • merged

  • Please register or sign in to reply
    Loading