Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Jonas Kastberg
iris
Commits
1c8a145a
Commit
1c8a145a
authored
Jun 16, 2018
by
Ralf Jung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve and test iApply error message
parent
1471ae26
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
22 deletions
+39
-22
tests/proofmode.ref
tests/proofmode.ref
+13
-0
tests/proofmode.v
tests/proofmode.v
+4
-0
theories/proofmode/ltac_tactics.v
theories/proofmode/ltac_tactics.v
+22
-22
No files found.
tests/proofmode.ref
View file @
1c8a145a
...
...
@@ -330,3 +330,16 @@ In nested Ltac calls to "iDestruct (open_constr) as (constr)",
"iDestructCore (open_constr) as (constr) (tactic)", last call failed.
Tactic failure: iDestruct: (IList [[IClear (sel_patterns.SelIdent "HP")]])
invalid.
"iApply_fail"
: string
The command has indeed failed with message:
In nested Ltac calls to "iApply (open_constr)",
"iPoseProofCore (open_constr) as (constr) (constr) (tactic)",
"<iris.proofmode.ltac_tactics.iPoseProofCore_go>",
"<iris.proofmode.ltac_tactics.iPoseProofCore_go>",
"<iris.proofmode.ltac_tactics.iPoseProofCore_go>",
"goal_tac" (bound to
fun _ => <ssreflect_plugin::ssrtclseq@0> spec_tac ltac:(()) ; last tac Htmp) and
"<ssreflect_plugin::ssrtclseq@0> spec_tac ltac:(()) ; last tac Htmp", last
call failed.
Tactic failure: iApply: cannot apply P.
tests/proofmode.v
View file @
1c8a145a
...
...
@@ -636,4 +636,8 @@ Check "iDestruct_fail".
Lemma
iDestruct_fail
P
:
P
-
∗
<
absorb
>
P
.
Proof
.
iIntros
"HP"
.
Fail
iDestruct
"HP"
as
"{HP}"
.
Fail
iDestruct
"HP"
as
"[{HP}]"
.
Abort
.
Check
"iApply_fail"
.
Lemma
iApply_fail
P
Q
:
P
-
∗
Q
.
Proof
.
iIntros
"HP"
.
Fail
iApply
"HP"
.
Abort
.
End
error_tests
.
theories/proofmode/ltac_tactics.v
View file @
1c8a145a
...
...
@@ -769,18 +769,7 @@ The tactic [iApply] uses laxy type class inference, so that evars can first be
instantiated by matching with the goal, whereas [iDestruct] does not, because
eliminations may not be performed when type classes have not been resolved.
*)
Tactic
Notation
"iPoseProofCore"
open_constr
(
lem
)
"as"
constr
(
p
)
constr
(
lazy_tc
)
tactic
(
tac
)
:
=
iStartProof
;
let
Htmp
:
=
iFresh
in
let
t
:
=
lazymatch
lem
with
ITrm
?t
?xs
?pat
=>
t
|
_
=>
lem
end
in
let
t
:
=
lazymatch
type
of
t
with
string
=>
constr
:
(
INamed
t
)
|
_
=>
t
end
in
let
spec_tac
_
:
=
lazymatch
lem
with
|
ITrm
?t
?xs
?pat
=>
iSpecializeCore
(
ITrm
Htmp
xs
pat
)
as
p
|
_
=>
idtac
end
in
let
go
goal_tac
:
=
Local
Ltac
iPoseProofCore_go
Htmp
t
goal_tac
:
=
lazymatch
type
of
t
with
|
ident
=>
eapply
tac_pose_proof_hyp
with
_
_
t
_
Htmp
_;
...
...
@@ -799,10 +788,21 @@ Tactic Notation "iPoseProofCore" open_constr(lem)
fail
"iPoseProof:"
Htmp
"not fresh"
|
goal_tac
()]
end
;
try
iSolveTC
in
try
iSolveTC
.
Tactic
Notation
"iPoseProofCore"
open_constr
(
lem
)
"as"
constr
(
p
)
constr
(
lazy_tc
)
tactic
(
tac
)
:
=
iStartProof
;
let
Htmp
:
=
iFresh
in
let
t
:
=
lazymatch
lem
with
ITrm
?t
?xs
?pat
=>
t
|
_
=>
lem
end
in
let
t
:
=
lazymatch
type
of
t
with
string
=>
constr
:
(
INamed
t
)
|
_
=>
t
end
in
let
spec_tac
_
:
=
lazymatch
lem
with
|
ITrm
?t
?xs
?pat
=>
iSpecializeCore
(
ITrm
Htmp
xs
pat
)
as
p
|
_
=>
idtac
end
in
lazymatch
eval
compute
in
lazy_tc
with
|
true
=>
go
ltac
:
(
fun
_
=>
spec_tac
()
;
last
(
tac
Htmp
))
|
false
=>
go
spec_tac
;
last
(
tac
Htmp
)
|
true
=>
iPoseProofCore_go
Htmp
t
ltac
:
(
fun
_
=>
spec_tac
()
;
last
(
tac
Htmp
))
|
false
=>
iPoseProofCore_go
Htmp
t
spec_tac
;
last
(
tac
Htmp
)
end
.
(** * Apply *)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment