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

parent 3c6ebc4b
No related branches found
No related tags found
1 merge request!433option.v: Add option_guard_decide and option_guard_bool_decide
...@@ -362,6 +362,12 @@ Proof. intros. by case_option_guard. Qed. ...@@ -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) : Lemma option_guard_iff {A} P Q `{Decision P, Decision Q} (mx : option A) :
(P Q) (guard P; mx) = guard Q; mx. (P Q) (guard P; mx) = guard Q; mx.
Proof. intros [??]. repeat case_option_guard; intuition. Qed. 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) := Tactic Notation "simpl_option" "by" tactic3(tac) :=
let assert_Some_None A mx H := first let assert_Some_None A mx H := first
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment