* We refine the type of expressions occurring in type tests, thus removing the limitations of current occurrence-typing approaches where both tests and refinements are limited to variables.

* We define a type-theoretic approach alternative to the current flow-based approaches: it provides different results and can thus be combined with flow-based techniques.

* We use our analysis for defining a formal framework that reconstructs intersection types for unannotated or partially-annotated functions

* We prove the soundness of our system. We define algorithms to infer the types that we prove to be sound and complete.

* We show how to extend our approach to records with field addition, update, and deletion operations.

* We show how occurrence typing can be extended to and combined with gradual typing and used to optimize the latter.

@@ -10,7 +10,8 @@ that a value crossing the barrier is correctly typed.

Occurrence typing and gradual typing are two complementary disciplines

which have a lot to gain to be integrated, although we are not aware

of any study in this sense. We study it for the formalism of Section~\ref{sec:language} for which the integration of gradual typing was defined by~\citet{castagna2019gradual}.

of any study in this sense. We explore this integration for the formalism of Section~\ref{sec:language} for which the integration of gradual typing was defined by~\citet{castagna2019gradual}.

In a sense, occurrence typing is a

discipline designed to push forward the frontiers beyond which gradual

typing is needed, thus reducing the amount of runtime checks needed. For

...

...

@@ -21,7 +22,7 @@ typed by using gradual typing:%\svvspace{-.2mm}