@@ -10,15 +10,13 @@ auxiliary deduction system for paths.

$(i)$. Multiple types have two distinct origins each requiring a distinct

technical solution. The first origin is the presence of

%structural

structural

rules

\iffalse

\footnote{\label{fo:rules}In logic, logical rules refer to a

particular connective (here, a type constructor, that is, either

$\to$, or $\times$, or $b$), while identity rules (e.g., axioms and

cuts) and structural rules (e.g., weakening and contraction) do

not.}

\fi

not.\vspace{-3.3mm}}

such as \Rule{Subs} and \Rule{Inter}. We handle this presence

in the classic way: we define an algorithmic system that tracks the

miminum type of an expression; this system is obtained from the

...

...

@@ -77,18 +75,20 @@ things get more difficult, since a function can be typed by, say, a

union of intersection of arrows and negations of types. Checking that

the function has a functional type is easy since it corresponds to

checking that it has a type subtype of $\Empty{\to}\Any$. Determining

its domain and the type of the application is more complicated and needs the operators $\dom{}$ and $\circ$ we informally described in Section~\ref{sec:ideas} where we also introduced the operator $\worra{}{}$. These three operators are used by our algorithm and formally defined as:\vspace{-2mm}

its domain and the type of the application is more complicated and needs the operators $\dom{}$ and $\circ$ we informally described in Section~\ref{sec:ideas} where we also introduced the operator $\worra{}{}$. These three operators are used by our algorithm and formally defined as:\vspace{-3.5mm}

\begin{eqnarray}

\dom t & = &\max\{ u \alt t\leq u\to\Any\}

\\[-1mm]

\apply t s & = &\,\min\{ u \alt t\leq s\to u\}

\\[-1mm]

\worra t s & = &\,\min\{u \alt t\circ(\dom t\setminus u)\leq\neg s\}\label{worra}

\end{eqnarray}\vspace{-3.75mm}\\

%In short, $\dom t$ is the largest domain of any single arrow that

%subsumes $t$, $\apply t s$ is the smallest domain of an arrow type

%that subsumes $t$ and has domain $s$ and $\worra t s$ was explained

%before.

\end{eqnarray}\vspace{-4.7mm}\\

\iflongversion%

In short, $\dom t$ is the largest domain of any single arrow that

subsumes $t$, $\apply t s$ is the smallest domain of an arrow type

that subsumes $t$ and has domain $s$ and $\worra t s$ was explained

before.

\fi%

We need similar operators for projections since the type $t$

of $e$ in $\pi_i e$ may not be a single product type but, say, a union

of products: all we know is that $t$ must be a subtype of

...

...

@@ -150,7 +150,9 @@ We start by defining the algorithm for each single occurrence, that is for the d

All the functions above are defined if and only if the initial path

$\varpi$ is valid for $e$ (i.e., $\occ e{\varpi}$ is defined) and $e$

is well-typed (which implies that all $\tyof{\occ e{\varpi}}\Gamma$

in the definition are defined).\footnote{Note that the definition is

in the definition are defined).%

\iflongversion%

\footnote{Note that the definition is

well-founded. This can be seen by analyzing the rule

\Rule{Case\Aa} of Section~\ref{sec:algorules}: the definition of $\Refine{e,t}\Gamma$ and

$\Refine{e,\neg t}\Gamma$ use $\tyof{\occ e{\varpi}}\Gamma$, and

...

...

@@ -158,7 +160,7 @@ in the definition are defined).\footnote{Note that the definition is

\Rule{Case\Aa} states that $\Gamma\vdash e:t_0$ (and this is

possible only if we were able to deduce under the hypothesis

$\Gamma$ the type of every occurrence of $e$.)\vspace{-3mm}}

\fi

Each case of the definition of the $\constrf$ function corresponds to the