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
261a207a
Commit
261a207a
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
prove lifetime equalizing
parent
348ddc06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/typing/lft_contexts.v
+19
-1
19 additions, 1 deletion
theories/typing/lft_contexts.v
theories/typing/programs.v
+16
-0
16 additions, 0 deletions
theories/typing/programs.v
with
35 additions
and
1 deletion
theories/typing/lft_contexts.v
+
19
−
1
View file @
261a207a
From
iris
.
proofmode
Require
Import
tactics
.
From
iris
.
base_logic
Require
Import
big_op
.
From
iris
.
base_logic
.
lib
Require
Import
fractional
.
From
lrust
.
lifetime
Require
Ex
port
derived
.
From
lrust
.
lifetime
Require
Im
port
derived
borrow
frac_borrow
.
Inductive
elctx_elt
:
Type
:=
|
ELCtx_Alive
(
κ
:
lft
)
...
...
@@ -144,6 +144,24 @@ Section lft_contexts.
unfold
llctx_interp
.
by
iApply
(
big_sepL_elem_of
with
"H"
)
.
Qed
.
Lemma
lctx_equalize_lft
qE
qL
κ1
κ2
`{
!
frac_borG
Σ
}
:
lft_ctx
-∗
llctx_elt_interp
(
κ1
⊑
[
κ2
]
%
list
)
qL
=
{
⊤
}
=∗
elctx_elt_interp
(
κ1
⊑
κ2
)
qE
∗
elctx_elt_interp
(
κ2
⊑
κ1
)
qE
.
Proof
.
iIntros
"#LFT Hκ"
.
rewrite
/
llctx_elt_interp
/=.
(* TODO: Why is this unfold necessary? *)
iDestruct
"Hκ"
as
(
κ
)
"(% & Hκ & _)"
.
iMod
(
bor_create
_
κ2
with
"LFT [Hκ]"
)
as
"[Hκ _]"
;
first
done
;
first
by
iFrame
.
iMod
(
bor_fracture
(
λ
q
,
(
qL
*
q
).[_])
%
I
with
"LFT [Hκ]"
)
as
"#Hκ"
;
first
done
.
{
rewrite
Qp_mult_1_r
.
done
.
}
iModIntro
.
subst
κ1
.
iSplit
.
-
iApply
lft_le_incl
.
rewrite
<-!
gmultiset_union_subseteq_l
.
done
.
-
iApply
(
lft_incl_glb
with
"[]"
);
first
iApply
(
lft_incl_glb
with
"[]"
)
.
+
iApply
lft_incl_refl
.
+
iApply
lft_incl_static
.
+
iApply
(
frac_bor_lft_incl
with
"LFT"
)
.
done
.
Qed
.
Context
(
E
:
elctx
)
(
L
:
llctx
)
.
(* Lifetime inclusion *)
...
...
This diff is collapsed.
Click to expand it.
theories/typing/programs.v
+
16
−
0
View file @
261a207a
...
...
@@ -84,6 +84,22 @@ Notation typed_instruction_ty E L T1 e ty :=
Section
typing_rules
.
Context
`{
typeG
Σ
}
.
(* TODO: notation scopes need tuing to avoid the %list here. *)
(* TODO: Proof a version of this that substitutes into a compatible context...
if we really want to do that. *)
Lemma
type_equivalize_lft
E
L
C
T
κ1
κ2
e
:
typed_body
((
κ1
⊑
κ2
)
::
(
κ2
⊑
κ1
)
::
E
)
L
C
T
e
→
typed_body
E
((
κ1
⊑
[
κ2
]
%
list
)
::
L
)
C
T
e
.
Proof
.
iIntros
(
He
tid
qE
)
"#HEAP #LFT Htl HE HL HC HT"
.
rewrite
/
llctx_interp
big_sepL_cons
.
iDestruct
"HL"
as
"[Hκ HL]"
.
iMod
(
lctx_equalize_lft
with
"LFT Hκ"
)
as
"[Hκ1 Hκ2]"
.
iApply
(
He
with
"HEAP LFT Htl [Hκ1 Hκ2 HE] HL [HC] HT"
)
.
-
rewrite
/
elctx_interp
!
big_sepL_cons
.
by
iFrame
.
-
rewrite
/
elctx_interp
!
big_sepL_cons
.
iIntros
"(_ & _ & HE)"
.
iApply
"HC"
.
done
.
Qed
.
Lemma
type_let
E
L
T1
T2
(
T
:
tctx
)
C
xb
e
e'
:
Closed
(
xb
:
b
:
[])
e'
→
typed_instruction
E
L
T1
e
T2
→
...
...
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