@@ -363,10 +363,17 @@ negated arrow types for functions. This means that the algorithmic

system is not complete as we discuss in details in the next section.

\subsubsection{Properties of the algorithmic system}\label{sec:algoprop}

\rev{%%%

In what follow we will use $\Gamma\vdashA^{n_o} e:t$ to stress the

fact that the judgement $\Gamma\vdashA e:t$ is provable in the

algorithmic system where $\Refinef_{e,t}$ is defined as

$(\RefineStep{e,t})^{n_o}$; we will omit the index $n_o$---thus keeping

it implicit---whenever it does not matter in the context.

}%%%rev

The algorithmic system above is sound with respect to the deductive one of Section~\ref{sec:static}

\begin{theorem}[Soundness]\label{th:algosound}

For every $\Gamma$, $e$, $t$, $n_o$, if $\Gamma\vdashA e: t$, then $\Gamma\vdash e:t$.

For every $\Gamma$, $e$, $t$, $n_o$, if $\Gamma\vdashA^{n_o} e: t$, then $\Gamma\vdash e:t$.

\end{theorem}

The proof of this theorem (see \Appendix\ref{sec:proofs_algorithmic_without_ts}) is obtained by

defining an algorithmic system $\vdashAts$ that uses type schemes,

...

...

@@ -417,7 +424,7 @@ than $\Empty\to\Any$ (see

definition). Then we have:

\begin{theorem}[Completeness for Positive Expressions]

For every type environment $\Gamma$ and \emph{positive} expression $e$, if

$\Gamma\vdash e: t$, then there exist $n_o$ and $t'$ such that $\Gamma\vdashA

$\Gamma\vdash e: t$, then there exist $n_o$ and $t'$ such that $\Gamma\vdashA^{n_o}

e: t'$.

\end{theorem}\noindent

We can use the algorithmic system $\vdashAts$ defined for the proof

...

...

@@ -440,7 +447,7 @@ types, since, intuitively, it corresponds to typing a language in

which in the types used in dynamic tests, a negated arrow never occurs on the

left-hand side of another negated arrow.

\begin{theorem}[Rank-0 Completeness]

For every $\Gamma$, $e$, $t$, if $\Gamma\vdash e:t$ is derivable by a rank-0 negated derivation, then there exists $n_o$ such that $\Gamma\vdashAts e: t'$ and $t'\leq t$.

For every $\Gamma$, $e$, $t$, if $\Gamma\vdash e:t$ is derivable by a rank-0 negated derivation, then there exists $n_o$ such that $\Gamma\vdashAts^{n_o} e: t'$ and $t'\leq t$.

\end{theorem}

\noindent This last result is only of theoretical interest since, in

practice, we expect to have only languages with positive