Set Bullet Behavior "Strict Subproofs".
(* standard VST prelude *)
Instance CompSpecs : compspecs. make_compspecs prog. Defined.
Definition Vprog : varspecs. mk_varspecs prog. Defined.
(* import funspecs from concurrency library *)
Definition acquire_spec := DECLARE _acquire acquire_spec.
Definition release_spec := DECLARE _release release_spec.
(* encoding a lock invariant in terms of an atomic exchange invariant *)
Definition lock_R R (h : list AE_hist_el) v := EX z : Z, !!(repable_signed z /\ v = vint z) &&
(weak_precise_mpred R && emp) * (weak_positive_mpred R && emp) * if eq_dec z 0 then R else emp.
Definition my_lock sh l p g R := EX h : hist, AE_loc sh l p g (vint 1) (lock_R R) h.

Lemma lock_R_super_non_expansive : forall n R h v, compcert_rmaps.RML.R.approx n (lock_R R h v) =
compcert_rmaps.RML.R.approx n (lock_R (compcert_rmaps.RML.R.approx n R) h v).