Module CL := CL_Sound VSM. Import CL.
(* rule w2 *)
Ltac dsepcon :=
match goal with
[ H : sepcon _ _ _ |- _ ] =>
let s1 := fresh "s" in
let s2 := fresh "s" in
let JOIN := fresh "JOIN" in
let H1 := fresh "H" in
let H2 := fresh "H" in
destruct H as [s1 [s2 [JOIN [H1 H2]]]]
end.
Hint Resolve nil_or_loc_full.
Proof with auto; try congruence; try solve [
destruct B as [x' [y' [C [D E]]]]; destruct (IHsigma A y' E) as [s0 [z [F G]]];
subst; exists s0; exists z; split; simpl; auto;
apply join_sub_trans with (b := y'); simpl; auto;
eapply join_join_sub'; eauto].
intros A B; revert s B; induction sigma; intros s B. simpl in A...
simpl in A. remember a as b; destruct b... remember e as b'; destruct b'...
destruct (Ident.eq_dec x v)... destruct B as [x' [y' [C [D E]]]].
subst; exists x'; exists e0; split... solve [eapply join_join_sub'; eauto].
Qed.

Lemma nn_njoin sigma x z s1 s2 :
next_in_dom x sigma = true -> space_denote sigma s1 ->
space_atom_denote (Next (Var x) z) s2 -> joins s1 s2 ->
False.