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
faa3a28a
There was a problem fetching the pipeline summary.
Commit
faa3a28a
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
type new and delete in new type system
parent
77b0063a
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
theories/lang/new_delete.v
+2
-2
2 additions, 2 deletions
theories/lang/new_delete.v
theories/typing/own.v
+16
-18
16 additions, 18 deletions
theories/typing/own.v
theories/typing/uniq_bor.v
+1
-1
1 addition, 1 deletion
theories/typing/uniq_bor.v
with
19 additions
and
21 deletions
theories/lang/new_delete.v
+
2
−
2
View file @
faa3a28a
...
@@ -6,13 +6,13 @@ Definition new : val :=
...
@@ -6,13 +6,13 @@ Definition new : val :=
λ
:
[
"n"
],
λ
:
[
"n"
],
if
:
"n"
≤
#
0
then
#
((
42
%
positive
,
1337
):
loc
)
if
:
"n"
≤
#
0
then
#
((
42
%
positive
,
1337
):
loc
)
else
Alloc
"n"
.
else
Alloc
"n"
.
Opaque
new
.
Global
Opaque
new
.
Definition
delete
:
val
:=
Definition
delete
:
val
:=
λ
:
[
"n"
;
"loc"
],
λ
:
[
"n"
;
"loc"
],
if
:
"n"
≤
#
0
then
#
()
if
:
"n"
≤
#
0
then
#
()
else
Free
"n"
"loc"
.
else
Free
"n"
"loc"
.
Opaque
delete
.
Global
Opaque
delete
.
Section
specs
.
Section
specs
.
Context
`{
heapG
Σ
}
.
Context
`{
heapG
Σ
}
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/own.v
+
16
−
18
View file @
faa3a28a
...
@@ -4,7 +4,7 @@ From iris.base_logic Require Import big_op.
...
@@ -4,7 +4,7 @@ From iris.base_logic Require Import big_op.
From
lrust
.
lifetime
Require
Import
borrow
frac_borrow
.
From
lrust
.
lifetime
Require
Import
borrow
frac_borrow
.
From
lrust
.
lang
Require
Export
new_delete
.
From
lrust
.
lang
Require
Export
new_delete
.
From
lrust
.
typing
Require
Export
type
.
From
lrust
.
typing
Require
Export
type
.
From
lrust
.
typing
Require
Import
uninit
type_context
programs
perm
typing
.
From
lrust
.
typing
Require
Import
uninit
type_context
programs
.
Section
own
.
Section
own
.
Context
`{
typeG
Σ
}
.
Context
`{
typeG
Σ
}
.
...
@@ -171,34 +171,32 @@ Section typing.
...
@@ -171,34 +171,32 @@ Section typing.
iFrame
.
iApply
uninit_own
.
auto
.
iFrame
.
iApply
uninit_own
.
auto
.
Qed
.
Qed
.
(* Old Typing *)
Lemma
type_new
E
L
(
n
:
nat
)
:
Lemma
typed_new
ρ
(
n
:
nat
):
typed_instruction_ty
E
L
[]
(
new
[
#
n
]
%
E
)
(
own
n
(
uninit
n
))
.
0
≤
n
→
typed_step_ty
ρ
(
new
[
#
n
]
%
E
)
(
own
n
(
uninit
n
))
.
Proof
.
Proof
.
iIntros
(
Hn
tid
)
"!#(#HEAP&_&_&$)"
.
iApply
(
wp_new
with
"HEAP"
);
try
done
.
iIntros
(
tid
eq
)
"#HEAP #LFT $ $ $ _"
.
iIntros
"!>*(% & H† & H↦)"
.
iExists
_
.
iSplit
.
done
.
iNext
.
iApply
(
wp_new
with
"HEAP"
);
try
done
;
first
omega
.
iModIntro
.
rewrite
Nat2Z
.
id
.
iSplitR
"H†"
.
iIntros
(
l
vl
)
"(% & H† & Hlft)"
.
rewrite
tctx_interp_singleton
tctx_hasty_val
.
iExists
_
.
iSplit
;
first
done
.
iNext
.
rewrite
Nat2Z
.
id
.
iSplitR
"H†"
.
-
iExists
vl
.
iFrame
.
-
iExists
vl
.
iFrame
.
match
goal
with
H
:
Z
.
of_nat
n
=
Z
.
of_nat
(
length
vl
)
|
-
_
=>
rename
H
into
Hlen
end
.
match
goal
with
H
:
Z
.
of_nat
n
=
Z
.
of_nat
(
length
vl
)
|
-
_
=>
rename
H
into
Hlen
end
.
clear
Hn
.
apply
(
inj
Z
.
of_nat
)
in
Hlen
.
subst
.
apply
(
inj
Z
.
of_nat
)
in
Hlen
.
subst
.
iInduction
vl
as
[|
v
vl
]
"IH"
.
done
.
iInduction
vl
as
[|
v
vl
]
"IH"
.
done
.
iExists
[
v
],
vl
.
iSplit
.
done
.
by
iSplit
.
iExists
[
v
],
vl
.
iSplit
.
done
.
by
iSplit
.
-
by
rewrite
uninit_sz
freeable_sz_full
.
-
by
rewrite
uninit_sz
freeable_sz_full
.
Qed
.
Qed
.
Lemma
type_delete
E
L
n
ty
p
:
Lemma
typed_delete
ty
(
ν
:
expr
):
n
=
ty
.(
ty_size
)
→
typed_
step
(
ν
◁
own
ty
.(
ty_size
)
ty
)
(
delete
[
#
ty
.(
ty_size
)
;
ν
])
%
E
(
λ
_,
top
)
.
typed_
instruction
E
L
[
TCtx_hasty
p
(
own
n
ty
)
]
(
delete
[
#
n
;
p
])
%
E
(
λ
_,
[]
)
.
Proof
.
Proof
.
iIntros
(
tid
)
"!#(#HEAP&_&H◁&$)"
.
wp_bind
ν
.
iIntros
(
->
tid
eq
)
"#HEAP #LFT $ $ $ Hp"
.
rewrite
tctx_interp_singleton
.
iApply
(
has_type_wp
with
"[$H◁]"
)
.
iIntros
(
v
)
"_ H◁ !>"
.
wp_bind
p
.
iApply
(
wp_hasty
with
"Hp"
)
.
iIntros
(
v
)
"_ Hown"
.
rewrite
has_type_value
.
iDestruct
"Hown"
as
(
l
)
"(Hv & H↦∗: & >H†)"
.
iDestruct
"Hv"
as
%
[
=->
]
.
iDestruct
"H◁"
as
(
l
)
"(Hv & H↦∗: & >H†)"
.
iDestruct
"Hv"
as
%
[
=->
]
.
iDestruct
"H↦∗:"
as
(
vl
)
"[>H↦ Hown]"
.
rewrite
tctx_interp_nil
.
iDestruct
"H↦∗:"
as
(
vl
)
"[>H↦ Hown]"
.
rewrite
ty_size_eq
.
iDestruct
"Hown"
as
">Hown"
.
iDestruct
"Hown"
as
%<-.
rewrite
ty_size_eq
.
iDestruct
"Hown"
as
">Hown"
.
iDestruct
"Hown"
as
%<-.
iApply
(
wp_delete
with
"[-]"
);
try
by
auto
.
iApply
(
wp_delete
with
"[-]"
);
try
(
by
auto
);
[]
.
rewrite
freeable_sz_full
.
by
iFrame
.
rewrite
freeable_sz_full
.
by
iFrame
.
Qed
.
Qed
.
End
typing
.
End
typing
.
This diff is collapsed.
Click to expand it.
theories/typing/uniq_bor.v
+
1
−
1
View file @
faa3a28a
...
@@ -3,7 +3,7 @@ From iris.base_logic Require Import big_op.
...
@@ -3,7 +3,7 @@ From iris.base_logic Require Import big_op.
From
lrust
.
lifetime
Require
Import
borrow
frac_borrow
reborrow
.
From
lrust
.
lifetime
Require
Import
borrow
frac_borrow
reborrow
.
From
lrust
.
lang
Require
Import
heap
.
From
lrust
.
lang
Require
Import
heap
.
From
lrust
.
typing
Require
Export
type
.
From
lrust
.
typing
Require
Export
type
.
From
lrust
.
typing
Require
Import
lft_contexts
type_context
shr_bor
perm
typing
programs
.
From
lrust
.
typing
Require
Import
lft_contexts
type_context
shr_bor
programs
.
Section
uniq_bor
.
Section
uniq_bor
.
Context
`{
typeG
Σ
}
.
Context
`{
typeG
Σ
}
.
...
...
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