Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lambda-rust
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
Model registry
Operate
Environments
Monitor
Service Desk
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
Iris
lambda-rust
Commits
6e29b5c9
There was a problem fetching the pipeline summary.
Commit
6e29b5c9
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
lock allows applying equivalences
parent
4ee03a57
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
opam.pins
+1
-1
1 addition, 1 deletion
opam.pins
theories/lang/lib/lock.v
+13
-4
13 additions, 4 deletions
theories/lang/lib/lock.v
with
14 additions
and
5 deletions
opam.pins
+
1
−
1
View file @
6e29b5c9
coq-iris https://gitlab.mpi-sws.org/FP/iris-coq
35551d40f927c1d567993ff27eeb46f64788efca
coq-iris https://gitlab.mpi-sws.org/FP/iris-coq
1edf71ef9809456c29454d8ad60c34ea10e36fe8
This diff is collapsed.
Click to expand it.
theories/lang/lib/lock.v
+
13
−
4
View file @
6e29b5c9
...
@@ -28,16 +28,13 @@ Section proof.
...
@@ -28,16 +28,13 @@ Section proof.
(
∃
b
:
bool
,
l
↦
#
b
∗
if
b
then
True
else
own
γ
(
Excl
())
∗
R
)
%
I
.
(
∃
b
:
bool
,
l
↦
#
b
∗
if
b
then
True
else
own
γ
(
Excl
())
∗
R
)
%
I
.
Definition
is_lock
(
γ
:
lockname
)
(
l
:
loc
)
(
R
:
iProp
Σ
)
:
iProp
Σ
:=
Definition
is_lock
(
γ
:
lockname
)
(
l
:
loc
)
(
R
:
iProp
Σ
)
:
iProp
Σ
:=
(
cinv
N
(
γ
.
1
)
(
lock_inv
(
γ
.
2
)
l
R
)
)
%
I
.
cinv
N
(
γ
.
1
)
(
lock_inv
(
γ
.
2
)
l
R
)
.
Definition
own_lock
(
γ
:
lockname
)
:
frac
→
iProp
Σ
:=
Definition
own_lock
(
γ
:
lockname
)
:
frac
→
iProp
Σ
:=
cinv_own
(
γ
.
1
)
.
cinv_own
(
γ
.
1
)
.
Definition
locked
(
γ
:
lockname
):
iProp
Σ
:=
own
(
γ
.
2
)
(
Excl
())
.
Definition
locked
(
γ
:
lockname
):
iProp
Σ
:=
own
(
γ
.
2
)
(
Excl
())
.
Lemma
locked_exclusive
(
γ
:
lockname
)
:
locked
γ
-∗
locked
γ
-∗
False
.
Proof
.
iIntros
"H1 H2"
.
by
iDestruct
(
own_valid_2
with
"H1 H2"
)
as
%
?
.
Qed
.
Global
Instance
lock_inv_ne
γ
l
:
NonExpansive
(
lock_inv
γ
l
)
.
Global
Instance
lock_inv_ne
γ
l
:
NonExpansive
(
lock_inv
γ
l
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
is_lock_contractive
γ
l
:
Contractive
(
is_lock
γ
l
)
.
Global
Instance
is_lock_contractive
γ
l
:
Contractive
(
is_lock
γ
l
)
.
...
@@ -50,6 +47,18 @@ Section proof.
...
@@ -50,6 +47,18 @@ Section proof.
Global
Instance
locked_timeless
γ
:
TimelessP
(
locked
γ
)
.
Global
Instance
locked_timeless
γ
:
TimelessP
(
locked
γ
)
.
Proof
.
apply
_
.
Qed
.
Proof
.
apply
_
.
Qed
.
Lemma
locked_exclusive
(
γ
:
lockname
)
:
locked
γ
-∗
locked
γ
-∗
False
.
Proof
.
iIntros
"H1 H2"
.
by
iDestruct
(
own_valid_2
with
"H1 H2"
)
as
%
?
.
Qed
.
Lemma
is_lock_iff
γ
l
R
R'
:
□
▷
(
R
↔
R'
)
-∗
is_lock
γ
l
R
-∗
is_lock
γ
l
R'
.
Proof
.
iIntros
"#HRR' Hlck"
.
iApply
cinv_iff
;
last
done
.
iNext
.
iAlways
.
iSplit
;
iIntros
"Hinv"
;
iDestruct
"Hinv"
as
(
b
)
"[Hl HR]"
;
iExists
b
;
iFrame
"Hl"
;
(
destruct
b
;
first
done
);
iDestruct
"HR"
as
"[$ HR]"
;
by
iApply
"HRR'"
.
Qed
.
(** The main proofs. *)
(** The main proofs. *)
Lemma
newlock_inplace
(
E
:
coPset
)
(
R
:
iProp
Σ
)
l
(
b
:
bool
)
:
Lemma
newlock_inplace
(
E
:
coPset
)
(
R
:
iProp
Σ
)
l
(
b
:
bool
)
:
l
↦
#
b
-∗
(
if
b
then
True
else
▷
R
)
=
{
E
}
=∗
∃
γ
,
is_lock
γ
l
R
∗
own_lock
γ
1
%
Qp
.
l
↦
#
b
-∗
(
if
b
then
True
else
▷
R
)
=
{
E
}
=∗
∃
γ
,
is_lock
γ
l
R
∗
own_lock
γ
1
%
Qp
.
...
...
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