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
00689c42
Commit
00689c42
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
add notion of types and type contexts being Send
parent
ca917d76
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/typing/type.v
+12
-1
12 additions, 1 deletion
theories/typing/type.v
theories/typing/type_context.v
+23
-5
23 additions, 5 deletions
theories/typing/type_context.v
with
35 additions
and
6 deletions
theories/typing/type.v
+
12
−
1
View file @
00689c42
...
...
@@ -92,6 +92,7 @@ Section type.
rewrite
shr_locsE_shift
.
set_solver
+.
Qed
.
(** Copy types *)
Class
Copy
(
t
:
type
)
:=
{
copy_persistent
tid
vl
:
PersistentP
(
t
.(
ty_own
)
tid
vl
);
copy_shr_acc
κ
tid
E
F
l
q
:
...
...
@@ -107,7 +108,17 @@ Section type.
Global
Instance
lst_copy_cons
ty
tys
:
Copy
ty
→
LstCopy
tys
→
LstCopy
(
ty
::
tys
)
:=
List
.
Forall_cons
_
_
_
.
(* We are repeating the typeclass parameter here jsut to make sure
(** Send types *)
Class
Send
(
t
:
type
)
:=
send_change_tid
tid1
tid2
vl
:
t
.(
ty_own
)
tid1
vl
-∗
t
.(
ty_own
)
tid2
vl
.
Class
LstSend
(
tys
:
list
type
)
:=
lst_send
:
Forall
Send
tys
.
Global
Instance
lst_send_nil
:
LstSend
[]
:=
List
.
Forall_nil
_
.
Global
Instance
lst_send_cons
ty
tys
:
Send
ty
→
LstSend
tys
→
LstSend
(
ty
::
tys
)
:=
List
.
Forall_cons
_
_
_
.
(** Simple types *)
(* We are repeating the typeclass parameter here just to make sure
that simple_type does depend on it. Otherwise, the coercion defined
bellow will not be acceptable by Coq. *)
Record
simple_type
`{
typeG
Σ
}
:=
...
...
This diff is collapsed.
Click to expand it.
theories/typing/type_context.v
+
23
−
5
View file @
00689c42
...
...
@@ -57,22 +57,40 @@ 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
);
}
.
(** Copy typing contexts *)
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
.
Proof
.
rewrite
/
CopyC
.
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
.
intros
???
.
rewrite
/
PersistentP
tctx_interp_cons
.
apply
uPred
.
sep_persistent
;
by
apply
_
.
Qed
.
(** Send typing contexts *)
Class
SendC
(
T
:
tctx
)
:=
sendc_change_tid
tid1
tid2
:
tctx_interp
tid1
T
-∗
tctx_interp
tid2
T
.
Global
Instance
tctx_nil_send
:
SendC
[]
.
Proof
.
done
.
Qed
.
Global
Instance
tctx_ty_send
T
p
ty
:
SendC
T
→
Send
ty
→
SendC
(
TCtx_hasty
p
ty
::
T
)
.
Proof
.
iIntros
(
HT
Hty
??)
.
rewrite
!
tctx_interp_cons
.
iIntros
"[Hty HT]"
.
iSplitR
"HT"
.
-
iDestruct
"Hty"
as
(?)
"[% Hty]"
.
iExists
_
.
iSplit
;
first
done
.
by
iApply
Hty
.
-
by
iApply
HT
.
Qed
.
(** Type context inclusion *)
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
∗
...
...
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