(*+ Hoare logic (single thread) *)
(** We now build a Hoare logic for a single thread based on the oracular semantics (it can assume that acquire will give back a good map, but has to provide back good maps at release.) *)
Definition safe_onethread G P c :=
forall m, m |= P -> forall oracle, safe step (G, oracle, m, c).
Definition semax G P c Q := forall F k,
safe_onethread G (Q ** F) k ->
safe_onethread G (P ** F) (c ++ k).

Lemma semax_safe G P c : semax G P c TT -> safe_onethread G P c.
Ltac forward :=
first [
apply semax_nil
| eapply semax_cons; [ eapply semax_set | ]
| eapply semax_cons; [ eapply semax_assert | ]
| eapply semax_cons; [ eapply semax_acquire' | ]
| eapply semax_cons; [ eapply semax_acquire | ]
| eapply semax_cons; [ eapply semax_release' | ]
| eapply semax_cons; [ eapply semax_release | ]
| eapply semax_cons
]; auto.