Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sgdt
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
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
gradual-typing
sgdt
Commits
cef6c9ca
Commit
cef6c9ca
authored
6 years ago
by
Max New
Browse files
Options
Downloads
Patches
Plain Diff
some headline theorems
parent
ec564a10
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
paper/gtt.tex
+39
-7
39 additions, 7 deletions
paper/gtt.tex
with
39 additions
and
7 deletions
paper/gtt.tex
+
39
−
7
View file @
cef6c9ca
...
...
@@ -760,9 +760,31 @@ While contracts are typically implemented in a dynamically typed
language, our target is typed, meaning we retain the type information
that might be used in later stages of compilation.
%
We could always erase the types of our typed language (cbpv's
operational semantics is perfectly sensible on untyped terms) and get
a more typical contract translation.
We could erase the types of our typed language and translate to some
dynamically typed version of cbpv to get a more typical contract
translation, but we leave this to future work.
In particular the aim of this section is to establish the following
theorems:
\begin{theorem}
{
Consistency of GTT
}
There exists a judgment
$
\Gamma
_
1
\ltdyn
\Gamma
_
2
\vdash
M
_
1
\ltdyn
M
_
2
: B
_
1
\ltdyn
B
_
2
$
that is not provable.
\end{theorem}
\begin{theorem}
{
Contextual Approximation
}
If
$
\Gamma
_
1
\ltdyn
\Gamma
_
2
\vdash
M
_
1
\ltdyn
M
_
2
: B
_
1
\ltdyn
B
_
2
$
, then for any context
$
C :
(
\Gamma
_
1
\vdash
B
_
1
)
\Rightarrow
(
\cdot
\vdash
\u
F
2
)
$
, and any valid interpretation of the dynamic
types, one of the following holds
\begin{enumerate}
\item
$
\sem
{
C
[
M
_
1
]
}
\Downarrow
\err
$
\item
$
\sem
{
C
[
M
_
1
]
}
,
\sem
{
C
[
\dncast
{
B
_
1
}{
B
_
2
}
M
_
2
[
\upcast
{
\Gamma
_
1
}{
\Gamma
_
2
}{
\Gamma
_
1
}
]]
}
\Uparrow
$
\item
$
\sem
{
C
[
M
_
1
]
}
,
\sem
{
C
[
\dncast
{
B
_
1
}{
B
_
2
}
M
_
2
[
\upcast
{
\Gamma
_
1
}{
\Gamma
_
2
}{
\Gamma
_
1
}
]]
}
\Downarrow
\ret
V
$
and
$
V
=
\tru
$
or
$
V
=
\fls
$
.
\end{enumerate}
\end{theorem}
As described in the previous section, almost all of the contract
translation is uniquely determined already: casts between function
...
...
@@ -1846,8 +1868,10 @@ covariant arguments of the opposite sort as the connective.
%
Because of this, they would need to be treated carefully, in a similar
way as the
$
U,
\u
F
$
connectives.
v
%
In addition, the connectives are not operationally well-behaved.
%
In addition, the connectives do not seem to have an operational
reading, or at least one that extends the call-by-push-value
operational semantics.
%
For instance adding a value function space would mean also including a
value application, and so operationally, values would not be inert.
...
...
@@ -1858,9 +1882,17 @@ and amenability to extensions.
\appendix
\section
{
Call-by-value Gradual Type Theory
}
In this appendix we present for the reader who is unfamiliar with
call-by-push-value two type theories for call-by-value and
call-by-name gradual typing in this style.
%
In each we prove one of the non-obvious uniqueness theorems that we
showed for CBPV: in CBV we show the function type must be the
thunkable, wrapping implementation and for the CBN what would we do??
\section
{
Mini Call-by-value Gradual Type Theory
}
\section
{
Call-by-name Gradual Type Theory
}
\section
{
Mini
Call-by-name Gradual Type Theory
}
\end{document}
...
...
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