Module RAMIF_PLAIN.
Section RAMIF_PLAIN.
Context {A : Type}.
Context {ND : NatDed A}.
Context {SL : SepLog A}.

(* Specifications: *)
Lemma solve: forall g l g' l' F, g |-- l * F -> F * l' |-- g' -> g |-- l * (l' -* g').
Lemma weak_ramif_spec: forall g l g' l', g |-- l * (l' -* g') -> g |-- l * TT.
Lemma trans: forall g m l g' m' l',
g |-- m * (m' -* g') ->
m |-- l * (l' -* m') ->
g |-- l * (l' -* g').
Lemma trans':
forall (m l g' m' l': A),
m |-- l * (l' -* m') ->
m * (m' -* g') |-- l * (l' -* g').
Lemma trans'':
forall (p g' m' l': A),
p |-- l' -* m' ->
p * (m' -* g') |-- (l' -* g').
Lemma split: forall g1 g2 l1 l2 g1' g2' l1' l2',
g1 |-- l1 * (l1' -* g1') ->
g2 |-- l2 * (l2' -* g2') ->
g1 * g2 |-- (l1 * l2) * (l1' * l2' -* g1' * g2').
(* Using split to prove frame will lead to a simpler proof. *)
(* But it requires a unitary separation logic.              *)
Lemma frame: forall g l g' l' F, g |-- l * (l' -* g') -> g * F |-- l * (l' -* g' * F).
Lemma frame_post: forall g l g' l' F, g |-- l * (l' -* g') -> g |-- l * (l' * F -* g' * F).
Lemma frame_pre: forall g l g' l' F, g |-- l * (l' -* g') -> g * F |-- (l * F) * (l' -* g').
Lemma exp_right: forall {T} (a: T) g l g' l',
g |-- l * (l' -* g' a) ->
g |-- l * (l' -* exp g').