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
c6051ad0
There was a problem fetching the pipeline summary.
Commit
c6051ad0
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
prove read_own_move
parent
f9834335
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/typing/own.v
+9
-29
9 additions, 29 deletions
theories/typing/own.v
theories/typing/uninit.v
+22
-0
22 additions, 0 deletions
theories/typing/uninit.v
with
31 additions
and
29 deletions
theories/typing/own.v
+
9
−
29
View file @
c6051ad0
...
...
@@ -159,39 +159,19 @@ Section typing.
iExists
_
.
iSplit
;
first
done
.
iFrame
"H†"
.
iExists
_
.
by
iFrame
.
Qed
.
(* Old Typing *)
Lemma
consumes_copy_own
ty
n
:
Copy
ty
→
consumes
ty
(
λ
ν
,
ν
◁
own
n
ty
)
%
P
(
λ
ν
,
ν
◁
own
n
ty
)
%
P
.
Lemma
read_own_move
E
L
ty
n
:
typed_read
E
L
(
own
n
ty
)
ty
(
own
n
$
uninit
ty
.(
ty_size
))
.
Proof
.
iIntros
(?
ν
tid
Φ
E
?)
"_ H◁ Htl HΦ"
.
iApply
(
has_type_wp
with
"H◁"
)
.
iIntros
(
v
)
"Hνv H◁"
.
iDestruct
"Hνv"
as
%
Hνv
.
rewrite
has_type_value
.
iDestruct
"H◁"
as
(
l
)
"(Heq & H↦ & >H†)"
.
iDestruct
"Heq"
as
%
[
=->
]
.
iDestruct
"H↦"
as
(
vl
)
"[>H↦ #Hown]"
.
iIntros
(
p
tid
F
qE
qL
?)
"_ $ $ Hown"
.
iDestruct
"Hown"
as
(
l
)
"(Heq & H↦ & H†)"
.
iDestruct
"Heq"
as
%
[
=
->
]
.
iDestruct
"H↦"
as
(
vl
)
"[>H↦ Hown]"
.
iAssert
(
▷
⌜
length
vl
=
ty_size
ty
⌝
)
%
I
with
"[#]"
as
">%"
.
by
rewrite
ty
.(
ty_size_eq
)
.
iApply
"HΦ"
.
iFrame
"∗#%"
.
iIntros
"!>!>!>H↦!>"
.
rewrite
/
has_type
Hνv
.
iExists
_
.
iSplit
.
done
.
iFrame
.
iExists
vl
.
eauto
.
Qed
.
Lemma
consumes_move
ty
n
:
consumes
ty
(
λ
ν
,
ν
◁
own
n
ty
)
%
P
(
λ
ν
,
ν
◁
own
n
(
uninit
ty
.(
ty_size
)))
%
P
.
Proof
.
iIntros
(
ν
tid
Φ
E
?)
"_ H◁ Htl HΦ"
.
iApply
(
has_type_wp
with
"H◁"
)
.
iIntros
(
v
)
"Hνv H◁"
.
iDestruct
"Hνv"
as
%
Hνv
.
rewrite
has_type_value
.
iDestruct
"H◁"
as
(
l
)
"(Heq & H↦ & >H†)"
.
iDestruct
"Heq"
as
%
[
=->
]
.
iDestruct
"H↦"
as
(
vl
)
"[>H↦ Hown]"
.
iAssert
(
▷
⌜
length
vl
=
ty_size
ty
⌝
)
%
I
with
"[#]"
as
">Hlen"
.
by
rewrite
ty
.(
ty_size_eq
)
.
iDestruct
"Hlen"
as
%
Hlen
.
iApply
"HΦ"
.
iFrame
"∗#%"
.
iIntros
"!>!>!>H↦!>"
.
rewrite
/
has_type
Hνv
.
iExists
_
.
iSplit
.
done
.
iSplitR
"H†"
.
-
rewrite
-
Hlen
.
iExists
vl
.
iIntros
"{$H↦}!>"
.
clear
.
iInduction
vl
as
[|
v
vl
]
"IH"
.
done
.
iExists
[
v
],
vl
.
iSplit
.
done
.
by
iSplit
.
-
rewrite
uninit_sz
;
auto
.
{
by
iApply
ty_size_eq
.
}
iModIntro
.
iExists
l
,
vl
,
_
.
iSplit
;
first
done
.
iFrame
"∗#"
.
iIntros
"Hl !>"
.
iExists
_
.
iSplit
;
first
done
.
rewrite
uninit_sz
.
iFrame
"H†"
.
iExists
_
.
iFrame
.
iApply
uninit_own
.
auto
.
Qed
.
(* Old Typing *)
Lemma
typed_new
ρ
(
n
:
nat
):
0
≤
n
→
typed_step_ty
ρ
(
new
[
#
n
]
%
E
)
(
own
n
(
uninit
n
))
.
Proof
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/uninit.v
+
22
−
0
View file @
c6051ad0
From
iris
.
proofmode
Require
Import
tactics
.
From
lrust
.
typing
Require
Export
type
.
From
lrust
.
typing
Require
Import
product
.
...
...
@@ -8,12 +9,21 @@ Section uninit.
{|
st_own
tid
vl
:=
⌜
length
vl
=
1
%
nat
⌝%
I
|}
.
Next
Obligation
.
done
.
Qed
.
Global
Instance
uninit_1_send
:
Send
uninit_1
.
Proof
.
iIntros
(
tid1
tid2
vl
)
"H"
.
done
.
Qed
.
Definition
uninit
(
n
:
nat
)
:
type
:=
Π
(
replicate
n
uninit_1
)
.
Global
Instance
uninit_copy
n
:
Copy
(
uninit
n
)
.
Proof
.
apply
product_copy
,
Forall_replicate
,
_
.
Qed
.
Global
Instance
uninit_send
n
:
Send
(
uninit
n
)
.
Proof
.
apply
product_send
,
Forall_replicate
,
_
.
Qed
.
Global
Instance
uninit_sync
n
:
Sync
(
uninit
n
)
.
Proof
.
apply
product_sync
,
Forall_replicate
,
_
.
Qed
.
Lemma
uninit_sz
n
:
ty_size
(
uninit
n
)
=
n
.
Proof
.
induction
n
.
done
.
simpl
.
by
f_equal
.
Qed
.
...
...
@@ -23,4 +33,16 @@ Section uninit.
induction
ns
as
[|
n
ns
IH
]
.
done
.
revert
IH
.
by
rewrite
/=
/
uninit
replicate_plus
prod_flatten_l
-!
prod_app
=>
->
.
Qed
.
Lemma
uninit_own
n
tid
vl
:
(
uninit
n
).(
ty_own
)
tid
vl
⊣⊢
⌜
length
vl
=
n
⌝.
Proof
.
iSplit
.
-
iIntros
"?"
.
rewrite
-
{
2
}(
uninit_sz
n
)
.
by
iApply
ty_size_eq
.
-
iInduction
vl
as
[|
v
vl
]
"IH"
forall
(
n
)
.
+
iIntros
"%"
.
destruct
n
;
done
.
+
iIntros
(
Heq
)
.
destruct
n
;
first
done
.
simpl
.
iExists
[
v
],
vl
.
iSplit
;
first
done
.
iSplit
;
first
done
.
iApply
"IH"
.
by
inversion
Heq
.
Qed
.
End
uninit
.
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