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
860da57b
Commit
860da57b
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
eqtype proper for function types
parent
a1fb276d
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/function.v
+20
-0
20 additions, 0 deletions
theories/typing/function.v
theories/typing/type.v
+18
-0
18 additions, 0 deletions
theories/typing/type.v
with
38 additions
and
0 deletions
theories/typing/function.v
+
20
−
0
View file @
860da57b
...
...
@@ -112,6 +112,26 @@ Section typing.
intros
.
apply
fn_subtype_full
;
try
done
.
intros
.
apply
elctx_incl_refl
.
Qed
.
(* This proper and the next can probably not be inferred, but oh well. *)
Global
Instance
fn_subtype_ty'
{
A
n
}
E0
L0
E
:
Proper
(
flip
(
pointwise_relation
A
(
λ
(
v1
v2
:
vec
type
n
),
Forall2
(
subtype
E0
L0
)
v1
v2
))
==>
pointwise_relation
A
(
subtype
E0
L0
)
==>
subtype
E0
L0
)
(
fn
E
)
.
Proof
.
intros
tys1
tys2
Htys
ty1
ty2
Hty
.
apply
fn_subtype_ty
.
-
intros
.
eapply
Forall2_impl
;
first
eapply
Htys
.
intros
??
.
eapply
subtype_weaken
;
last
done
.
by
apply
contains_inserts_r
.
-
intros
.
eapply
subtype_weaken
,
Hty
;
last
done
.
by
apply
contains_inserts_r
.
Qed
.
Global
Instance
fn_eqtype_ty'
{
A
n
}
E0
L0
E
:
Proper
(
pointwise_relation
A
(
λ
(
v1
v2
:
vec
type
n
),
Forall2
(
eqtype
E0
L0
)
v1
v2
)
==>
pointwise_relation
A
(
eqtype
E0
L0
)
==>
eqtype
E0
L0
)
(
fn
E
)
.
Proof
.
intros
tys1
tys2
Htys
ty1
ty2
Hty
.
split
;
eapply
fn_subtype_ty'
;
try
(
by
intro
;
apply
Hty
)
.
-
intros
x
.
eapply
Forall2_flip
,
Forall2_impl
;
first
by
eapply
(
Htys
x
)
.
by
intros
??[]
.
-
intros
x
.
eapply
Forall2_impl
;
first
by
eapply
(
Htys
x
)
.
by
intros
??[]
.
Qed
.
Lemma
fn_subtype_elctx_sat
{
A
n
}
E0
L0
E
E'
(
tys
:
A
→
vec
type
n
)
ty
:
(
∀
x
,
elctx_sat
(
E
x
)
[]
(
E'
x
))
→
subtype
E0
L0
(
fn
E'
tys
ty
)
(
fn
E
tys
ty
)
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/type.v
+
18
−
0
View file @
860da57b
From
iris
.
base_logic
.
lib
Require
Export
na_invariants
.
From
iris
.
base_logic
Require
Import
big_op
.
From
lrust
.
lang
Require
Export
proofmode
notation
.
From
lrust
.
lifetime
Require
Import
borrow
frac_borrow
reborrow
.
From
lrust
.
typing
Require
Import
lft_contexts
.
...
...
@@ -428,6 +429,23 @@ Section subtyping.
Qed
.
End
subtyping
.
Section
weakening
.
Context
`{
typeG
Σ
}
.
Lemma
subtype_weaken
E1
E2
L1
L2
ty1
ty2
:
E1
`
contains
`
E2
→
L1
`
contains
`
L2
→
subtype
E1
L1
ty1
ty2
→
subtype
E2
L2
ty1
ty2
.
Proof
.
(* TODO: There's no lemma relating `contains` to membership (∈)...?? *)
iIntros
(
HE12
[
L'
HL12
]
%
contains_Permutation
Hsub
)
"#LFT HE HL"
.
iApply
(
Hsub
with
"LFT [HE] [HL]"
)
.
-
rewrite
/
elctx_interp_0
.
by
iApply
big_sepL_contains
.
-
iDestruct
"HL"
as
%
HL
.
iPureIntro
.
intros
??
.
apply
HL
.
rewrite
HL12
.
set_solver
.
Qed
.
End
weakening
.
Hint
Resolve
subtype_refl
eqtype_refl
:
lrust_typing
.
Ltac
solve_typing
:=
by
eauto
100
with
lrust_typing
.
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