Proof with simpl; auto.
intros A B; unfold infer. autounfold with DEBUG_UNFOLD.
rewrite (@listd_sort_uniq_inter _ state).
2: intros; rewrite <-compare_clause_eq with (cl1 := x)...
apply listd_filter_pred.
apply listd_map_pred with (f := clause_denote).
solve[intros d H1; apply simplify_sound; simpl; auto].
apply ef_sound... apply listd_fold_left... intros d cls H1 H2. apply sp_sound...
Qed.

(* Specifications: *)
Lemma clause_generate_sound R c c' v e s :
clause_denote c s -> clause_generate R c = inl _ (v, e, c') ->
clause_denote c' s.