\beppe{Problem: how to compile functions with intersection types, since their body is typed several distinct types. I see two possible solutions: either merge the casts of the various typings (as we did in the compilation of polymorphic functions for semantic subtyping) or allow just one gradual type in the intersection when a function is explicitly typed (reasonable since, why would you use more gradual types in an intersection?)}

\item\textit{NVI} is the set of expressions that are neither

variables nor contains a type case, namely those produced by

the following grammar : $e ::= c ~|~ e~e ~|~ \lambda x:t.e ~|~

(e, e) ~|~ \pi_1 e ~|~ \pi_2 e$

\item$\psi\setminus\{x\}$ is the function defined as $\psi$ but undefined on $x$.

\item$\psi_1\cup\psi_2$ denote component-wise union, that is :

Where $\psi\setminus\{x\}$ is the function defined as $\psi$ but undefined on $x$ and $\psi_1\cup\psi_2$ denote component-wise union, that is :

\begin{displaymath}

(\psi_1\cup\psi_2)(x) = \left\{\begin{array}{ll}

\psi_1 (x) &\text{if~} x\notin

...

...

@@ -125,9 +113,7 @@ Where

\psi_1(x)\cup\psi_2(x) &\text{otherwise}

\end{array}\right.

\end{displaymath}

\end{enumerate}

\noindent And now all we need to do is replace the rule [{\sc Abs}+] with the

\noindent All that remains to do is replace the rule [{\sc Abs}+] with the

following rule

\begin{mathpar}

\Infer[AbsInf+]

...

...

@@ -244,7 +230,3 @@ information).

\beppe{Problem: how to compile functions with intersection types, since their body is typed several distinct types. I see two possible solutions: either merge the casts of the various typings (as we did in the compilation of polymorphic functions for semantic subtyping) or allow just one gradual type in the intersection when a function is explicitly typed (reasonable since, why would you use more gradual types in an intersection?)}