Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Simcha van Collem
Iris
Commits
c43eb936
Commit
c43eb936
authored
8 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Hack to delay type class inference in iPoseProof.
parent
3e1e5e0f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
proofmode/tactics.v
+9
-3
9 additions, 3 deletions
proofmode/tactics.v
tests/proofmode.v
+14
-0
14 additions, 0 deletions
tests/proofmode.v
with
23 additions
and
3 deletions
proofmode/tactics.v
+
9
−
3
View file @
c43eb936
...
...
@@ -208,6 +208,11 @@ Tactic Notation "iSpecialize" open_constr(t) :=
end
.
(** * Pose proof *)
(* We use [class_apply] in the below to delay type class inference, this is
useful when difference [inG] instances are arround. See [tests/proofmode] for
a simple but artificial example.
Note that this only works when the posed lemma is prefixed with an [@]. *)
Local
Tactic
Notation
"iPoseProofCore"
open_constr
(
H1
)
"as"
constr
(
H2
)
:=
lazymatch
type
of
H1
with
|
string
=>
...
...
@@ -216,9 +221,10 @@ Local Tactic Notation "iPoseProofCore" open_constr(H1) "as" constr(H2) :=
|
env_cbv
;
reflexivity
||
fail
"iPoseProof:"
H2
"not fresh"
|]
|
_
=>
eapply
tac_pose_proof
with
_
H2
_
_
_;
(* (j:=H) *)
[
first
[
eapply
H1
|
apply
uPred
.
equiv_iff
;
eapply
H1
]
|
apply
_
|
env_cbv
;
reflexivity
||
fail
"iPoseProof:"
H2
"not fresh"
|]
[
first
[
class_apply
H1
|
class_apply
uPred
.
equiv_iff
;
eapply
H1
]
|
(* [apply _] invokes TC inference on shelved goals, why ...? *)
typeclasses
eauto
|
env_cbv
;
class_apply
eq_refl
||
fail
"iPoseProof:"
H2
"not fresh"
|]
end
.
Tactic
Notation
"iPoseProof"
open_constr
(
t
)
"as"
constr
(
H
)
:=
...
...
This diff is collapsed.
Click to expand it.
tests/proofmode.v
+
14
−
0
View file @
c43eb936
...
...
@@ -106,3 +106,17 @@ Section iris.
-
done
.
Qed
.
End
iris
.
Section
classes
.
Class
C
A
:=
c
:
A
.
Instance
nat_C
:
C
nat
:=
0
.
Instance
bool_C
:
C
bool
:=
true
.
Lemma
demo_9
{
M
:
ucmraT
}
(
P
:
uPred
M
)
(
H
:
∀
`{
C
A
},
True
⊢
(
c
=
c
:
uPred
M
))
:
P
⊢
(
c
:
nat
)
=
c
∧
(
c
:
bool
)
=
c
.
Proof
.
iIntros
"_"
.
iPoseProof
(
@
H
_)
as
"foo_bool"
.
iPoseProof
(
@
H
_)
as
"foo_nat"
.
iSplit
.
iApply
"foo_nat"
.
iApply
"foo_bool"
.
Qed
.
End
classes
.
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment