fact: Fixpoint gen_tree_to_list {T} (t : gen_tree T) : list (nat * nat + T) := match t with | GenLeaf x => [inr x] | GenNode n ts => (ts ≫= gen_tree_to_list) ++ [inl (length ts, n)] end.
imports: Coq.QArith(QArith_base Qcanon) stdpp(well_founded) stdpp(options)