Definition GOpt A := G (option A).
Global Instance Monad_GOpt : Monad GOpt := {
ret A x := returnGen (Some x);
bind A B := bindGenOpt;
}.

Lemma semSizeOpt_suchThatMaybeOpt {A : Type} (g : G (option A))
(p : A -> bool) (s : nat) :
semGenSizeOpt (suchThatMaybeOpt g p) s <--> semGenSizeOpt g s :&: p.