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
8be97ae8
There was a problem fetching the pipeline mini graph.
Commit
8be97ae8
authored
8 years ago
by
Ralf Jung
Browse files
Options
Downloads
Patches
Plain Diff
state calling and typing a function
parent
e8b5ce29
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
theories/lang/lang.v
+4
-4
4 additions, 4 deletions
theories/lang/lang.v
theories/typing/function.v
+17
-1
17 additions, 1 deletion
theories/typing/function.v
with
21 additions
and
5 deletions
theories/lang/lang.v
+
4
−
4
View file @
8be97ae8
...
...
@@ -163,14 +163,14 @@ Fixpoint subst_l (xl : list binder) (esl : list expr) (e : expr) : option expr :
|
_,
_
=>
None
end
.
Definition
subst_
l_
vec
{
n
}
(
xl
:
vec
binder
n
)
(
el
:
vec
expr
n
)
:
expr
→
expr
:=
Definition
subst_vec
{
n
}
(
xl
:
vec
binder
n
)
(
el
:
vec
expr
n
)
:
expr
→
expr
:=
Vector
.
rect2
(
λ
_
_
_,
expr
→
expr
)
id
(
λ
n
_
_
rec
x
e
,
rec
∘
subst'
x
e
)
xl
el
.
Lemma
subst_
l_
vec_eq
{
n
}
(
xl
:
vec
binder
n
)
(
el
:
vec
expr
n
)
e
:
Some
$
subst_
l_
vec
xl
el
e
=
subst_l
xl
el
e
.
Lemma
subst_vec_eq
{
n
}
(
xl
:
vec
binder
n
)
(
el
:
vec
expr
n
)
e
:
Some
$
subst_vec
xl
el
e
=
subst_l
xl
el
e
.
Proof
.
revert
n
xl
el
e
.
eapply
(
vec_rect2
(
λ
n
xl
el
,
∀
e
,
Some
$
subst_
l_
vec
xl
el
e
=
subst_l
xl
el
e
));
first
done
.
revert
n
xl
el
e
.
eapply
(
vec_rect2
(
λ
n
xl
el
,
∀
e
,
Some
$
subst_vec
xl
el
e
=
subst_l
xl
el
e
));
first
done
.
move
=>
n
xl
el
IH
x
es
e
.
simpl
.
apply
IH
.
Qed
.
...
...
This diff is collapsed.
Click to expand it.
theories/typing/function.v
+
17
−
1
View file @
8be97ae8
...
...
@@ -14,7 +14,7 @@ Section fn.
typed_body
(
E
x
)
[]
[
CctxElt
k
[]
1
(
λ
v
,
[
TCtx_hasty
(
v
!!!
0
)
(
ty
x
)])]
(
zip_with
(
TCtx_hasty
∘
of_val
)
args
(
tys
x
))
(
f
(
of_val
<$>
(
args
:
list
val
))))
%
I
|}
.
(
f
(
of_val
<$>
(
k
::
args
:
list
val
))))
%
I
|}
.
Next
Obligation
.
iIntros
(
A
n
E
tys
ty
tid
vl
)
"H"
.
iDestruct
"H"
as
(
f
)
"[% _]"
.
by
subst
.
Qed
.
...
...
@@ -87,4 +87,20 @@ Section fn.
{
rewrite
/
elctx_interp
big_sepL_cons
.
iFrame
.
iApply
(
Hκκ'
with
"HE0 HL0"
)
.
}
rewrite
/
elctx_interp
big_sepL_cons
.
iIntros
"[_ HE]"
.
by
iApply
"HC"
.
Qed
.
(* TODO: Define some syntactic sugar for calling and letrec like we do on paper. *)
Lemma
typed_call
{
A
n
}
E
L
E'
T
(
tys
:
A
→
vec
type
n
)
ty
k
p
(
ps
:
vec
path
n
)
x
:
tctx_incl
E
L
T
(
zip_with
TCtx_hasty
ps
(
tys
x
))
→
elctx_sat
E
L
(
E'
x
)
→
typed_body
E
L
[
CctxElt
k
L
1
(
λ
v
,
(
TCtx_hasty
(
v
!!!
0
)
(
ty
x
))
::
T
)]
[
TCtx_hasty
p
(
fn
E'
tys
ty
)]
(
p
(
of_val
k
::
ps
))
.
Proof
.
Abort
.
Lemma
typed_fn
{
A
n
}
E
L
T
E'
(
tys
:
A
→
vec
type
n
)
ty
fb
kb
(
argsb
:
vec
binder
n
)
e
`{
!
CopyC
T
}
:
(
∀
x
f
k
(
args
:
vec
val
n
),
typed_body
(
E'
x
)
[]
[
CctxElt
k
[]
1
(
λ
v
,
[
TCtx_hasty
(
v
!!!
0
)
(
ty
x
)])]
(
TCtx_hasty
f
(
fn
E'
tys
ty
)
::
zip_with
(
TCtx_hasty
∘
of_val
)
args
(
tys
x
)
++
T
)
(
subst
fb
f
$
subst_vec
(
kb
:::
argsb
)
(
Vector
.
map
of_val
$
k
:::
args
)
e
))
→
typed_instruction_ty
E
L
T
(
Rec
fb
(
kb
::
argsb
)
e
)
(
fn
E'
tys
ty
)
.
Proof
.
Abort
.
End
fn
.
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