Proof with auto.
intros H0 H1 H2. unfold do_unfold'.
rewrite listd_app, listd_unfold_state; split. solve[apply unfolding1_sound;auto].
rewrite listd_app, listd_unfold_state; split. solve[apply unfolding2_sound;auto].
rewrite listd_app, listd_unfold_state; split. solve[apply unfolding3_sound;auto].
rewrite listd_app, listd_unfold_state; split. solve[apply unfolding4_sound;auto].
rewrite listd_app, listd_unfold_state; split. solve[apply unfolding6_sound;auto].
auto.
Qed.

(* Specifications: *)
Lemma add_list_simpl_aux: forall l s s',
M.Equal s s' ->
M.Equal (add_list_to_set_simple l s) (add_list_to_set_simple l s').
Lemma add_list_to_set_spec1:
forall l s s', add_list_to_set l s = Some s' ->
M.Equal (add_list_to_set_simple l s) s'.
Lemma add_list_to_set_spec2:
forall l s, add_list_to_set l s = None ->
Forall (fun x => M.In x s) l.
Lemma add_list_union:
forall l s, M.Equal (add_list_to_set_simple l s)
(M.union (clause_list2set l) s).
Lemma perm_exists: forall {A} (l:list A) a, In a l ->
exists l', Permutation l (a::l').
Lemma listd_cong1: forall l' l st,
(forall x, In x l' -> In x l) ->
listd clause_denote inter TT l st -> listd clause_denote inter TT l' st.
Lemma listd_cong: forall l' l st,
(forall x, In x l' <-> In x l) ->
(listd clause_denote inter TT l st <-> listd clause_denote inter TT l' st).
Lemma MEqual_InElem1: forall s t,
M.Equal s t ->
forall x, In x (M.elements s) -> In x (M.elements t).
Lemma MEqual_InElem2: forall s t,
M.Equal s t ->
forall x, In x (M.elements t) -> In x (M.elements s).
Lemma MEqual_InElem: forall s t,
M.Equal s t ->
forall x, In x (M.elements t) <-> In x (M.elements s).
Lemma MEqual_MIn: forall s t,
M.Equal s t ->
forall x, M.In x s <-> M.In x t.
Lemma setd_cong: forall s t st,
M.Equal s t ->
setd clause_denote inter TT s st -> setd clause_denote inter TT t st.
Lemma do_unfold_sound n c s s' st :
clause_denote c st -> setd clause_denote inter TT s st ->
do_unfold n c s = s' ->
setd clause_denote inter TT s' st.