Skip to content
Snippets Groups Projects
Commit 48123f29 authored by Simon Spies's avatar Simon Spies
Browse files

derive some more rules

parent 11a85c86
No related branches found
No related tags found
No related merge requests found
Pipeline #112129 passed
...@@ -21,6 +21,29 @@ Section derived. ...@@ -21,6 +21,29 @@ Section derived.
Notation "'|==>src' P" := (weak_src_update P)%I (at level 99) : stdpp_scope. Notation "'|==>src' P" := (weak_src_update P)%I (at level 99) : stdpp_scope.
Lemma Conseq (e: expr) P P' Q Q':
(P P')
( v, Q' v Q v)
({{P'}} e {{v, Q' v}} {{P}} e {{v, Q v}})%I.
Proof.
iIntros (He1 He2) "#Hh". iModIntro. rewrite He1.
iIntros "HP Hna". iApply (rwp_wand with "(Hh HP Hna)").
iIntros (v) "[$ HQ]". rewrite He2 //.
Qed.
Lemma HoareExists {X} (e: expr) P Q :
( x, {{P x}} e {{v, Q v}}) {{ x: X, P x}} e {{v, Q v}}%I.
Proof.
iIntros "#H !>". iDestruct 1 as (x) "HP". iApply ("H" with "HP").
Qed.
Lemma HoarePure (e: expr) φ P Q :
(P φ) (φ -∗ {{P}} e {{v, Q v}}) {{P}} e {{v, Q v}}%I.
Proof.
iIntros (Hent) "#H !> HP". iDestruct (Hent with "HP") as %Hent'.
iApply ("H" with "[//] HP").
Qed.
Lemma Value (v: val): ( {{True}} v {{w, v = w}})%I. Lemma Value (v: val): ( {{True}} v {{w, v = w}})%I.
Proof. Proof.
iIntros "!> _ $". by iApply rwp_value. iIntros "!> _ $". by iApply rwp_value.
...@@ -112,8 +135,8 @@ Section derived. ...@@ -112,8 +135,8 @@ Section derived.
Qed. Qed.
Lemma HoareLöb X P Q e : Lemma HoareLöb X P Q e :
( x :X, {{P x ( x, {{P x}} e {{v, Q x v}})}} e {{ v, Q x v}}) ( x : X, {{P x ( x, {{P x}} e x {{v, Q x v}})}} e x {{ v, Q x v}})
x, {{ P x }} e {{v, Q x v}}. x, {{ P x }} e x {{v, Q x v}}.
Proof. Proof.
iIntros "#H". iApply bi.löb. iIntros "#H". iApply bi.löb.
iIntros "#H1" (x). iIntros "#H1" (x).
...@@ -121,6 +144,15 @@ Section derived. ...@@ -121,6 +144,15 @@ Section derived.
iFrame "#". iFrame. iFrame "#". iFrame.
Qed. Qed.
Lemma HoareLöbNoArgs P Q e :
({{P ({{P}} e {{v, Q v}})}} e {{ v, Q v}})
{{ P }} e {{v, Q v}}.
Proof.
iIntros "#H". iApply bi.löb.
iIntros "#H1".
iModIntro. iIntros "HP". iApply "H".
iFrame "#". iFrame.
Qed.
(* Extended Refinement Program Logic of Transfinite Iris *) (* Extended Refinement Program Logic of Transfinite Iris *)
Lemma value_tgt_tpr (v: val): ( {{True}} v {{w, v = w}})%I. Lemma value_tgt_tpr (v: val): ( {{True}} v {{w, v = w}})%I.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment