Definition contained (l: list ident) (g1 g2: generator) : Prop :=
forall id, In id l -> within id g1 g2.

(* Specifications: *)
Lemma contained_nil:
forall g1 g2, contained nil g1 g2.
Lemma contained_widen:
forall l g1 g2 g1' g2',
contained l g1 g2 ->
Ple (gen_next g1') (gen_next g1) ->
Ple (gen_next g2) (gen_next g2') ->
contained l g1' g2'.
Lemma contained_cons:
forall id l g1 g2,
within id g1 g2 -> contained l g1 g2 -> contained (id :: l) g1 g2.
Lemma contained_app:
forall l1 l2 g1 g2,
contained l1 g1 g2 -> contained l2 g1 g2 -> contained (l1 ++ l2) g1 g2.
Lemma contained_disjoint:
forall g1 l1 g2 l2 g3,
contained l1 g1 g2 -> contained l2 g2 g3 -> list_disjoint l1 l2.
Lemma contained_notin:
forall g1 l g2 id g3,
contained l g1 g2 -> within id g2 g3 -> ~In id l.