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
4ee03a57
There was a problem fetching the pipeline summary.
Commit
4ee03a57
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
update Iris; tweak lock a little
parent
25b69ba8
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
opam.pins
+1
-1
1 addition, 1 deletion
opam.pins
theories/lang/lang.v
+4
-1
4 additions, 1 deletion
theories/lang/lang.v
theories/lang/lib/lock.v
+14
-12
14 additions, 12 deletions
theories/lang/lib/lock.v
with
19 additions
and
14 deletions
opam.pins
+
1
−
1
View file @
4ee03a57
coq-iris https://gitlab.mpi-sws.org/FP/iris-coq f9
8
7c
a782d1301d319cf6c4ba8e2ab449ebe903
a
coq-iris https://gitlab.mpi-sws.org/FP/iris-coq
35551d40
f9
2
7c
1d567993ff27eeb46f64788efc
a
This diff is collapsed.
Click to expand it.
theories/lang/lang.v
+
4
−
1
View file @
4ee03a57
...
@@ -182,8 +182,11 @@ Proof.
...
@@ -182,8 +182,11 @@ Proof.
Qed
.
Qed
.
(** The stepping relation *)
(** The stepping relation *)
Definition
Z_of_bool
(
b
:
bool
)
:
Z
:=
if
b
then
1
else
0
.
Definition
lit_of_bool
(
b
:
bool
)
:
base_lit
:=
Definition
lit_of_bool
(
b
:
bool
)
:
base_lit
:=
LitInt
(
if
b
then
1
else
0
)
.
LitInt
$
Z_of_bool
b
.
Definition
shift_loc
(
l
:
loc
)
(
z
:
Z
)
:
loc
:=
(
l
.
1
,
l
.
2
+
z
)
.
Definition
shift_loc
(
l
:
loc
)
(
z
:
Z
)
:
loc
:=
(
l
.
1
,
l
.
2
+
z
)
.
...
...
This diff is collapsed.
Click to expand it.
theories/lang/lib/lock.v
+
14
−
12
View file @
4ee03a57
...
@@ -40,22 +40,24 @@ Section proof.
...
@@ -40,22 +40,24 @@ Section proof.
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_ne
l
:
NonExpansive
(
is_lock
γ
l
)
.
Global
Instance
is_lock_contractive
γ
l
:
Contractive
(
is_lock
γ
l
)
.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_contractive
.
Qed
.
Global
Instance
is_lock_ne
γ
l
:
NonExpansive
(
is_lock
γ
l
)
.
Proof
.
exact
:
contractive_ne
.
Qed
.
(** The main proofs. *)
Global
Instance
is_lock_persistent
γ
l
R
:
PersistentP
(
is_lock
γ
l
R
)
.
Global
Instance
is_lock_persistent
γ
l
R
:
PersistentP
(
is_lock
γ
l
R
)
.
Proof
.
apply
_
.
Qed
.
Proof
.
apply
_
.
Qed
.
Global
Instance
locked_timeless
γ
:
TimelessP
(
locked
γ
)
.
Global
Instance
locked_timeless
γ
:
TimelessP
(
locked
γ
)
.
Proof
.
apply
_
.
Qed
.
Proof
.
apply
_
.
Qed
.
Lemma
newlock_inplace
(
E
:
coPset
)
(
R
:
iProp
Σ
)
l
:
(** The main proofs. *)
▷
R
-∗
l
↦
#
false
=
{
E
}
=∗
∃
γ
,
is_lock
γ
l
R
∗
own_lock
γ
1
%
Qp
.
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
.
Proof
.
Proof
.
iIntros
"H
R
H
l
"
.
iIntros
"H
l
H
R
"
.
iMod
(
own_alloc
(
Excl
()))
as
(
γ
)
"Hγ"
;
first
done
.
iMod
(
own_alloc
(
Excl
()))
as
(
γ
)
"Hγ"
;
first
done
.
iMod
(
cinv_alloc
_
N
(
lock_inv
γ
l
R
)
with
"[-]"
)
as
(
γ'
)
"Hlock"
.
iMod
(
cinv_alloc
_
N
(
lock_inv
γ
l
R
)
with
"[-]"
)
as
(
γ'
)
"Hlock"
.
{
i
Next
.
iExists
false
.
by
iFrame
.
}
{
i
Exists
b
.
destruct
b
;
by
iFrame
.
}
iModIntro
.
iExists
(_,
_)
.
eauto
.
iModIntro
.
iExists
(_,
_)
.
eauto
.
Qed
.
Qed
.
...
@@ -65,18 +67,18 @@ Section proof.
...
@@ -65,18 +67,18 @@ Section proof.
iIntros
(
Φ
)
"HR HΦ"
.
iApply
wp_fupd
.
iIntros
(
Φ
)
"HR HΦ"
.
iApply
wp_fupd
.
wp_seq
.
wp_alloc
l
vl
as
"Hl"
"H†"
.
inv_vec
vl
=>
x
.
wp_seq
.
wp_alloc
l
vl
as
"Hl"
"H†"
.
inv_vec
vl
=>
x
.
rewrite
heap_mapsto_vec_singleton
.
(* FIXME shouldn't this also compute now, like bigops do? *)
rewrite
heap_mapsto_vec_singleton
.
(* FIXME shouldn't this also compute now, like bigops do? *)
wp_let
.
wp_write
.
wp_let
.
wp_write
.
iMod
(
newlock_inplace
with
"Hl HR"
)
as
(
γ
)
"?"
.
iMod
(
newlock_inplace
with
"HR Hl"
)
as
(
γ
)
"?"
.
by
iApply
"HΦ"
.
by
iApply
"HΦ"
.
Qed
.
Qed
.
Lemma
destroy_lock
E
γ
l
R
:
Lemma
destroy_lock
E
γ
l
R
:
↑
N
⊆
E
→
↑
N
⊆
E
→
is_lock
γ
l
R
-∗
own_lock
γ
1
%
Qp
=
{
E
}
=∗
∃
(
b
:
bool
),
l
↦
#
b
.
is_lock
γ
l
R
-∗
own_lock
γ
1
%
Qp
=
{
E
}
=∗
∃
(
b
:
bool
),
l
↦
#
b
∗
if
b
then
True
else
▷
R
.
Proof
.
Proof
.
iIntros
(?)
"#Hinv Hown"
.
iIntros
(?)
"#Hinv Hown"
.
iMod
(
cinv_cancel
with
"Hinv Hown"
)
as
(
b
)
"[>Hl _]"
;
first
done
.
iMod
(
cinv_cancel
with
"Hinv Hown"
)
as
(
b
)
"[>Hl HR]"
;
first
done
.
eauto
.
iExists
b
.
destruct
b
;
first
by
eauto
.
iDestruct
"HR"
as
"[_ $]"
.
done
.
Qed
.
Qed
.
Lemma
try_acquire_spec
γ
l
R
q
:
Lemma
try_acquire_spec
γ
l
R
q
:
...
...
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