Proof with simpl; auto; try congruence.
revert R R' cs'; induction cs...
intros. inversion H0; clear H0; subst. apply setd_empty_set.
intros R R' cs'; destruct (clause_generate R a); intros [A B].
destruct p; destruct p; intro C.
remember (clauses_generate ((v, e) :: R) cs) as h; destruct h.
inversion C; subst. clear C.
apply setd_add; auto.
solve [apply IHcs with (R := (v, e) :: R) (R' := R'); auto].
solve [apply IHcs; auto].
Qed.

Lemma loop_Cexample_model given unselected given' unselected' R sel :
loop (given, unselected) = (C_example R sel, given', unselected') ->
(R, sel) = clauses_generate nil
(rsort_uniq (rev_cmp compare_clause) (M.elements given')).