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
5302b308
Commit
5302b308
authored
Jul 11, 2019
by
Giuseppe Castagna
Browse files
space
parent
b2c60a69
Changes
1
Hide whitespace changes
Inline
Side-by-side
refining.tex
View file @
5302b308
...
...
@@ -58,7 +58,7 @@ the set that contains the types of all the occurrences of $x$ in $e$. This
judgement can be deduced by the following deduction system
that collects type information on the variables that are
$
\lambda
$
-abstracted
(i.e., those in the domain of
$
\Gamma
$
, since lambdas are our only
binders):
\vspace
{
-1mm
}
binders):
\vspace
{
-1
.5
mm
}
\begin{mathpar}
\Infer
[Var]
{
...
...
@@ -119,17 +119,17 @@ Where $\psi\setminus\{x\}$ is the function defined as $\psi$ but undefined on $x
\noindent
\else
.~
\fi
All that remains to do is replace the rule [
{
\sc
Abs
}
+] with the
following rule
\vspace
{
-
1
mm
}
following rule
\vspace
{
-
.8
mm
}
\begin{mathpar}
\Infer
[AbsInf+]
{
\Gamma
,x:s
\vdash
e
\triangleright\psi
\and
\Gamma
,x:s
\vdash
e:t
\and
T =
\{
(s,t)
\}
\cup
\{
(u,
v
) ~|~
u
\in\psi
(x)
\land
\Gamma
,x:u
\vdash
e:
v
\}
}
T =
\{
(s,t)
\}
\cup
\{
(u,
w
) ~|~
u
\in\psi
(x)
\land
\Gamma
,x:u
\vdash
e:
w
\}
}
{
\Gamma\vdash\lambda
x:s.e:
\textstyle\bigwedge
_{
(u,
v
)
\in
T
}
u
\to
v
\Gamma\vdash\lambda
x:s.e:
\textstyle\bigwedge
_{
(u,
w
)
\in
T
}
u
\to
w
}
{}
\vspace
{
-2.5mm
}
\end{mathpar}
...
...
@@ -151,7 +151,7 @@ will be checked for the input types $\Int$, $\Real\setminus\Int$, and
\Bool
, yielding the expected result.
It is not too difficult to generalize this rule when the lambda is
typed by an intersection type:
\vspace
{
-
1
mm
}
typed by an intersection type:
\vspace
{
-
.8
mm
}
\begin{mathpar}
\Infer
[AbsInf+]
{
\forall
i
\in
I~
\Gamma
,x:s
_
i
\vdash
e
\triangleright\psi
_
i
...
...
@@ -159,10 +159,10 @@ typed by an intersection type:\vspace{-1mm}
\Gamma
,x:s
_
i
\vdash
e : t
_
i
\and
T
_
i =
\{
(u,
v
) ~|~ u
\in\psi
_
i(x)
\land
\Gamma
, x:u
\vdash
e :
v
\}
T
_
i =
\{
(u,
w
) ~|~ u
\in\psi
_
i(x)
\land
\Gamma
, x:u
\vdash
e :
w
\}
}
{
\textstyle
\Gamma\vdash\lambda
^{
\bigwedge
_{
i
\in
I
}
s
_
i
\to
t
_
i
}
x.e:
\bigwedge
_{
i
\in
I
}
(s
_
i
\to
t
_
i)
\land\bigwedge
_{
(u,
v
)
\in
T
_
i
}
(u
\to
v
)
}
{}
\vspace
{
-3mm
}
t
_
i)
\land\bigwedge
_{
(u,
w
)
\in
T
_
i
}
(u
\to
w
)
}
{}
\vspace
{
-3mm
}
\end{mathpar}
Here, for each arrow declared in the interface of the function, we
first typecheck the body of the function as usual (to check that the
...
...
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