Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
Iron
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Iris
Iron
Commits
0b58a0c8
Commit
0b58a0c8
authored
May 24, 2019
by
Hai Dang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bump Iris (changes in auth)
parent
cfcd6329
Pipeline
#17256
failed with stage
in 13 minutes and 36 seconds
Changes
7
Pipelines
16
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
33 additions
and
26 deletions
+33
-26
opam
opam
+1
-1
theories/algebra/ufrac_auth.v
theories/algebra/ufrac_auth.v
+16
-10
theories/heap_lang/adequacy.v
theories/heap_lang/adequacy.v
+5
-5
theories/heap_lang/heap.v
theories/heap_lang/heap.v
+2
-2
theories/heap_lang/lib/queue.v
theories/heap_lang/lib/queue.v
+4
-3
theories/heap_lang/lib/spin_lock_track.v
theories/heap_lang/lib/spin_lock_track.v
+4
-4
theories/iron_logic/fcinv.v
theories/iron_logic/fcinv.v
+1
-1
No files found.
opam
View file @
0b58a0c8
...
@@ -9,6 +9,6 @@ build: [make "-j%{jobs}%"]
...
@@ -9,6 +9,6 @@ build: [make "-j%{jobs}%"]
install: [make "install"]
install: [make "install"]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/iron" ]
remove: [ "sh" "-c" "rm -rf '%{lib}%/coq/user-contrib/iron" ]
depends: [
depends: [
"coq-iris" { (= "dev.2019-05-
09.1.d0daa181
") | (= "dev") }
"coq-iris" { (= "dev.2019-05-
24.0.c9984c7f
") | (= "dev") }
]
]
theories/algebra/ufrac_auth.v
View file @
0b58a0c8
...
@@ -53,21 +53,27 @@ Section ufrac_auth.
...
@@ -53,21 +53,27 @@ Section ufrac_auth.
Proof
.
solve_proper
.
Qed
.
Proof
.
solve_proper
.
Qed
.
Global
Instance
ufrac_auth_auth_discrete
a
:
Discrete
a
→
Discrete
(
●
?{
q
}
a
).
Global
Instance
ufrac_auth_auth_discrete
a
:
Discrete
a
→
Discrete
(
●
?{
q
}
a
).
Proof
.
intros
;
apply
Auth_discrete
;
apply
_
.
Qed
.
Proof
.
intros
;
apply
(@
auth_auth_discrete
(
optionUR
(
prodR
fracR
A
)))
;
[
apply
Some_discrete
|]
;
apply
_
.
Qed
.
Global
Instance
ufrac_auth_frag_discrete
a
:
Discrete
a
→
Discrete
(
◯
?{
q
}
a
).
Global
Instance
ufrac_auth_frag_discrete
a
:
Discrete
a
→
Discrete
(
◯
?{
q
}
a
).
Proof
.
intros
;
apply
Auth_discrete
,
Some_discrete
;
apply
_
.
Qed
.
Proof
.
intros
;
apply
(@
auth_frag_discrete
(
optionUR
(
prodR
fracR
A
))),
Some_discrete
;
apply
_
.
Qed
.
Lemma
ufrac_auth_validN
n
a
p
:
✓
{
n
}
a
→
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
p
}
a
).
Lemma
ufrac_auth_validN
n
a
p
:
✓
{
n
}
a
→
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
p
}
a
).
Proof
.
done
.
Qed
.
Proof
.
by
rewrite
auth_both_validN
.
Qed
.
Lemma
ufrac_auth_valid
p
a
:
✓
a
→
✓
(
●
?{
p
}
a
⋅
◯
?{
p
}
a
).
Lemma
ufrac_auth_valid
p
a
:
✓
a
→
✓
(
●
?{
p
}
a
⋅
◯
?{
p
}
a
).
Proof
.
done
.
Qed
.
Proof
.
intros
.
by
apply
(@
auth_both_valid_2
(
optionUR
(
prodR
ufracR
A
)))
.
Qed
.
Lemma
ufrac_auth_agreeN
n
p
a
b
:
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
p
}
b
)
→
a
≡
{
n
}
≡
b
.
Lemma
ufrac_auth_agreeN
n
p
a
b
:
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
p
}
b
)
→
a
≡
{
n
}
≡
b
.
Proof
.
Proof
.
rewrite
auth_
validN_eq
/=
=>
-[
Hincl
Hvalid
].
rewrite
auth_
both_validN
=>
-[
Hincl
Hvalid
].
move
:
Hincl
=>
/
Some_includedN
=>
-[[
_
?
//]|[[[
p'
?]
?]
[/=]]].
move
:
Hincl
=>
/
Some_includedN
=>
-[[//]|[[[
p'
?]
?]
[/=]]].
move
=>
/
discrete_iff
/
leibniz_equiv_iff
;
rewrite
ufrac_op'
=>
[/
Qp_eq
/=].
rewrite
ufrac_op'
=>
[/
Qp_eq
/=].
rewrite
-{
1
}(
Qcplus_0_r
p
)=>
/(
inj
(
Qcplus
p
))=>
?
;
by
subst
.
rewrite
-{
1
}(
Qcplus_0_r
p
)=>
/(
inj
(
Qcplus
p
))=>
?
;
by
subst
.
Qed
.
Qed
.
Lemma
ufrac_auth_agree
p
a
b
:
✓
(
●
?{
p
}
a
⋅
◯
?{
p
}
b
)
→
a
≡
b
.
Lemma
ufrac_auth_agree
p
a
b
:
✓
(
●
?{
p
}
a
⋅
◯
?{
p
}
b
)
→
a
≡
b
.
...
@@ -78,10 +84,10 @@ Section ufrac_auth.
...
@@ -78,10 +84,10 @@ Section ufrac_auth.
Proof
.
intros
.
by
eapply
leibniz_equiv
,
ufrac_auth_agree
.
Qed
.
Proof
.
intros
.
by
eapply
leibniz_equiv
,
ufrac_auth_agree
.
Qed
.
Lemma
ufrac_auth_includedN
n
p
q
a
b
:
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
q
}
b
)
→
Some
b
≼
{
n
}
Some
a
.
Lemma
ufrac_auth_includedN
n
p
q
a
b
:
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
q
}
b
)
→
Some
b
≼
{
n
}
Some
a
.
Proof
.
by
rewrite
auth_
validN_eq
/=
=>
-[/
Some_pair_includedN
[
_
?]
_
].
Qed
.
Proof
.
by
rewrite
auth_
both_validN
/=
=>
-[/
Some_pair_includedN
[
_
?]
_
].
Qed
.
Lemma
ufrac_auth_included
`
{
CmraDiscrete
A
}
q
p
a
b
:
Lemma
ufrac_auth_included
`
{
CmraDiscrete
A
}
q
p
a
b
:
✓
(
●
?{
p
}
a
⋅
◯
?{
q
}
b
)
→
Some
b
≼
Some
a
.
✓
(
●
?{
p
}
a
⋅
◯
?{
q
}
b
)
→
Some
b
≼
Some
a
.
Proof
.
rewrite
auth_
valid_discrete
/=
=>
-[/
Some_pair_included
[
_
?]
_
]
//.
Qed
.
Proof
.
rewrite
auth_
both_valid
/=
=>
-[/
Some_pair_included
[
_
?]
_
]
//.
Qed
.
Lemma
ufrac_auth_includedN_total
`
{
CmraTotal
A
}
n
q
p
a
b
:
Lemma
ufrac_auth_includedN_total
`
{
CmraTotal
A
}
n
q
p
a
b
:
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
q
}
b
)
→
b
≼
{
n
}
a
.
✓
{
n
}
(
●
?{
p
}
a
⋅
◯
?{
q
}
b
)
→
b
≼
{
n
}
a
.
Proof
.
intros
.
by
eapply
Some_includedN_total
,
ufrac_auth_includedN
.
Qed
.
Proof
.
intros
.
by
eapply
Some_includedN_total
,
ufrac_auth_includedN
.
Qed
.
...
@@ -91,7 +97,7 @@ Section ufrac_auth.
...
@@ -91,7 +97,7 @@ Section ufrac_auth.
Lemma
ufrac_auth_auth_validN
n
q
a
:
✓
{
n
}
(
●
?{
q
}
a
)
↔
✓
{
n
}
a
.
Lemma
ufrac_auth_auth_validN
n
q
a
:
✓
{
n
}
(
●
?{
q
}
a
)
↔
✓
{
n
}
a
.
Proof
.
Proof
.
split
;
[
by
intros
[
_
[??]
]|].
rewrite
-
auth_auth_validN
.
split
;
[
by
intros
[
]|].
repeat
split
;
simpl
;
by
try
apply
:
ucmra_unit_leastN
.
repeat
split
;
simpl
;
by
try
apply
:
ucmra_unit_leastN
.
Qed
.
Qed
.
Lemma
ufrac_auth_auth_valid
q
a
:
✓
(
●
?{
q
}
a
)
↔
✓
a
.
Lemma
ufrac_auth_auth_valid
q
a
:
✓
(
●
?{
q
}
a
)
↔
✓
a
.
...
...
theories/heap_lang/adequacy.v
View file @
0b58a0c8
...
@@ -4,7 +4,7 @@ in [iron_logic/adequacy].
...
@@ -4,7 +4,7 @@ in [iron_logic/adequacy].
Note, we only state adequacy for the lifted logic, because in the Coq
Note, we only state adequacy for the lifted logic, because in the Coq
formalization we state all specifications in terms of the lifted logic. *)
formalization we state all specifications in terms of the lifted logic. *)
From
iris
.
algebra
Require
Import
big_op
gmap
ufrac
.
From
iris
.
algebra
Require
Import
big_op
gmap
ufrac
excl
.
From
iron
.
iron_logic
Require
Export
weakestpre
adequacy
.
From
iron
.
iron_logic
Require
Export
weakestpre
adequacy
.
From
iron
.
algebra
Require
Import
ufrac_auth
.
From
iron
.
algebra
Require
Import
ufrac_auth
.
From
iron
.
heap_lang
Require
Import
heap
.
From
iron
.
heap_lang
Require
Import
heap
.
...
@@ -37,7 +37,7 @@ Proof.
...
@@ -37,7 +37,7 @@ Proof.
iMod
(
own_alloc
(
●
?{
1
}
∅
⋅
(
◯
?{
1
/
2
}
∅
⋅
◯
?{
1
/
2
}
ε
)))
as
(
γ
)
"[Hσ [Hp Hp']]"
.
iMod
(
own_alloc
(
●
?{
1
}
∅
⋅
(
◯
?{
1
/
2
}
∅
⋅
◯
?{
1
/
2
}
ε
)))
as
(
γ
)
"[Hσ [Hp Hp']]"
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
by
apply
ufrac_auth_valid
.
}
by
apply
ufrac_auth_valid
.
}
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
done
.
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
by
apply
auth_auth_valid
.
iModIntro
.
pose
(
HeapG
_
_
_
γ
_
_
γ
f
).
iModIntro
.
pose
(
HeapG
_
_
_
γ
_
_
γ
f
).
iExists
heap_perm
,
heap_ctx
,
(
λ
_
,
heap_fork_post
),
_
,
_
,
True
%
I
.
iExists
heap_perm
,
heap_ctx
,
(
λ
_
,
heap_fork_post
),
_
,
_
,
True
%
I
.
iFrame
"Hp"
.
iSplitL
"Hσ Hf"
.
iFrame
"Hp"
.
iSplitL
"Hσ Hf"
.
...
@@ -55,7 +55,7 @@ Proof.
...
@@ -55,7 +55,7 @@ Proof.
(
◯
?{
1
/
2
}
(
to_heap
σ
)
⋅
◯
?{
1
/
2
}
ε
)))
as
(
γ
)
"[Hσ [Hσ' [Hp Hp']]]"
.
(
◯
?{
1
/
2
}
(
to_heap
σ
)
⋅
◯
?{
1
/
2
}
ε
)))
as
(
γ
)
"[Hσ [Hσ' [Hp Hp']]]"
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
apply
ufrac_auth_valid
;
by
apply
to_heap_valid
.
}
apply
ufrac_auth_valid
;
by
apply
to_heap_valid
.
}
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
done
.
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
by
apply
auth_auth_valid
.
iModIntro
.
pose
(
HeapG
_
_
_
γ
_
_
γ
f
).
iModIntro
.
pose
(
HeapG
_
_
_
γ
_
_
γ
f
).
iExists
heap_perm
,
heap_ctx
,
(
λ
_
,
heap_fork_post
),
_
,
_
,
True
%
I
.
iExists
heap_perm
,
heap_ctx
,
(
λ
_
,
heap_fork_post
),
_
,
_
,
True
%
I
.
iFrame
"Hp"
.
iSplitL
"Hσ Hf"
.
iFrame
"Hp"
.
iSplitL
"Hσ Hf"
.
...
@@ -98,7 +98,7 @@ Proof.
...
@@ -98,7 +98,7 @@ Proof.
-
intros
Hwp
Hsteps
.
-
intros
Hwp
Hsteps
.
eapply
(
iron_wp_all_adequacy
_
heap_lang
_
_
∅
σ
2
'
_
_
(
λ
_
,
σ
2
'
=
σ
2
)
_
ε
)
;
eapply
(
iron_wp_all_adequacy
_
heap_lang
_
_
∅
σ
2
'
_
_
(
λ
_
,
σ
2
'
=
σ
2
)
_
ε
)
;
[|
done
]
;
iIntros
(?
κ
s
)
""
.
[|
done
]
;
iIntros
(?
κ
s
)
""
.
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
done
.
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
by
apply
auth_auth_valid
.
iMod
(
own_alloc
(
●
?{
1
}
(
to_heap
∅
)
⋅
(
◯
?{
1
/
2
}
(
to_heap
∅
)
⋅
◯
?{
1
/
2
}
ε
)))
iMod
(
own_alloc
(
●
?{
1
}
(
to_heap
∅
)
⋅
(
◯
?{
1
/
2
}
(
to_heap
∅
)
⋅
◯
?{
1
/
2
}
ε
)))
as
(
γ
)
"[Hσ [Hσ' Hp]]"
.
as
(
γ
)
"[Hσ [Hσ' Hp]]"
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
...
@@ -123,7 +123,7 @@ Proof.
...
@@ -123,7 +123,7 @@ Proof.
-
intros
Hwp
Hsteps
.
-
intros
Hwp
Hsteps
.
eapply
(
iron_wp_all_adequacy
_
heap_lang
_
_
σ
1
σ
2
'
_
_
(
λ
_
,
σ
2
'
=
σ
2
)
_
eapply
(
iron_wp_all_adequacy
_
heap_lang
_
_
σ
1
σ
2
'
_
_
(
λ
_
,
σ
2
'
=
σ
2
)
_
(
Some
(
1
/
2
)%
Qp
))
;
[|
done
]
;
iIntros
(?
κ
s
)
""
.
(
Some
(
1
/
2
)%
Qp
))
;
[|
done
]
;
iIntros
(?
κ
s
)
""
.
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
done
.
iMod
(
own_alloc
(
●
∅
))
as
(
γ
f
)
"Hf"
;
first
by
apply
auth_auth_valid
.
iMod
(
own_alloc
(
●
?{
1
}
(
to_heap
σ
1
)
⋅
(
◯
?{
1
/
2
}
(
to_heap
σ
1
)
⋅
◯
?{
1
/
2
}
ε
)))
iMod
(
own_alloc
(
●
?{
1
}
(
to_heap
σ
1
)
⋅
(
◯
?{
1
/
2
}
(
to_heap
σ
1
)
⋅
◯
?{
1
/
2
}
ε
)))
as
(
γ
)
"[Hσ [Hσ' Hp]]"
.
as
(
γ
)
"[Hσ [Hσ' Hp]]"
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
{
rewrite
-
ufrac_auth_frag_op
Qp_div_2
right_id
.
...
...
theories/heap_lang/heap.v
View file @
0b58a0c8
(** This file defines the basic points-to [↦] connectives for the Iron logic
(** This file defines the basic points-to [↦] connectives for the Iron logic
instantiated with the heap_lang language. As a counter part to this, it defines
instantiated with the heap_lang language. As a counter part to this, it defines
the state interpretation [heap_ctx]. *)
the state interpretation [heap_ctx]. *)
From
iris
.
algebra
Require
Import
frac_auth
gmap
agree
gmultiset
ufrac
.
From
iris
.
algebra
Require
Import
excl
frac_auth
gmap
agree
gmultiset
ufrac
.
From
iris
.
base_logic
.
lib
Require
Export
own
.
From
iris
.
base_logic
.
lib
Require
Export
own
.
From
iris
.
bi
.
lib
Require
Import
fractional
.
From
iris
.
bi
.
lib
Require
Import
fractional
.
From
iris
.
proofmode
Require
Import
tactics
.
From
iris
.
proofmode
Require
Import
tactics
.
...
@@ -242,7 +242,7 @@ Section heap.
...
@@ -242,7 +242,7 @@ Section heap.
iDestruct
"HQs"
as
"[HQ HQs]"
.
iDestruct
"HQ"
as
(
j
π
)
"[Hp' Hj]"
.
iDestruct
"HQs"
as
"[HQ HQs]"
.
iDestruct
"HQ"
as
(
j
π
)
"[Hp' Hj]"
.
iAssert
⌜
π
fs
!!
j
=
Some
π
⌝
%
I
as
%
Hj
.
iAssert
⌜
π
fs
!!
j
=
Some
π
⌝
%
I
as
%
Hj
.
{
iDestruct
(
own_valid_2
with
"Hn Hj"
)
{
iDestruct
(
own_valid_2
with
"Hn Hj"
)
as
%[
Hj
%
singleton_included
Hvalid
]%
auth_
valid_discrete_2
.
as
%[
Hj
%
singleton_included
Hvalid
]%
auth_
both_valid
.
destruct
Hj
as
(
e
π
'
&
Hj
%
leibniz_equiv
&[[=]|(?&?&[=
<-]&[=
<-]&
He
π
)]%
option_included
).
destruct
Hj
as
(
e
π
'
&
Hj
%
leibniz_equiv
&[[=]|(?&?&[=
<-]&[=
<-]&
He
π
)]%
option_included
).
destruct
He
π
as
[<-%
leibniz_equiv
|
Hincl
]
;
last
first
.
destruct
He
π
as
[<-%
leibniz_equiv
|
Hincl
]
;
last
first
.
{
exfalso
.
move
:
(
Hvalid
j
).
rewrite
Hj
.
destruct
e
π
'
=>
//.
{
exfalso
.
move
:
(
Hvalid
j
).
rewrite
Hj
.
destruct
e
π
'
=>
//.
...
...
theories/heap_lang/lib/queue.v
View file @
0b58a0c8
...
@@ -212,7 +212,8 @@ Section queue_spec.
...
@@ -212,7 +212,8 @@ Section queue_spec.
iDestruct
"Hlhptr"
as
"[Hlhptr Hlhptr']"
.
iDestruct
"Hlhptr"
as
"[Hlhptr Hlhptr']"
.
iMod
(
own_alloc
(
1
%
Qp
,
to_agree
[]))
as
(
γ
)
"[Hγ Hγ']"
;
first
done
.
iMod
(
own_alloc
(
1
%
Qp
,
to_agree
[]))
as
(
γ
)
"[Hγ Hγ']"
;
first
done
.
iMod
(
own_alloc
(
Excl
()))
as
(
γ
d
)
"Hγd"
;
first
done
.
iMod
(
own_alloc
(
Excl
()))
as
(
γ
d
)
"Hγd"
;
first
done
.
iMod
(
own_alloc
(
●
(
Excl'
l
)
⋅
◯
(
Excl'
l
)))
as
(
γ
e
)
"[Hγe Hγe']"
;
first
done
.
iMod
(
own_alloc
(
●
(
Excl'
l
)
⋅
◯
(
Excl'
l
)))
as
(
γ
e
)
"[Hγe Hγe']"
;
first
by
apply
auth_both_valid
.
iMod
(
fcinv_alloc_named
_
N
(
λ
γ
inv
,
queue_inv
(
QueueName
γ
inv
γ
γ
d
γ
e
)
lhptr
ltptr
)
iMod
(
fcinv_alloc_named
_
N
(
λ
γ
inv
,
queue_inv
(
QueueName
γ
inv
γ
γ
d
γ
e
)
lhptr
ltptr
)
with
"[Hlhptr' Hγ' Hl Hγe]"
)
as
(
γ
inv
)
"([Hγinv Hγinv']&Hγc&#?)"
.
with
"[Hlhptr' Hγ' Hl Hγe]"
)
as
(
γ
inv
)
"([Hγinv Hγinv']&Hγc&#?)"
.
{
iIntros
"!>"
(
γ
inv
).
{
iIntros
"!>"
(
γ
inv
).
...
@@ -293,7 +294,7 @@ Section queue_spec.
...
@@ -293,7 +294,7 @@ Section queue_spec.
iMod
(
fcinv_open
_
N
with
"[$] Hγinv"
)
as
"[H Hclose]"
;
first
done
.
iMod
(
fcinv_open
_
N
with
"[$] Hγinv"
)
as
"[H Hclose]"
;
first
done
.
iDestruct
"H"
as
(
lh
lt'
vs
)
"(>Hvs & >Hlhptr' & >Hγe & Hlist & >Hlt')"
.
iDestruct
"H"
as
(
lh
lt'
vs
)
"(>Hvs & >Hlhptr' & >Hγe & Hlist & >Hlt')"
.
iDestruct
(
own_valid_2
with
"Hγe Hγe'"
)
iDestruct
(
own_valid_2
with
"Hγe Hγe'"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_
]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_
]%
auth_
both_valid
.
iMod
(
own_update_2
with
"Hγe Hγe'"
)
as
"[Hγe Hγe']"
.
iMod
(
own_update_2
with
"Hγe Hγe'"
)
as
"[Hγe Hγe']"
.
{
by
apply
auth_update
,
option_local_update
,
{
by
apply
auth_update
,
option_local_update
,
(
exclusive_local_update
_
(
Excl
ltn
)).
}
(
exclusive_local_update
_
(
Excl
ltn
)).
}
...
@@ -326,7 +327,7 @@ Section queue_spec.
...
@@ -326,7 +327,7 @@ Section queue_spec.
iMod
(
fcinv_cancel
with
"[$] Hγc [$Hγinv $Hγinv']"
)
as
"H"
;
first
done
.
iMod
(
fcinv_cancel
with
"[$] Hγc [$Hγinv $Hγinv']"
)
as
"H"
;
first
done
.
iDestruct
"H"
as
(
lh
lt'
vs
)
"(>Hvs' & >Hlhptr' & >Hγe & Hlist & >Hlt)"
.
iDestruct
"H"
as
(
lh
lt'
vs
)
"(>Hvs' & >Hlhptr' & >Hγe & Hlist & >Hlt)"
.
iDestruct
(
own_valid_2
with
"Hγe Hγe'"
)
iDestruct
(
own_valid_2
with
"Hγe Hγe'"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_
]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_
]%
auth_
both_valid
.
iDestruct
"Hlhptr"
as
(
v'
)
"Hlhptr"
.
iDestruct
"Hlhptr"
as
(
v'
)
"Hlhptr"
.
iDestruct
(
mapsto_agree
with
"Hlhptr Hlhptr'"
)
as
%?
;
simplify_eq
.
iDestruct
(
mapsto_agree
with
"Hlhptr Hlhptr'"
)
as
%?
;
simplify_eq
.
iCombine
"Hlhptr Hlhptr'"
as
"Hlhptr"
.
iCombine
"Hlhptr Hlhptr'"
as
"Hlhptr"
.
...
...
theories/heap_lang/lib/spin_lock_track.v
View file @
0b58a0c8
...
@@ -10,7 +10,7 @@ From iron.iron_logic Require Export weakestpre.
...
@@ -10,7 +10,7 @@ From iron.iron_logic Require Export weakestpre.
From
iron
.
heap_lang
Require
Export
lang
adequacy
.
From
iron
.
heap_lang
Require
Export
lang
adequacy
.
From
iron
.
heap_lang
Require
Import
proofmode
notation
.
From
iron
.
heap_lang
Require
Import
proofmode
notation
.
From
iron
.
iron_logic
Require
Import
fcinv
.
From
iron
.
iron_logic
Require
Import
fcinv
.
From
iris
.
algebra
Require
Import
auth
.
From
iris
.
algebra
Require
Import
auth
excl
.
Set
Default
Proof
Using
"Type"
.
Set
Default
Proof
Using
"Type"
.
Definition
new_lock
:
val
:
=
λ
:
<>,
ref
#
false
.
Definition
new_lock
:
val
:
=
λ
:
<>,
ref
#
false
.
...
@@ -97,7 +97,7 @@ Section proof.
...
@@ -97,7 +97,7 @@ Section proof.
Proof
.
Proof
.
iIntros
(
Φ
)
"HR HΦ"
.
rewrite
-
iron_wp_fupd
/
new_lock
/=.
iIntros
(
Φ
)
"HR HΦ"
.
rewrite
-
iron_wp_fupd
/
new_lock
/=.
wp_lam
.
wp_alloc
l
as
"Hl"
.
wp_lam
.
wp_alloc
l
as
"Hl"
.
iMod
(
own_alloc
(
●
None
))
as
(
γ
)
"Hγ"
;
first
done
.
iMod
(
own_alloc
(
●
None
))
as
(
γ
)
"Hγ"
;
first
by
apply
auth_auth_valid
.
iMod
(
fcinv_alloc_named
_
N
(
λ
γ
inv
,
lock_inv
(
LockName
γ
inv
γ
)
l
R
)
iMod
(
fcinv_alloc_named
_
N
(
λ
γ
inv
,
lock_inv
(
LockName
γ
inv
γ
)
l
R
)
with
"[-HΦ]"
)
as
(
γ
inv
)
"(Hγ & Hγc & #?)"
.
with
"[-HΦ]"
)
as
(
γ
inv
)
"(Hγ & Hγc & #?)"
.
{
iIntros
"!>"
(
γ
inv
).
iExists
false
.
by
iFrame
.
}
{
iIntros
"!>"
(
γ
inv
).
iExists
false
.
by
iFrame
.
}
...
@@ -143,7 +143,7 @@ Section proof.
...
@@ -143,7 +143,7 @@ Section proof.
iDestruct
"Hinv"
as
([|])
"[Hl Hinv]"
.
iDestruct
"Hinv"
as
([|])
"[Hl Hinv]"
.
-
wp_store
.
iDestruct
"Hinv"
as
(
p'
)
"[Hγ Hγinv]"
.
-
wp_store
.
iDestruct
"Hinv"
as
(
p'
)
"[Hγ Hγinv]"
.
iDestruct
(
own_valid_2
with
"Hγ Hγf"
)
iDestruct
(
own_valid_2
with
"Hγ Hγf"
)
as
%[<-%
Excl_included
%
leibniz_equiv
_
]%
auth_
valid_discrete_2
.
as
%[<-%
Excl_included
%
leibniz_equiv
_
]%
auth_
both_valid
.
iMod
(
own_update_2
with
"Hγ Hγf"
)
as
"Hγ"
.
iMod
(
own_update_2
with
"Hγ Hγf"
)
as
"Hγ"
.
{
eapply
auth_update_dealloc
,
delete_option_local_update
;
apply
_
.
}
{
eapply
auth_update_dealloc
,
delete_option_local_update
;
apply
_
.
}
iMod
(
"Hclose"
with
"[HR Hl Hγ]"
).
iMod
(
"Hclose"
with
"[HR Hl Hγ]"
).
...
@@ -151,7 +151,7 @@ Section proof.
...
@@ -151,7 +151,7 @@ Section proof.
iApply
"HΦ"
.
iModIntro
.
by
iFrame
.
iApply
"HΦ"
.
iModIntro
.
by
iFrame
.
-
iDestruct
"Hinv"
as
"[>Hγ ?]"
.
-
iDestruct
"Hinv"
as
"[>Hγ ?]"
.
by
iDestruct
(
own_valid_2
with
"Hγ Hγf"
)
by
iDestruct
(
own_valid_2
with
"Hγ Hγf"
)
as
%[[[]
?%
leibniz_equiv_iff
]
_
]%
auth_
valid_discrete_2
.
as
%[[[]
?%
leibniz_equiv_iff
]
_
]%
auth_
both_valid
.
Qed
.
Qed
.
Lemma
free_spec
γ
lk
R
`
{!
Uniform
R
}
:
Lemma
free_spec
γ
lk
R
`
{!
Uniform
R
}
:
...
...
theories/iron_logic/fcinv.v
View file @
0b58a0c8
...
@@ -123,7 +123,7 @@ Proof.
...
@@ -123,7 +123,7 @@ Proof.
iMod
(
cinv_alloc_strong
(
λ
_
,
True
)
_
N
)
as
(
γ
inv
?)
"[Hγinv Halloc]"
.
iMod
(
cinv_alloc_strong
(
λ
_
,
True
)
_
N
)
as
(
γ
inv
?)
"[Hγinv Halloc]"
.
{
apply
pred_infinite_True
.
}
{
apply
pred_infinite_True
.
}
iMod
(
own_alloc
(
●
!
(
1
%
Qp
:
ufrac
)
⋅
◯
!
(
1
%
Qp
:
ufrac
)))
iMod
(
own_alloc
(
●
!
(
1
%
Qp
:
ufrac
)
⋅
◯
!
(
1
%
Qp
:
ufrac
)))
as
(
γ
f
)
"[Hγauth Hγ]"
;
first
done
.
as
(
γ
f
)
"[Hγauth Hγ]"
;
first
by
apply
auth_both_valid
.
set
(
γ
:
=
FcInvName
γ
inv
γ
f
).
set
(
γ
:
=
FcInvName
γ
inv
γ
f
).
iModIntro
.
iExists
π
1
,
ε
.
iSplit
;
[
done
|
iFrame
"Hp"
].
iModIntro
.
iExists
π
1
,
ε
.
iSplit
;
[
done
|
iFrame
"Hp"
].
iExists
γ
,
ε
,
ε
;
iSplit
;
[
done
|
iSplitL
"Hγinv"
;
[
auto
|]].
iExists
γ
,
ε
,
ε
;
iSplit
;
[
done
|
iSplitL
"Hγinv"
;
[
auto
|]].
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment