Skip to content
Snippets Groups Projects
Verified Commit fb4b91fe authored by Paolo G. Giarrusso's avatar Paolo G. Giarrusso
Browse files

option.v: Add option_guard_decide and option_guard_bool_decide

Motivated by https://mattermost.mpi-sws.org/iris/pl/cz6f4bxwsir78jkunk7nt3bawo.
parent 3c6ebc4b
No related branches found
No related tags found
No related merge requests found
Pipeline #75444 passed
......@@ -362,6 +362,12 @@ Proof. intros. by case_option_guard. Qed.
Lemma option_guard_iff {A} P Q `{Decision P, Decision Q} (mx : option A) :
(P Q) (guard P; mx) = guard Q; mx.
Proof. intros [??]. repeat case_option_guard; intuition. Qed.
Lemma option_guard_decide {A} P `{Decision P} (mx : option A) :
(guard P; mx) = if decide P then mx else None.
Proof. done. Qed.
Lemma option_guard_bool_decide {A} P `{Decision P} (mx : option A) :
(guard P; mx) = if bool_decide P then mx else None.
Proof. by rewrite option_guard_decide, decide_bool_decide. Qed.
Tactic Notation "simpl_option" "by" tactic3(tac) :=
let assert_Some_None A mx H := first
......
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