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
845c8fa1
There was a problem fetching the pipeline metadata.
Commit
845c8fa1
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add notion of copyable type contexts
parent
7c4e39bc
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/function.v
+1
-1
1 addition, 1 deletion
theories/typing/function.v
theories/typing/type_context.v
+23
-4
23 additions, 4 deletions
theories/typing/type_context.v
with
24 additions
and
5 deletions
theories/typing/function.v
+
1
−
1
View file @
845c8fa1
...
...
@@ -3,7 +3,7 @@ From iris.proofmode Require Import tactics.
From
iris
.
program_logic
Require
Import
hoare
.
From
lrust
.
lifetime
Require
Import
borrow
.
From
lrust
.
typing
Require
Export
type
.
From
lrust
.
typing
Require
Import
programs
lft_contexts
type_context
cont_context
.
From
lrust
.
typing
Require
Import
programs
.
Section
fn
.
Context
`{
typeG
Σ
}
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/type_context.v
+
23
−
4
View file @
845c8fa1
...
...
@@ -46,6 +46,10 @@ Section type_context.
tctx_interp
tid
(
x
::
T
)
≡
(
tctx_elt_interp
tid
x
∗
tctx_interp
tid
T
)
%
I
.
Proof
.
rewrite
/
tctx_interp
big_sepL_cons
//.
Qed
.
Lemma
tctx_interp_app
tid
T1
T2
:
tctx_interp
tid
(
T1
++
T2
)
≡
(
tctx_interp
tid
T1
∗
tctx_interp
tid
T2
)
%
I
.
Proof
.
rewrite
/
tctx_interp
big_sepL_app
//.
Qed
.
Definition
tctx_interp_nil
tid
:
tctx_interp
tid
[]
=
True
%
I
:=
eq_refl
_
.
...
...
@@ -53,6 +57,22 @@ Section type_context.
tctx_interp
tid
[
x
]
≡
tctx_elt_interp
tid
x
.
Proof
.
rewrite
tctx_interp_cons
tctx_interp_nil
right_id
//.
Qed
.
Class
CopyC
(
T
:
tctx
)
:=
{
copyc_persistent
tid
:
PersistentP
(
tctx_interp
tid
T
);
}
.
Global
Existing
Instances
copyc_persistent
.
Global
Instance
tctx_nil_copy
:
CopyC
[]
.
Proof
.
split
.
apply
_
.
Qed
.
Global
Instance
tctx_ty_copy
T
p
ty
:
CopyC
T
→
Copy
ty
→
CopyC
(
TCtx_hasty
p
ty
::
T
)
.
Proof
.
(* TODO RJ: Should we have instances that PersistentP respects equiv? *)
intros
??
.
split
=>?
.
rewrite
/
PersistentP
tctx_interp_cons
.
apply
uPred
.
sep_persistent
;
by
apply
_
.
Qed
.
Definition
tctx_incl
(
E
:
elctx
)
(
L
:
llctx
)
(
T1
T2
:
tctx
):
Prop
:=
∀
tid
q1
q2
,
lft_ctx
-∗
elctx_interp
E
q1
-∗
llctx_interp
L
q2
-∗
tctx_interp
tid
T1
=
{
⊤
}
=∗
elctx_interp
E
q1
∗
llctx_interp
L
q2
∗
...
...
@@ -113,11 +133,10 @@ Section type_context.
by
iApply
(
Hincl
with
"LFT HE HL"
)
.
Qed
.
Lemma
copy_tctx_incl
E
L
p
`{
!
Copy
ty
}
:
tctx_incl
E
L
[
TCtx_hasty
p
ty
]
[
TCtx_hasty
p
ty
;
TCtx_hasty
p
ty
]
.
Lemma
copy_tctx_incl
E
L
T
`{
!
Copy
C
T
}
:
tctx_incl
E
L
T
(
T
++
T
)
.
Proof
.
iIntros
(???)
"_ $ $ *"
.
rewrite
/
tctx_interp
!
big_sepL_cons
big_sepL_nil
.
by
iIntros
"[#$ $]"
.
iIntros
(???)
"_ $ $ * #?"
.
rewrite
tctx_interp_app
.
by
iSplitL
.
Qed
.
Lemma
subtype_tctx_incl
E
L
p
ty1
ty2
:
...
...
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