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
Gaëtan Gilbert
Iris
Commits
b00bd724
Commit
b00bd724
authored
1 year ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
update logatom_lock
parent
2f763566
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
iris_heap_lang/lib/lock.v
+3
-3
3 additions, 3 deletions
iris_heap_lang/lib/lock.v
iris_heap_lang/lib/logatom_lock.v
+10
-10
10 additions, 10 deletions
iris_heap_lang/lib/logatom_lock.v
with
13 additions
and
13 deletions
iris_heap_lang/lib/lock.v
+
3
−
3
View file @
b00bd724
...
...
@@ -12,11 +12,11 @@ Class lock `{!heapGS_gen hlc Σ} := Lock {
release
:
val
;
(** * Predicates *)
(** [name] is used to associate locked with [is_lock] *)
name
:
Type
;
lock_
name
:
Type
;
(** No namespace [N] parameter because we only expose program specs, which
anyway have the full mask. *)
is_lock
(
γ
:
name
)
(
lock
:
val
)
(
R
:
iProp
Σ
)
:
iProp
Σ
;
locked
(
γ
:
name
)
:
iProp
Σ
;
is_lock
(
γ
:
lock_
name
)
(
lock
:
val
)
(
R
:
iProp
Σ
)
:
iProp
Σ
;
locked
(
γ
:
lock_
name
)
:
iProp
Σ
;
(** * General properties of the predicates *)
is_lock_ne
γ
lk
:>
Contractive
(
is_lock
γ
lk
);
is_lock_persistent
γ
lk
R
:>
Persistent
(
is_lock
γ
lk
R
);
...
...
This diff is collapsed.
Click to expand it.
iris_heap_lang/lib/logatom_lock.v
+
10
−
10
View file @
b00bd724
...
...
@@ -25,20 +25,20 @@ Global Instance subG_lockΣ {Σ} : subG lockΣ Σ → lockG Σ.
Proof
.
solve_inG
.
Qed
.
Section
tada
.
Context
`{
!
heapGS
Σ
,
!
lockG
Σ
}
(
l
:
lock
)
.
Context
`{
!
heapGS
Σ
,
!
lockG
Σ
,
!
lock
}
.
Record
tada_lock_name
:=
TadaLockName
{
tada_lock_name_state
:
gname
;
tada_lock_name_lock
:
l
.(
name
)
;
tada_lock_name_lock
:
l
ock_
name
;
}
.
Definition
tada_lock_state
(
γ
:
tada_lock_name
)
(
s
:
state
)
:
iProp
Σ
:=
ghost_var
γ
.(
tada_lock_name_state
)
(
3
/
4
)
s
∗
if
s
is
Locked
then
l
.(
locked
)
γ
.(
tada_lock_name_lock
)
∗
ghost_var
γ
.(
tada_lock_name_state
)
(
1
/
4
)
Locked
locked
γ
.(
tada_lock_name_lock
)
∗
ghost_var
γ
.(
tada_lock_name_state
)
(
1
/
4
)
Locked
else
True
.
Definition
tada_is_lock
(
γ
:
tada_lock_name
)
(
lk
:
val
)
:
iProp
Σ
:=
l
.(
is_lock
)
γ
.(
tada_lock_name_lock
)
lk
is_lock
γ
.(
tada_lock_name_lock
)
lk
(
ghost_var
γ
.(
tada_lock_name_state
)
(
1
/
4
)
Free
)
.
Global
Instance
tada_is_lock_persistent
γ
lk
:
Persistent
(
tada_is_lock
γ
lk
)
.
...
...
@@ -56,7 +56,7 @@ Section tada.
Lemma
newlock_tada_spec
:
{{{
True
}}}
l
.(
newlock
)
#
()
newlock
#
()
{{{
lk
γ
,
RET
lk
;
tada_is_lock
γ
lk
∗
tada_lock_state
γ
Free
}}}
.
Proof
.
iIntros
(
Φ
)
"_ HΦ"
.
...
...
@@ -64,7 +64,7 @@ Section tada.
replace
1
%
Qp
with
(
3
/
4
+
1
/
4
)
%
Qp
;
last
first
.
{
rewrite
Qp
.
three_quarter_quarter
//.
}
iDestruct
"Hvar"
as
"[Hvar1 Hvar2]"
.
wp_apply
(
l
.
(
newlock_spec
)
with
"Hvar2"
)
as
(
lk
γlock
)
"Hlock"
.
wp_apply
(
newlock_spec
with
"Hvar2"
)
as
(
lk
γlock
)
"Hlock"
.
iApply
(
"HΦ"
$!
lk
(
TadaLockName
_
_))
.
iFrame
.
Qed
.
...
...
@@ -72,11 +72,11 @@ Section tada.
Lemma
acquire_tada_spec
γ
lk
:
tada_is_lock
γ
lk
-∗
<<<
∀∀
s
,
tada_lock_state
γ
s
>>>
l
.(
acquire
)
lk
@
∅
acquire
lk
@
∅
<<<
⌜
s
=
Free
⌝
∗
tada_lock_state
γ
Locked
,
RET
#
()
>>>.
Proof
.
iIntros
"#Hislock %Φ AU"
.
iApply
wp_fupd
.
wp_apply
(
l
.
(
acquire_spec
)
with
"Hislock"
)
as
"[Hlocked Hvar1]"
.
wp_apply
(
acquire_spec
with
"Hislock"
)
as
"[Hlocked Hvar1]"
.
iMod
"AU"
as
(
s
)
"[[Hvar2 _] [_ Hclose]]"
.
iCombine
"Hvar1 Hvar2"
gives
%
[_
<-
]
.
iMod
(
ghost_var_update_2
Locked
with
"Hvar1 Hvar2"
)
as
"[Hvar1 Hvar2]"
.
...
...
@@ -87,7 +87,7 @@ Section tada.
Lemma
release_tada_spec
γ
lk
:
tada_is_lock
γ
lk
-∗
<<<
tada_lock_state
γ
Locked
>>>
l
.(
release
)
lk
@
∅
release
lk
@
∅
<<<
tada_lock_state
γ
Free
,
RET
#
()
>>>.
Proof
.
iIntros
"#Hislock %Φ AU"
.
iApply
fupd_wp
.
...
...
@@ -95,7 +95,7 @@ Section tada.
iMod
(
ghost_var_update_2
Free
with
"Hvar1 Hvar2"
)
as
"[Hvar1 Hvar2]"
.
{
rewrite
Qp
.
three_quarter_quarter
//.
}
iMod
(
"Hclose"
with
"[$Hvar1]"
)
.
iModIntro
.
wp_apply
(
l
.
(
release_spec
)
with
"[$Hislock $Hlocked $Hvar2]"
)
.
wp_apply
(
release_spec
with
"[$Hislock $Hlocked $Hvar2]"
)
.
auto
.
Qed
.
...
...
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