Skip to content
Snippets Groups Projects
Commit 6f504682 authored by Robbert Krebbers's avatar Robbert Krebbers
Browse files

Improve case_option_guard to destruct on decide P in case of mguard P.

First it would destruct on the decider, which sometimes would result
in unfolded hypotheses.
parent 330702cc
No related branches found
No related tags found
No related merge requests found
...@@ -204,12 +204,14 @@ End option_union_intersection_difference. ...@@ -204,12 +204,14 @@ End option_union_intersection_difference.
(** * Tactics *) (** * Tactics *)
Tactic Notation "case_option_guard" "as" ident(Hx) := Tactic Notation "case_option_guard" "as" ident(Hx) :=
match goal with match goal with
| H : context C [@mguard option _ ?P ?dec _ ?x] |- _ => | H : appcontext C [@mguard option _ ?P ?dec] |- _ =>
let X := context C [ match dec with left H => x H | _ => None end ] in change (@mguard option _ P dec) with (λ A (x : P option A),
change X in H; destruct_decide dec as Hx match @decide P dec with left H' => x H' | _ => None end) in *;
| |- context C [@mguard option _ ?P ?dec _ ?x] => destruct_decide (@decide P dec) as Hx
let X := context C [ match dec with left H => x H | _ => None end ] in | |- appcontext C [@mguard option _ ?P ?dec] =>
change X; destruct_decide dec as Hx change (@mguard option _ P dec) with (λ A (x : P option A),
match @decide P dec with left H' => x H' | _ => None end) in *;
destruct_decide (@decide P dec) as Hx
end. end.
Tactic Notation "case_option_guard" := Tactic Notation "case_option_guard" :=
let H := fresh in case_option_guard as H. let H := fresh in case_option_guard as H.
......
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