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
1ac24719
Commit
1ac24719
authored
7 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
Add iAccu tactic.
parent
fd86587a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
theories/proofmode/coq_tactics.v
+21
-0
21 additions, 0 deletions
theories/proofmode/coq_tactics.v
theories/proofmode/tactics.v
+4
-1
4 additions, 1 deletion
theories/proofmode/tactics.v
theories/tests/proofmode.v
+6
-0
6 additions, 0 deletions
theories/tests/proofmode.v
with
31 additions
and
1 deletion
theories/proofmode/coq_tactics.v
+
21
−
0
View file @
1ac24719
...
...
@@ -126,6 +126,12 @@ Definition envs_split {PROP} (d : direction)
''
(
Δ1
,
Δ2
)
←
envs_split_go
js
Δ
(
envs_clear_spatial
Δ
);
if
d
is
Right
then
Some
(
Δ1
,
Δ2
)
else
Some
(
Δ2
,
Δ1
)
.
Definition
prop_of_env
{
PROP
:
bi
}
(
Γ
:
env
PROP
)
:
PROP
:=
let
fix
aux
Γ
acc
:=
match
Γ
with
Enil
=>
acc
|
Esnoc
Γ
_
P
=>
aux
Γ
(
P
∗
acc
)
%
I
end
in
match
Γ
with
Enil
=>
emp
%
I
|
Esnoc
Γ
_
P
=>
aux
Γ
P
end
.
(* Coq versions of the tactics *)
Section
bi_tactics
.
Context
{
PROP
:
bi
}
.
...
...
@@ -420,6 +426,14 @@ Proof.
destruct
d
;
simplify_eq
/=
;
solve_sep_entails
.
Qed
.
Lemma
prop_of_env_sound
Δ
:
of_envs
Δ
⊢
prop_of_env
(
env_spatial
Δ
)
.
Proof
.
destruct
Δ
as
[?
Γ
]
.
rewrite
/
of_envs
/=
and_elim_r
sep_elim_r
.
destruct
Γ
as
[|
Γ
?
P0
]=>
//=.
revert
P0
.
induction
Γ
as
[|
Γ
IH
?
P
]=>
P0
;
[
rewrite
/=
right_id
//|
]
.
rewrite
/=
assoc
(
comm
_
P0
P
)
IH
//.
Qed
.
Global
Instance
envs_Forall2_refl
(
R
:
relation
PROP
)
:
Reflexive
R
→
Reflexive
(
envs_Forall2
R
)
.
Proof
.
by
constructor
.
Qed
.
...
...
@@ -1062,6 +1076,13 @@ Proof.
apply
wand_elim_r'
,
wand_mono
;
last
done
.
apply
wand_intro_r
,
wand_intro_r
.
rewrite
affinely_persistently_if_elim
-
assoc
wand_curry
.
auto
.
Qed
.
(** * Accumulate hypotheses *)
Lemma
tac_accu
Δ
P
:
prop_of_env
(
env_spatial
Δ
)
=
P
→
envs_entails
Δ
P
.
Proof
.
rewrite
envs_entails_eq
=>
<-.
apply
prop_of_env_sound
.
Qed
.
End
bi_tactics
.
(** The following _private_ classes are used internally by [tac_modal_intro] /
...
...
This diff is collapsed.
Click to expand it.
theories/proofmode/tactics.v
+
4
−
1
View file @
1ac24719
...
...
@@ -16,7 +16,7 @@ Declare Reduction env_cbv := cbv [
envs_lookup
envs_lookup_delete
envs_delete
envs_snoc
envs_app
envs_simple_replace
envs_replace
envs_split
envs_clear_spatial
envs_clear_persistent
envs_split_go
envs_split
]
.
envs_split_go
envs_split
prop_of_env
]
.
Ltac
env_cbv
:=
match
goal
with
|
-
?u
=>
let
v
:=
eval
env_cbv
in
u
in
change
v
end
.
Ltac
env_reflexivity
:=
env_cbv
;
exact
eq_refl
.
...
...
@@ -1936,6 +1936,9 @@ Tactic Notation "iInv" constr(N) "with" constr(Hs) "as" "(" simple_intropattern(
constr
(
pat
)
constr
(
Hclose
)
:=
iInvCore
N
with
Hs
as
(
fun
H
=>
iDestructHyp
H
as
(
x1
x2
x3
x4
)
pat
)
Hclose
.
Tactic
Notation
"iAccu"
:=
eapply
tac_accu
;
env_reflexivity
.
Hint
Extern
0
(_
⊢
_)
=>
iStartProof
.
(* Make sure that by and done solve trivial things in proof mode *)
...
...
This diff is collapsed.
Click to expand it.
theories/tests/proofmode.v
+
6
−
0
View file @
1ac24719
...
...
@@ -386,4 +386,10 @@ Proof.
eexists
.
split
.
iIntros
"HP #HQ"
.
iFrame
"HQ HP"
.
iEmpIntro
.
done
.
Qed
.
Lemma
test_iAccu
P
Q
R
S
:
∃
PP
,
(
□
P
-∗
Q
-∗
R
-∗
S
-∗
PP
)
∧
PP
=
(
Q
∗
R
∗
S
)
%
I
.
Proof
.
eexists
.
split
.
iIntros
"#? ? ? ?"
.
iAccu
.
done
.
Qed
.
End
tests
.
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