Program Instance elementsUnsized {A} {def : A} (l : list A) :
Unsized (elements def l).
Next Obligation.
rewrite ! semElementsSize. by case: l.
Qed.
(* A rather long frequency proof, probably we can do better *)

(* begin semFrequencySize *)
Lemma semFrequencySize {A}
(l : list (nat * G A)) (def : G A) (size: nat) :
semGenSize (frequency def l) size <-->
let l' := [seq x <- l | x.1 != 0] in
if l' is nil then semGenSize def size else
\bigcup_(x in l') semGenSize x.2 size.