Proof with auto.
intros H1 H2 (*H3*) H4. revert pos0 H1 H2. induction pos... simpl. destruct a...
remember (expr_eq e u) as b; destruct b... intros pos0 H1 H2. if_tac...
rewrite (@listd_unfold_inter _ state). split...
assert (H5 :
listd pure_atom_denote inter TT (Eqv v e0 :: neg) s ->
listd pure_atom_denote un FF
(merge pure_atom_cmp (List.rev pos0) (Eqv u e0 :: pos)) s).
simpl. intros [H5 H6]. specialize (H1 H6). apply expr_eq_eq' in Heqb. subst.
apply listd_merge_un' in H1. destruct H1.
apply listd_merge_un1. apply pure_atom_cmp_eq. auto.
apply listd_merge_un2. apply pure_atom_cmp_eq. auto.
simpl in H. destruct H.
left. apply var_eq_trans with (y:= v)... apply var_eq_trans with (y:=Var u0)...
apply var_eq_sym...
destruct H. left... right...
intros; rewrite pure_atom_cmp_eq; auto.
simpl; split...
simpl. rewrite (@listd_insert_uniq_inter _ state). intros [H6 H7].
2: apply pure_atom_cmp_eq.
rewrite (@listd_insert_uniq_un _ state). 2: apply pure_atom_cmp_eq.
spec H5. simpl; split... if_tac in H6... apply var_eq_sym...
apply listd_merge_un' in H5. destruct H5 as [H5|H5].
right. apply listd_merge_un1. apply pure_atom_cmp_eq. auto.
simpl in H5; destruct H5 as [H|H]. left. if_tac... apply var_eq_sym...
right. apply listd_merge_un2. apply pure_atom_cmp_eq. simpl. right...
apply expr_eq_eq' in Heqb; subst.
intros; rewrite pure_atom_cmp_eq; auto.
apply IHpos. intros H6. specialize (H1 H6).
apply listd_merge_un' in H1. destruct H1.
apply listd_merge_un1. apply pure_atom_cmp_eq.
rewrite (@listd_un_rev _ state), (@listd_insert_uniq_un _ state).
2: apply pure_atom_cmp_eq.
rewrite (@listd_un_rev _ state) in H. solve[right; apply H].
simpl in H; destruct H.
apply listd_merge_un2. apply pure_atom_cmp_eq. simpl; left...
destruct H.
apply listd_merge_un1. apply pure_atom_cmp_eq.
rewrite (@listd_un_rev _ state), (@listd_insert_uniq_un _ state).
left. auto. apply pure_atom_cmp_eq.
apply listd_merge_un2. apply pure_atom_cmp_eq. simpl; right; auto.
intros; rewrite pure_atom_cmp_eq; auto.
auto.
Qed.

(* Specifications: *)
Lemma ef_sound ce c l0 s :
clause_denote c s -> listd clause_denote inter TT l0 s ->
listd clause_denote inter TT (ef ce c l0) s.