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
0a2c58c0
Commit
0a2c58c0
authored
8 years ago
by
Jacques-Henri Jourdan
Browse files
Options
Downloads
Patches
Plain Diff
Forgot a file.
parent
af680b50
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
theories/typing/tests/lazy_lft.v
+49
-0
49 additions, 0 deletions
theories/typing/tests/lazy_lft.v
with
49 additions
and
0 deletions
theories/typing/tests/lazy_lft.v
0 → 100644
+
49
−
0
View file @
0a2c58c0
From
lrust
.
lifetime
Require
Import
definitions
.
From
lrust
.
lang
Require
Import
new_delete
.
From
lrust
.
typing
Require
Import
programs
product
product_split
own
uniq_bor
shr_bor
int
function
lft_contexts
uninit
cont
borrow
type_sum
.
Set
Default
Proof
Using
"Type"
.
Section
lazy_lft
.
Context
`{
typeG
Σ
}
.
Definition
lazy_lft
:
val
:=
funrec
:
<>
[]
:=
Newlft
;;
let
:
"t"
:=
new
[
#
2
]
in
let
:
"f"
:=
new
[
#
1
]
in
let
:
"g"
:=
new
[
#
1
]
in
let
:
"42"
:=
#
42
in
"f"
<-
"42"
;;
"t"
+
ₗ
#
0
<-
"f"
;;
"t"
+
ₗ
#
1
<-
"f"
;;
let
:
"t0'"
:=
!
(
"t"
+
ₗ
#
0
)
in
"t0'"
;;
let
:
"23"
:=
#
23
in
"g"
<-
"23"
;;
"t"
+
ₗ
#
1
<-
"g"
;;
let
:
"r"
:=
new
[
#
0
]
in
Endlft
;;
delete
[
#
2
;
"t"
];;
delete
[
#
1
;
"f"
];;
delete
[
#
1
;
"g"
];;
"return"
[
"r"
]
.
Lemma
lazy_lft_type
:
typed_instruction_ty
[]
[]
[]
lazy_lft
(
fn
(
λ
_,
[])
%
EL
(
λ
_,
[
#
])
(
λ
_:(),
box
unit
))
.
Proof
.
apply
type_fn
;
try
apply
_
.
move
=>
/=
[]
ret
p
.
inv_vec
p
.
simpl_subst
.
eapply
(
type_newlft
[]);
[
solve_typing
|]=>
α
.
eapply
(
type_new_subtype
(
Π
[
uninit
1
;
uninit
1
])
%
T
);
[
solve_typing
..|
|]
.
{
apply
(
uninit_product_subtype
[
1
;
1
]
%
nat
)
.
}
intros
t
.
simpl_subst
.
eapply
type_new
;
[
solve_typing
..|]=>
f
.
simpl_subst
.
eapply
type_new
;
[
solve_typing
..|]=>
g
.
simpl_subst
.
eapply
type_int
;
[
solve_typing
|]=>
v42
.
simpl_subst
.
eapply
type_assign
;
[
solve_typing
..|
by
eapply
write_own
|]
.
eapply
(
type_assign
_
(
&
shr
{
α
}_));
[
solve_typing
..|
by
eapply
write_own
|]
.
eapply
type_assign
;
[
solve_typing
..|
by
eapply
write_own
|]
.
eapply
type_deref
;
[
solve_typing
..|
apply
:
read_own_copy
|
done
|]=>
t0'
.
simpl_subst
.
eapply
type_letpath
;
[
solve_typing
..|]=>
dummy
.
simpl_subst
.
eapply
type_int
;
[
solve_typing
|]=>
v23
.
simpl_subst
.
eapply
type_assign
;
[
solve_typing
..|
by
eapply
write_own
|]
.
eapply
(
type_assign
_
(
&
shr
{
α
}
int
));
[
solve_typing
..|
by
eapply
write_own
|]
.
eapply
type_new
;
[
solve_typing
..|]
=>
r
.
simpl_subst
.
eapply
type_endlft
;
[
solve_typing
..|]
.
eapply
(
type_delete
(
Π
[
&
shr
{_}_;
&
shr
{_}_])
%
T
);
[
solve_typing
..|]
.
eapply
type_delete
;
[
solve_typing
..|]
.
eapply
type_delete
;
[
solve_typing
..|]
.
eapply
(
type_jump
[_]);
solve_typing
.
Qed
.
End
lazy_lft
.
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