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

Merge branch 'robbert/done_is_Some_non_rec' into 'master'

Do not call `done` recursively when solving `is_Some`.

See merge request !296
parents 715cb884 53a108a6
No related branches found
No related tags found
1 merge request!296Do not call `done` recursively when solving `is_Some`.
Pipeline #50452 passed
From stdpp Require Import tactics.
From stdpp Require Import tactics option.
Goal P1 P2 P3 P4 (P: Prop),
P1 (Is_true (P2 || P3)) P4
......@@ -69,3 +69,12 @@ universe, like [Is_true : bool → Prop]. *)
Goal True.
let x := mk_evar true in idtac.
Abort.
(** Make sure that [done] is not called recursively when solving [is_Some],
which might leave an unresolved evar before performing ex falso. *)
Goal False is_Some (@None nat).
Proof. done. Qed.
Goal mx, mx = Some 10 is_Some mx.
Proof. done. Qed.
Goal mx, Some 10 = mx is_Some mx.
Proof. done. Qed.
......@@ -40,7 +40,8 @@ Proof. congruence. Qed.
Definition is_Some {A} (mx : option A) := x, mx = Some x.
Global Instance: Params (@is_Some) 1 := {}.
Global Hint Extern 0 (is_Some _) => by eexists : core.
(** We avoid calling [done] recursively as that can lead to an unresolved evar. *)
Global Hint Extern 0 (is_Some _) => eexists; fast_done : core.
Lemma is_Some_alt {A} (mx : option A) :
is_Some mx match mx with Some _ => True | None => False end.
......
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