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
Pierre Roux
Iris
Commits
3e0e21a2
Commit
3e0e21a2
authored
2 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
make iAuIntro smarter
parent
01557046
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iris/bi/lib/atomic.v
+17
-9
17 additions, 9 deletions
iris/bi/lib/atomic.v
iris/bi/lib/laterable.v
+15
-1
15 additions, 1 deletion
iris/bi/lib/laterable.v
with
32 additions
and
10 deletions
iris/bi/lib/atomic.v
+
17
−
9
View file @
3e0e21a2
...
@@ -456,15 +456,18 @@ Section proof_mode.
...
@@ -456,15 +456,18 @@ Section proof_mode.
Proof
.
rewrite
make_laterable_id_eq
.
done
.
Qed
.
Proof
.
rewrite
make_laterable_id_eq
.
done
.
Qed
.
Lemma
tac_aupd_intro
Γp
Γs
n
α
β
Eo
Ei
Φ
P
:
Lemma
tac_aupd_intro
Γp
Γs
n
α
β
Eo
Ei
Φ
P
:
Laterable
(
PROP
:=
PROP
)
emp
→
match
Γs
with
Enil
=>
Laterable
(
PROP
:=
PROP
)
emp
|
_
=>
TCTrue
end
→
TCForall
Laterable
(
env_to_list
Γs
)
→
TCForall
Laterable
(
env_to_list
Γs
)
→
P
=
env_to_prop
Γs
→
P
=
env_to_prop
Γs
→
envs_entails
(
Envs
Γp
Γs
n
)
(
atomic_acc
Eo
Ei
α
P
β
Φ
)
→
envs_entails
(
Envs
Γp
Γs
n
)
(
atomic_acc
Eo
Ei
α
P
β
Φ
)
→
envs_entails
(
Envs
Γp
Γs
n
)
(
atomic_update
Eo
Ei
α
β
Φ
)
.
envs_entails
(
Envs
Γp
Γs
n
)
(
atomic_update
Eo
Ei
α
β
Φ
)
.
Proof
.
Proof
.
intros
?
HΓs
->
.
rewrite
envs_entails_unseal
of_envs_eq
/
atomic_acc
/=.
intros
Hemp
HΓs
->
.
rewrite
envs_entails_unseal
of_envs_eq
/
atomic_acc
/=.
setoid_rewrite
env_to_prop_sound
=>
HAU
.
setoid_rewrite
env_to_prop_sound
=>
HAU
.
rewrite
assoc
.
apply
:
aupd_intro
.
by
rewrite
-
assoc
.
rewrite
assoc
.
apply
:
aupd_intro
.
{
destruct
Γs
as
[|
Γs
i
P
];
first
done
.
inversion
HΓs
.
simpl
.
apply
big_sep_sepL_laterable
;
done
.
}
by
rewrite
-
assoc
.
Qed
.
Qed
.
End
proof_mode
.
End
proof_mode
.
...
@@ -475,18 +478,23 @@ Local Ltac iMakeLaterable :=
...
@@ -475,18 +478,23 @@ Local Ltac iMakeLaterable :=
iApply
make_laterable_id_elim
;
iModIntro
.
iApply
make_laterable_id_elim
;
iModIntro
.
Tactic
Notation
"iAuIntro"
:=
Tactic
Notation
"iAuIntro"
:=
iMakeLaterable
;
notypeclasses
refine
(
tac_aupd_intro
_
_
_
_
_
_
_
_
_
_
_
_
_);
[
iMakeLaterable
;
iSolveTC
||
fail
"iAuIntro: emp not laterable"
match
goal
with
|
iSolveTC
||
fail
"iAuIntro: context not laterable; this should not happen, please report a bug"
|
|
-
envs_entails
(
Envs
?Γp
?Γs
_)
(
atomic_update
_
_
_
_
?Φ
)
=>
|
(* P = ...: make the P pretty *)
pm_reflexivity
notypeclasses
refine
(
tac_aupd_intro
Γp
Γs
_
_
_
_
_
Φ
_
_
_
_
_);
[
|
(* the new proof mode goal *)
]
.
(* The [match Γs] precondition *)
iSolveTC
||
fail
"iAuIntro: spacial context empty, and emp not laterable"
|
iSolveTC
||
fail
"iAuIntro: context not laterable; this should not happen, please report a bug"
|
(* P = ...: make the P pretty *)
pm_reflexivity
|
(* the new proof mode goal *)
]
end
.
(** Tactic to apply [aacc_intro]. This only really works well when you have
(** Tactic to apply [aacc_intro]. This only really works well when you have
[α ?] already and pass it as [iAaccIntro with "Hα"]. Doing
[α ?] already and pass it as [iAaccIntro with "Hα"]. Doing
[rewrite /atomic_acc /=] is an entirely legitimate alternative. *)
[rewrite /atomic_acc /=] is an entirely legitimate alternative. *)
Tactic
Notation
"iAaccIntro"
"with"
constr
(
sel
)
:=
Tactic
Notation
"iAaccIntro"
"with"
constr
(
sel
)
:=
iStartProof
;
lazymatch
goal
with
iStartProof
;
lazymatch
goal
with
|
|
-
environments
.
envs_entails
_
(
@
atomic_acc
?PROP
?H
?TA
?TB
?Eo
?Ei
?α
?P
?β
?Φ
)
=>
|
|
-
envs_entails
_
(
@
atomic_acc
?PROP
?H
?TA
?TB
?Eo
?Ei
?α
?P
?β
?Φ
)
=>
iApply
(
@
aacc_intro
PROP
H
TA
TB
Eo
Ei
α
P
β
Φ
with
sel
);
iApply
(
@
aacc_intro
PROP
H
TA
TB
Eo
Ei
α
P
β
Φ
with
sel
);
first
try
solve_ndisj
;
last
iSplit
first
try
solve_ndisj
;
last
iSplit
|
_
=>
fail
"iAAccIntro: Goal is not an atomic accessor"
|
_
=>
fail
"iAAccIntro: Goal is not an atomic accessor"
...
...
This diff is collapsed.
Click to expand it.
iris/bi/lib/laterable.v
+
15
−
1
View file @
3e0e21a2
...
@@ -88,11 +88,25 @@ Section instances.
...
@@ -88,11 +88,25 @@ Section instances.
iExists
Q
.
iIntros
"{$HQ} !> HQ"
.
iExists
x
.
by
iApply
"HΦ"
.
iExists
Q
.
iIntros
"{$HQ} !> HQ"
.
iExists
x
.
by
iApply
"HΦ"
.
Qed
.
Qed
.
Lemma
big_sep_sepL_laterable
Q
Ps
:
Laterable
Q
→
TCForall
Laterable
Ps
→
Laterable
(
Q
∗
[
∗
]
Ps
)
.
Proof
.
intros
HQ
HPs
.
revert
Q
HQ
.
induction
HPs
as
[|
P
Ps
??
IH
];
intros
Q
HQ
.
{
simpl
.
rewrite
right_id
.
done
.
}
simpl
.
rewrite
assoc
.
apply
IH
;
by
apply
_
.
Qed
.
Global
Instance
big_sepL_laterable
Ps
:
Global
Instance
big_sepL_laterable
Ps
:
Laterable
(
PROP
:=
PROP
)
emp
→
Laterable
(
PROP
:=
PROP
)
emp
→
TCForall
Laterable
Ps
→
TCForall
Laterable
Ps
→
Laterable
([
∗
]
Ps
)
.
Laterable
([
∗
]
Ps
)
.
Proof
.
induction
2
;
simpl
;
apply
_
.
Qed
.
Proof
.
intros
.
assert
(
Laterable
(
emp
∗
[
∗
]
Ps
))
as
Hlater
.
{
apply
big_sep_sepL_laterable
;
done
.
}
rewrite
->
left_id
in
Hlater
;
last
by
apply
_
.
done
.
Qed
.
(** A wrapper to obtain a weaker, laterable form of any assertion.
(** A wrapper to obtain a weaker, laterable form of any assertion.
Alternatively: the modality corresponding to [Laterable].
Alternatively: the modality corresponding to [Laterable].
...
...
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