Skip to content
Snippets Groups Projects
Commit 3b269ef3 authored by Ralf Jung's avatar Ralf Jung
Browse files

improve comment

parent b38cea43
No related branches found
No related tags found
1 merge request!587gen_tree: add comment explaining intended usage
Pipeline #116917 passed
...@@ -315,13 +315,16 @@ Local Close Scope positive. ...@@ -315,13 +315,16 @@ Local Close Scope positive.
(** This type can help you construct a [Countable] instance for an arbitrary (** This type can help you construct a [Countable] instance for an arbitrary
(even recursive) inductive datatype. The idea is tht you make [T] something like (even recursive) inductive datatype. The idea is tht you make [T] something like
`T1 + T2 + ...`, covering all the data types that can be contained inside your [T1 + T2 + ...], covering all the data types that can be contained inside your
type. type.
- Each non-recursive constructor to a [GenLeaf]. Different constructors must use - Each non-recursive constructor to a [GenLeaf]. Different constructors must use
different variants of [T] to ensure they remain distinguishable! different variants of [T] to ensure they remain distinguishable!
- Each recursive constructor to a [GenNode] where the [nat] is a (typically - Each recursive constructor to a [GenNode] where the [nat] is a (typically
small) constant representing the constructor itself, and then all the data in small) constant representing the constructor itself, and then all the data in
the constructor (recursive or otherwise) is put into child nodes. *) the constructor (recursive or otherwise) is put into child nodes.
This data type is the same as `GenTree.tree` in mathcomp, see
https://github.com/math-comp/math-comp/blob/master/ssreflect/choice.v *)
Inductive gen_tree (T : Type) : Type := Inductive gen_tree (T : Type) : Type :=
| GenLeaf : T gen_tree T | GenLeaf : T gen_tree T
| GenNode : nat list (gen_tree T) gen_tree T. | GenNode : nat list (gen_tree T) gen_tree T.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment