Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iris
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
Tej Chajed
iris
Commits
80fcebca
Commit
80fcebca
authored
7 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
iIntoValid : for specialization, first try with [hnf] and then with [cbv zeta].
parent
7479b01b
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/bi/derived_laws.v
+1
-1
1 addition, 1 deletion
theories/bi/derived_laws.v
theories/proofmode/tactics.v
+23
-10
23 additions, 10 deletions
theories/proofmode/tactics.v
with
24 additions
and
11 deletions
theories/bi/derived_laws.v
+
1
−
1
View file @
80fcebca
...
...
@@ -35,7 +35,7 @@ Lemma entails_equiv_l P Q R : (P ⊣⊢ Q) → (Q ⊢ R) → (P ⊢ R).
Proof
.
by
intros
->
.
Qed
.
Lemma
entails_equiv_r
P
Q
R
:
(
P
⊢
Q
)
→
(
Q
⊣⊢
R
)
→
(
P
⊢
R
)
.
Proof
.
by
intros
?
<-.
Qed
.
Global
Instance
bi_valid_proper
:
Proper
((
⊣⊢
)
==>
iff
)
(
@
bi_valid
PROP
)
.
Global
Instance
bi_valid_proper
:
Proper
((
⊣⊢
)
==>
iff
)
(
@
bi_valid
PROP
)
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
bi_valid_mono
:
Proper
((
⊢
)
==>
impl
)
(
@
bi_valid
PROP
)
.
Proof
.
solve_proper
.
Qed
.
...
...
This diff is collapsed.
Click to expand it.
theories/proofmode/tactics.v
+
23
−
10
View file @
80fcebca
...
...
@@ -620,8 +620,28 @@ The tactic instantiates each dependent argument [x_i] with an evar and generates
a goal [P] for non-dependent arguments [x_i : P]. *)
Tactic
Notation
"iIntoValid"
open_constr
(
t
)
:=
let
rec
go
t
:=
(* We try two reduction tactics for the type of t before trying to
specialize it. We first try the head normal form in order to
unfold all the definition that could hide an entailment. Then,
we try the much weaker [eval cbv zeta], because entailment is
not necessarilly opaque, and could be unfolded by [hnf].
However, for calling type class search, we only use [cbv zeta]
in order to make sure we do not unfold [bi_valid]. *)
let
tT
:=
type
of
t
in
let
tT
:=
eval
cbv
zeta
in
tT
in
(* In the case tT contains let-bindings. *)
first
[
let
tT'
:=
eval
hnf
in
tT
in
go_specilize
t
tT'
|
let
tT'
:=
eval
cbv
zeta
in
tT
in
go_specilize
t
tT'
|
let
tT'
:=
eval
cbv
zeta
in
tT
in
eapply
(
as_valid_1
tT
);
(* Doing [apply _] here fails because that will try to solve all evars
whose type is a typeclass, in dependency order (according to Matthieu).
If one fails, it aborts. However, we rely on progress on the main goal
([AsValid ...]) to unify some of these evars and hence enable progress
elsewhere. With [typeclasses eauto], that seems to work better. *)
[
solve
[
typeclasses
eauto
with
typeclass_instances
]
||
fail
"iPoseProof: not a BI assertion"
|
exact
t
]]
with
go_specilize
t
tT
:=
lazymatch
tT
with
(* We do not use hnf of tT, because, if
entailment is not opaque, then it would
unfold it. *)
...
...
@@ -631,15 +651,8 @@ Tactic Notation "iIntoValid" open_constr(t) :=
(* This is a workarround for Coq bug #6583. *)
let
e
:=
fresh
in
evar
(
e
:
id
T
);
let
e'
:=
eval
unfold
e
in
e
in
clear
e
;
go
(
t
e'
)
|
_
=>
eapply
(
as_valid_1
tT
);
(* Doing [apply _] here fails because that will try to solve all evars
whose type is a typeclass, in dependency order (according to Matthieu).
If one fails, it aborts. However, we rely on progress on the main goal
([AsValid ...]) to unify some of these evars and hence enable progress
elsewhere. With [typeclasses eauto], that seems to work better. *)
[
solve
[
typeclasses
eauto
with
typeclass_instances
]
||
fail
"iPoseProof: not a BI assertion"
|
exact
t
]
end
in
end
in
go
t
.
(* The tactic [tac] is called with a temporary fresh name [H]. The argument
...
...
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