Proof with try solve [simpl; auto|congruence].
intros. revert acc R H0 H1. induction l.
intros acc R H0 H1. simpl in H1; inversion H1; subst...
intros acc R H0 H1. simpl in H; destruct H.
simpl in H1. destruct a. if_tac in H1.
inversion H1; subst. apply IHl with (R:=R)(acc:=acc)...
remember (clause_generate R (PureClause gamma delta priority prio_ok)) as b.
destruct b. destruct p. destruct p. apply IHl with (R:=(v,e)::R)(acc:=c0::acc)...
simpl. split. eapply clause_generate_sound; eauto. auto.
inversion H1; subst... congruence. inversion H1; subst...
Qed.

Lemma main_sound n l r units0 units given unselected s :
listd clause_denote inter TT l s ->
listd clause_denote inter TT units0 s ->
main n units0 l = (r, units, given, unselected) ->
setd clause_denote inter TT given s /\ listd clause_denote inter TT units s.