Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Giuseppe Castagna
occurrence-typing
Commits
1b2a70f6
Commit
1b2a70f6
authored
Oct 12, 2020
by
Mickael Laurent
Browse files
update refining2
parent
e7742460
Changes
1
Hide whitespace changes
Inline
Side-by-side
refining2.tex
View file @
1b2a70f6
...
@@ -64,7 +64,7 @@ improves these two points.
...
@@ -64,7 +64,7 @@ improves these two points.
{
e
\text
{
a variable or constant
}}
{
e
\text
{
a variable or constant
}}
\hfill
\hfill
\Infer
[Abs]
\Infer
[Abs]
{
\Gamma
,y:s
\vdash
e
\triangleright
_
x
\psi
}
{
\Gamma
,
(
y:s
)
\vdash
e
\triangleright
_
x
\psi
}
{
{
\Gamma\vdash\lambda
y:s.e
\triangleright
_
x
\psi
\Gamma\vdash\lambda
y:s.e
\triangleright
_
x
\psi
}
}
...
@@ -120,8 +120,9 @@ improves these two points.
...
@@ -120,8 +120,9 @@ improves these two points.
% \vspace{-2.3mm}\\
% \vspace{-2.3mm}\\
\Infer
[OverLet]
\Infer
[OverLet]
{
{
\Gamma
\vdash
e
_
2
\triangleright
_
x
\psi
_
x
\\
\Gamma
\vdash
e
_
1: t
\\
\Gamma
\vdash
e
_
2
\triangleright
_
y
\psi
_
y
\\
\Gamma
, (y:t)
\vdash
e
_
2
\triangleright
_
x
\psi
_
x
\\
\Gamma
, (y:t)
\vdash
e
_
2
\triangleright
_
y
\psi
_
y
\\
\forall
u
\in
\psi
_
y.
\ \Gamma\evdash
{
e
_
1
}{
u
}
\{\Gamma
_
u
^
i
\}
_{
i
\in
I
_
u
}
\forall
u
\in
\psi
_
y.
\ \Gamma\evdash
{
e
_
1
}{
u
}
\{\Gamma
_
u
^
i
\}
_{
i
\in
I
_
u
}
}
}
{
\Gamma
\vdash\textstyle
{
\Gamma
\vdash\textstyle
...
@@ -150,14 +151,26 @@ improves these two points.
...
@@ -150,14 +151,26 @@ improves these two points.
}
}
\end
{
array
}\]
\end
{
array
}\]
Typing rule for the LET:
\begin{mathpar}
\Infer
[Let]
{
\Gamma
\vdash
e
_
1: t
_
1
\\
\Gamma
,y:t
_
1
\vdash
e
_
2
\triangleright
_
y
\psi\\
\psi
' =
\psi\cup\{
t
_
1
\setminus
(
\bigvee
_{
u
\in\psi
}
u)
\}\\
\forall
u
\in\psi
'.
\ \Gamma\evdash
{
e
_
1
}{
u
}
\{\Gamma
_
u
^
i
\}
_{
i
\in
I
_
u
}
\\
\forall
u
\in\psi
'.
\ \forall
i
\in
I
_
u.
\ \Gamma
_
u
^
i, (y:u)
\vdash
e
_
2:t
}
{
\Gamma
\vdash\textstyle
\texttt
{
let
}
y
\texttt
{
\,
=
\,
}
e
_
1
\texttt
{
\,
in
\,
}
e
_
2:t
}
{}
\vspace
{
-1.4mm
}
\end{mathpar}
TODO:
$
\triangleright
$
should return a set of environments (mapping variables only) instead
TODO:
$
\triangleright
$
should return a set of environments (mapping variables only) instead
of a set of types for a given variable?
of a set of types for a given variable?
TODO: typing rule for the let. If we want full control flow, it should compute
$
e
_
2
\triangleright
_
y
\psi
$
and, for all
$
t
$
in
$
\psi
$
, type
$
e
_
2
$
under the hypothesis
that
$
e
_
1
$
has type
$
t
$
(and, finally,
under the hypothesis that
$
e
_
1
$
has type
$
\tyof
{
e
_
1
}{
\Gamma
}
\setminus\bigcup
_{
t
\in\psi
}
t
$
).
TODO: The
$
\evdash
e t
$
operator is used in the Case, OverApp and OverLet rules,
TODO: The
$
\evdash
e t
$
operator is used in the Case, OverApp and OverLet rules,
but what we would actually need is an operator that computes the other direction:
but what we would actually need is an operator that computes the other direction:
which environments can surely lead to
$
e
$
having the type
$
t
$
?
which environments can surely lead to
$
e
$
having the type
$
t
$
?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment