Proof with simpl; auto; try solve[congruence].
intro H1. apply setd_fold_left...
intros c cls s0 H2 H3. apply setd_add...
unfold setd; rewrite empty_set_elems...
rewrite (@listd_unfold_inter clause state) in H1.
destruct H1; auto.
Qed.

Lemma rev_cmp_eq {A:Type} (f : A -> A -> comparison) (a1 a2 : A) :
Eq = rev_cmp f a1 a2 -> rev_cmp f a1 a2 = f a1 a2.