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
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Simon Spies
lambda-rust
Commits
9f12527a
Commit
9f12527a
authored
7 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
experiment with fractured borrows as accessors
parent
4cffb558
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
theories/lifetime/frac_borrow.v
+10
-0
10 additions, 0 deletions
theories/lifetime/frac_borrow.v
theories/typing/lib/mutex/mutexguard.v
+5
-4
5 additions, 4 deletions
theories/typing/lib/mutex/mutexguard.v
with
15 additions
and
4 deletions
theories/lifetime/frac_borrow.v
+
10
−
0
View file @
9f12527a
...
@@ -132,6 +132,16 @@ Section frac_bor.
...
@@ -132,6 +132,16 @@ Section frac_bor.
iIntros
(?)
"#LFT#H†"
.
iApply
(
bor_fracture
with
"LFT [>]"
);
first
done
.
iIntros
(?)
"#LFT#H†"
.
iApply
(
bor_fracture
with
"LFT [>]"
);
first
done
.
by
iApply
(
bor_fake
with
"LFT"
)
.
by
iApply
(
bor_fake
with
"LFT"
)
.
Qed
.
Qed
.
(** Fractured borrows are accessors *)
Global
Instance
into_acc_cinv
E
q
κ
`{
Fractional
_
φ
}
:
IntoAcc
(
X
:=
Qp
)
(
&
frac
{
κ
}
φ
)
(
↑
lftN
⊆
E
)
(
lft_ctx
∗
q
.[
κ
])
E
E
(
λ
q'
,
▷
φ
q'
)
%
I
(
λ
q'
,
▷
φ
q'
)
%
I
(
λ
_,
Some
q
.[
κ
])
%
I
.
Proof
.
rewrite
/
IntoAcc
/
accessor
.
iIntros
(?)
"#Hinv [#Hlft Htok]"
.
iApply
(
frac_bor_acc
with
"Hlft Hinv Htok"
)
.
done
.
Qed
.
End
frac_bor
.
End
frac_bor
.
Lemma
frac_bor_lft_incl
`{
invG
Σ
,
lftG
Σ
,
frac_borG
Σ
}
κ
κ'
q
:
Lemma
frac_bor_lft_incl
`{
invG
Σ
,
lftG
Σ
,
frac_borG
Σ
}
κ
κ'
q
:
...
...
This diff is collapsed.
Click to expand it.
theories/typing/lib/mutex/mutexguard.v
+
5
−
4
View file @
9f12527a
...
@@ -247,18 +247,19 @@ Section code.
...
@@ -247,18 +247,19 @@ Section code.
iDestruct
"Hg'"
as
(
lm
)
"[Hlg Hshr]"
.
iDestruct
"Hg'"
as
(
lm
)
"[Hlg Hshr]"
.
iMod
(
lctx_lft_alive_tok
α
with
"HE HL"
)
as
(
qα
)
"([Hα1 Hα2] & HL & Hclose1)"
;
iMod
(
lctx_lft_alive_tok
α
with
"HE HL"
)
as
(
qα
)
"([Hα1 Hα2] & HL & Hclose1)"
;
[
solve_typing
..|]
.
[
solve_typing
..|]
.
iMod
(
frac_bor_acc
with
"LFT Hlg Hα1"
)
as
(
qlx'
)
"
[
H↦
Hclose2]"
;
first
done
.
wp_bind
(
!
_)
%
E
.
iInv
"Hlg"
with
"[$Hα1 $LFT]"
as
(
qlx'
)
"H↦
"
.
iMod
(
lctx_lft_alive_tok
β
with
"HE HL"
)
as
(
qβ
)
"(Hβ & HL & Hclose3)"
;
iMod
(
lctx_lft_alive_tok
β
with
"HE HL"
)
as
(
qβ
)
"(Hβ & HL & Hclose3)"
;
[
solve_typing
..|]
.
[
solve_typing
..|]
.
iDestruct
(
lft_intersect_acc
with
"Hβ Hα2"
)
as
(
qβα
)
"[Hα2β Hclose4]"
.
iDestruct
(
lft_intersect_acc
with
"Hβ Hα2"
)
as
(
qβα
)
"[Hα2β Hclose4]"
.
wp_bind
(
!
_)
%
E
.
iApply
(
wp_step_fupd
with
"[Hshr Hα2β]"
);
iApply
(
wp_step_fupd
with
"[Hshr Hα2β]"
);
[
done
|
|
by
iApply
(
"Hshr"
with
"[] Hα2β"
)|];
first
done
.
[
done
|
|
by
iApply
(
"Hshr"
with
"[] Hα2β"
)|];
first
done
.
wp_read
.
iIntros
"[#Hshr Hα2β] !>"
.
wp_let
.
wp_read
.
iIntros
"[#Hshr Hα2β] !>"
.
iDestruct
(
"Hclose4"
with
"Hα2β"
)
as
"[Hβ Hα2]"
.
iDestruct
(
"Hclose4"
with
"Hα2β"
)
as
"[Hβ Hα2]"
.
iMod
(
"Hclose3"
with
"Hβ HL"
)
as
"HL"
.
iMod
(
"Hclose3"
with
"Hβ HL"
)
as
"HL"
.
i
Mod
(
"Hclose2"
with
"H↦"
)
as
"
Hα1"
.
i
Frame
"H↦"
.
iIntros
"!>
Hα1"
.
iMod
(
"Hclose1"
with
"[$] HL"
)
as
"HL"
.
iMod
(
"Hclose1"
with
"[$] HL"
)
as
"HL"
.
iDestruct
(
lctx_lft_incl_incl
α
β
with
"HL HE"
)
as
"#Hαβ"
;
[
solve_typing
..|]
.
iDestruct
(
lctx_lft_incl_incl
α
β
with
"HL HE"
)
as
"#Hαβ"
;
[
solve_typing
..|]
.
wp_let
.
(* Switch back to typing mode. *)
(* Switch back to typing mode. *)
iApply
(
type_type
_
_
_
[
g
◁
own_ptr
_
_;
#
lm
+
ₗ
#
1
◁
&
shr
{
α
}
ty
]
iApply
(
type_type
_
_
_
[
g
◁
own_ptr
_
_;
#
lm
+
ₗ
#
1
◁
&
shr
{
α
}
ty
]
with
"[] LFT HE Hna HL Hk"
);
last
first
.
with
"[] LFT HE Hna HL Hk"
);
last
first
.
...
...
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