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
41d72be6
Commit
41d72be6
authored
5 years ago
by
Robbert Krebbers
Browse files
Options
Downloads
Patches
Plain Diff
Remove namespaces from lock API.
parent
365095a0
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
theories/heap_lang/lib/lock.v
+14
-14
14 additions, 14 deletions
theories/heap_lang/lib/lock.v
theories/heap_lang/lib/spin_lock.v
+2
-1
2 additions, 1 deletion
theories/heap_lang/lib/spin_lock.v
theories/heap_lang/lib/ticket_lock.v
+2
-1
2 additions, 1 deletion
theories/heap_lang/lib/ticket_lock.v
with
18 additions
and
16 deletions
theories/heap_lang/lib/lock.v
+
14
−
14
View file @
41d72be6
...
@@ -10,31 +10,31 @@ Structure lock Σ `{!heapG Σ} := Lock {
...
@@ -10,31 +10,31 @@ Structure lock Σ `{!heapG Σ} := Lock {
(* -- predicates -- *)
(* -- predicates -- *)
(* name is used to associate locked with is_lock *)
(* name is used to associate locked with is_lock *)
name
:
Type
;
name
:
Type
;
is_lock
(
N
:
namespace
)
(
γ
:
name
)
(
lock
:
val
)
(
R
:
iProp
Σ
)
:
iProp
Σ
;
is_lock
(
γ
:
name
)
(
lock
:
val
)
(
R
:
iProp
Σ
)
:
iProp
Σ
;
locked
(
γ
:
name
)
:
iProp
Σ
;
locked
(
γ
:
name
)
:
iProp
Σ
;
(* -- general properties -- *)
(* -- general properties -- *)
is_lock_ne
N
γ
lk
:
Contractive
(
is_lock
N
γ
lk
);
is_lock_ne
γ
lk
:
Contractive
(
is_lock
γ
lk
);
is_lock_persistent
N
γ
lk
R
:
Persistent
(
is_lock
N
γ
lk
R
);
is_lock_persistent
γ
lk
R
:
Persistent
(
is_lock
γ
lk
R
);
is_lock_iff
N
γ
lk
R1
R2
:
is_lock_iff
γ
lk
R1
R2
:
is_lock
N
γ
lk
R1
-∗
▷
□
(
R1
↔
R2
)
-∗
is_lock
N
γ
lk
R2
;
is_lock
γ
lk
R1
-∗
▷
□
(
R1
↔
R2
)
-∗
is_lock
γ
lk
R2
;
locked_timeless
γ
:
Timeless
(
locked
γ
);
locked_timeless
γ
:
Timeless
(
locked
γ
);
locked_exclusive
γ
:
locked
γ
-∗
locked
γ
-∗
False
;
locked_exclusive
γ
:
locked
γ
-∗
locked
γ
-∗
False
;
(* -- operation specs -- *)
(* -- operation specs -- *)
newlock_spec
N
(
R
:
iProp
Σ
)
:
newlock_spec
(
R
:
iProp
Σ
)
:
{{{
R
}}}
newlock
#
()
{{{
lk
γ
,
RET
lk
;
is_lock
N
γ
lk
R
}}};
{{{
R
}}}
newlock
#
()
{{{
lk
γ
,
RET
lk
;
is_lock
γ
lk
R
}}};
acquire_spec
N
γ
lk
R
:
acquire_spec
γ
lk
R
:
{{{
is_lock
N
γ
lk
R
}}}
acquire
lk
{{{
RET
#
();
locked
γ
∗
R
}}};
{{{
is_lock
γ
lk
R
}}}
acquire
lk
{{{
RET
#
();
locked
γ
∗
R
}}};
release_spec
N
γ
lk
R
:
release_spec
γ
lk
R
:
{{{
is_lock
N
γ
lk
R
∗
locked
γ
∗
R
}}}
release
lk
{{{
RET
#
();
True
}}}
{{{
is_lock
γ
lk
R
∗
locked
γ
∗
R
}}}
release
lk
{{{
RET
#
();
True
}}}
}
.
}
.
Arguments
newlock
{_
_}
_
.
Arguments
newlock
{_
_}
_
.
Arguments
acquire
{_
_}
_
.
Arguments
acquire
{_
_}
_
.
Arguments
release
{_
_}
_
.
Arguments
release
{_
_}
_
.
Arguments
is_lock
{_
_}
_
_
_
_
_
.
Arguments
is_lock
{_
_}
_
_
_
_
.
Arguments
locked
{_
_}
_
_
.
Arguments
locked
{_
_}
_
_
.
Existing
Instances
is_lock_ne
is_lock_persistent
locked_timeless
.
Existing
Instances
is_lock_ne
is_lock_persistent
locked_timeless
.
Instance
is_lock_proper
Σ
`{
!
heapG
Σ
}
(
L
:
lock
Σ
)
N
γ
lk
:
Instance
is_lock_proper
Σ
`{
!
heapG
Σ
}
(
L
:
lock
Σ
)
γ
lk
:
Proper
((
≡
)
==>
(
≡
))
(
is_lock
L
N
γ
lk
)
:=
ne_proper
_
.
Proper
((
≡
)
==>
(
≡
))
(
is_lock
L
γ
lk
)
:=
ne_proper
_
.
This diff is collapsed.
Click to expand it.
theories/heap_lang/lib/spin_lock.v
+
2
−
1
View file @
41d72be6
...
@@ -21,7 +21,8 @@ Instance subG_lockΣ {Σ} : subG lockΣ Σ → lockG Σ.
...
@@ -21,7 +21,8 @@ Instance subG_lockΣ {Σ} : subG lockΣ Σ → lockG Σ.
Proof
.
solve_inG
.
Qed
.
Proof
.
solve_inG
.
Qed
.
Section
proof
.
Section
proof
.
Context
`{
!
heapG
Σ
,
!
lockG
Σ
}
(
N
:
namespace
)
.
Context
`{
!
heapG
Σ
,
!
lockG
Σ
}
.
Let
N
:=
nroot
.
@
"spin_lock"
.
Definition
lock_inv
(
γ
:
gname
)
(
l
:
loc
)
(
R
:
iProp
Σ
)
:
iProp
Σ
:=
Definition
lock_inv
(
γ
:
gname
)
(
l
:
loc
)
(
R
:
iProp
Σ
)
:
iProp
Σ
:=
(
∃
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
.
...
...
This diff is collapsed.
Click to expand it.
theories/heap_lang/lib/ticket_lock.v
+
2
−
1
View file @
41d72be6
...
@@ -37,7 +37,8 @@ Instance subG_tlockΣ {Σ} : subG tlockΣ Σ → tlockG Σ.
...
@@ -37,7 +37,8 @@ Instance subG_tlockΣ {Σ} : subG tlockΣ Σ → tlockG Σ.
Proof
.
solve_inG
.
Qed
.
Proof
.
solve_inG
.
Qed
.
Section
proof
.
Section
proof
.
Context
`{
!
heapG
Σ
,
!
tlockG
Σ
}
(
N
:
namespace
)
.
Context
`{
!
heapG
Σ
,
!
tlockG
Σ
}
.
Let
N
:=
nroot
.
@
"ticket_lock"
.
Definition
lock_inv
(
γ
:
gname
)
(
lo
ln
:
loc
)
(
R
:
iProp
Σ
)
:
iProp
Σ
:=
Definition
lock_inv
(
γ
:
gname
)
(
lo
ln
:
loc
)
(
R
:
iProp
Σ
)
:
iProp
Σ
:=
(
∃
o
n
:
nat
,
(
∃
o
n
:
nat
,
...
...
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