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

Proper error message when `//` spec pattern fails.

parent e948d98d
No related branches found
No related tags found
No related merge requests found
...@@ -475,6 +475,14 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) := ...@@ -475,6 +475,14 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) :=
apply _ || apply _ ||
let P := match goal with |- IntoWand _ _ ?P _ _ => P end in let P := match goal with |- IntoWand _ _ ?P _ _ => P end in
fail "iSpecialize:" P "not an implication/wand" in fail "iSpecialize:" P "not an implication/wand" in
let solve_done d :=
lazymatch d with
| true =>
done ||
let Q := match goal with |- envs_entails _ ?Q => Q end in
fail "iSpecialize: cannot solve" Q "using done"
| false => idtac
end in
let rec go H1 pats := let rec go H1 pats :=
lazymatch pats with lazymatch pats with
| [] => idtac | [] => idtac
...@@ -498,7 +506,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) := ...@@ -498,7 +506,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) :=
let Q := match goal with |- FromPure _ ?Q _ => Q end in let Q := match goal with |- FromPure _ ?Q _ => Q end in
fail "iSpecialize:" Q "not pure" fail "iSpecialize:" Q "not pure"
|env_reflexivity |env_reflexivity
|done_if d (*goal*) |solve_done d (*goal*)
|go H1 pats] |go H1 pats]
| SGoal (SpecGoal GPersistent false ?Hs_frame [] ?d) :: ?pats => | SGoal (SpecGoal GPersistent false ?Hs_frame [] ?d) :: ?pats =>
eapply tac_specialize_assert_persistent with _ _ H1 _ _ _ _ _; eapply tac_specialize_assert_persistent with _ _ H1 _ _ _ _ _;
...@@ -509,7 +517,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) := ...@@ -509,7 +517,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) :=
fail "iSpecialize:" Q "not persistent" fail "iSpecialize:" Q "not persistent"
|apply _ |apply _
|env_reflexivity |env_reflexivity
|iFrame Hs_frame; done_if d (*goal*) |iFrame Hs_frame; solve_done d (*goal*)
|go H1 pats] |go H1 pats]
| SGoal (SpecGoal GPersistent _ _ _ _) :: ?pats => | SGoal (SpecGoal GPersistent _ _ _ _) :: ?pats =>
fail "iSpecialize: cannot select hypotheses for persistent premise" fail "iSpecialize: cannot select hypotheses for persistent premise"
...@@ -525,7 +533,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) := ...@@ -525,7 +533,7 @@ Local Tactic Notation "iSpecializePat" open_constr(H) constr(pat) :=
|env_reflexivity || |env_reflexivity ||
let Hs' := iMissingHyps Hs' in let Hs' := iMissingHyps Hs' in
fail "iSpecialize: hypotheses" Hs' "not found" fail "iSpecialize: hypotheses" Hs' "not found"
|iFrame Hs_frame; done_if d (*goal*) |iFrame Hs_frame; solve_done d (*goal*)
|go H1 pats] |go H1 pats]
| SAutoFrame GPersistent :: ?pats => | SAutoFrame GPersistent :: ?pats =>
eapply tac_specialize_assert_persistent with _ _ H1 _ _ _ _; eapply tac_specialize_assert_persistent with _ _ H1 _ _ _ _;
......
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