\documentclass[runningheads,a4paper]{article}

\usepackage{a4}
\usepackage{RR}

%\usepackage{graphicx}

%the package below only works with XeTeX enabled;
%use "xelatex closures.tex" to compile this file
\usepackage{fontspec}
% DejaVuSansMono is used to get correct unicode characters in the code
% example, in the annex describing the prototype
\setmonofont[Scale=0.8]{DejaVuSansMono}

\usepackage[english,french]{babel}

\usepackage{fancyvrb}

% support for both a short and a long version
\usepackage{boolean}
\usepackage{reversion}
\usepackage[small,bf,belowskip=-2ex,aboveskip=2ex]{caption} %Remove extra space around captions

\usepackage{amssymb}
% \let\spvec\vec %problems with amsmath
% \let\vec\accentvec %problems with amsmath
%\usepackage{amsmath}

\def \qed
   {\unskip \ifhmode \unpenalty \penalty 100\fi\hfill \rule{2mm}{2mm}\relax}

%\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}
\newtheorem{corollary}{Corollary}
\newenvironment{proof}{}{}
%\theoremstyle{definition}
\newtheorem{xdefinition}{Definition}
\newenvironment{definition}[1][]
  {\ifthenelse{\equal{#1}{}}
        {\begin{xdefinition}}
        {\begin{xdefinition}[#1]}\em}
  {\end{xdefinition}}
%\theoremstyle{remark}
\newtheorem{remark}{Remark}



\newcommand{\implies}{\longrightarrow}

%we decided to keep fixpoints out of the short version, and include them in the long
\def\doShort
  {\let\Long\False \let\Short\True \let\Medium\False \let\Fixpoint\False}
\def\doMedium
  {\let\Long\False \let \Short\False \let\Medium\True \let\Fixpoint\True}
\def\doLong
  {\let \Long\True  \let\Short\False \let\Medium\False \let\Fixpoint\True}

\usepackage[usenames,dvipsnames]{xcolor}

\usepackage{listings}
\lstset{xleftmargin=3em}
\lstset{
  mathescape=true,
  language=[Objective]{Caml},
  basicstyle=\ttfamily,
  extendedchars=true,
  showstringspaces=false,
  aboveskip=\smallskipamount,
  % belowskip=\smallskipamount,
  columns=fullflexible,
  moredelim=**[is][\color{blue}]{/*}{*/},
  moredelim=**[is][\color{green!60!black}]{/!}{!/},
  moredelim=**[is][\color{orange}]{/(}{)/},
  moredelim=[is][\color{red}]{/[}{]/}
}

%needed for keywords according to the template
\newcommand{\keywords}[1]{\par\addvspace\baselineskip
\noindent\keywordname\enspace\ignorespaces#1}

%------------Draft---------------------------------------
% \usepackage{eso-pic}
% \usepackage{xcolor}
% \AddToShipoutPicture{\setlength{\unitlength}{1in}\put(4.25,10.0){\makebox[0pt][c]{\normalfont\textsf{\textbf{\large \color{gray} Draft -- \today}}}}}
%--------------------------------------------------------

% \usepackage{amsthm}
% \newtheorem{conjecture}{Conjecture}
% \newtheorem{ulemma}{Unproven lemma}
% \newtheorem{utheorem}{Unproven theorem}
% \newtheorem{lemma}{Lemma}
% \newtheorem{theorem}{Theorem}

%mathematical inference rules and corresponding figures
\usepackage{mathpartir}
\usepackage{hyperref}
\hypersetup{colorlinks=true, linkcolor=Red, citecolor=ForestGreen, urlcolor=RoyalBlue}

\renewcommand {\RefTirName}[1]{\hypertarget{#1}{\TirName {#1}}}
\renewcommand {\DefTirName}[1]{\hyperlink{#1}{\TirName {#1}}}
\let \DefRule \RefTirName
\let \Rule \DefTirName
\newenvironment{mathparfig}[3][t]
   {\begin{figure}[#1]\abovedisplayskip 0em\belowdisplayskip 0em
    \def \CAPTION{\label{#2}#3}
    \def \MathparLineskip {\lineskip=0.2cm} \begin{mathpar}}
   {\end{mathpar}\caption{\CAPTION}\end{figure}}
\newcommand {\uad}{\hskip 1ex}
\newcommand{\noabovedisplayskip}{\abovedisplayskip 0em}
\newcommand {\nobelowdisplayskip}{\belowdisplayskip 0em}

\renewcommand {\RefTirName}[1]{\hypertarget{#1}{\TirName {#1}}}
\renewcommand {\DefTirName}[1]{\hyperlink{#1}{\TirName {#1}}}
\let \DefRule \RefTirName
\let \Rule \DefTirName

\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\tyc}[1]{\mathtt{#1}}

\newcommand{\lam}[1]{\lambda #1 .}
\newcommand{\Lam}[1]{\Lambda #1 .}
\newcommand{\all}[1]{\forall #1 .}
\newcommand{\tfun}[3]{{[#1](#2)} \to #3}

\newcommand{\fix}[2]{\ensuremath{\texttt{fix} \, #1 \, #2 .}}

\newcommand{\type}[1]{\ensuremath{\mathit{#1}}}

\newcommand{\app}[0]{~}  %term application
% \newcommand{\papp}[0]{~} %pattern sequencing
% \newcommand{\napp}[0]{~} %application of neutrals
% \newcommand{\tapp}[0]{~} %type application
% \newcommand{\inj}[0]{\texttt{inj}}

\newcommand{\poly}[2]{#1[#2]}

\newcommand{\der}{\vdash}
\newcommand{\cder}{\stackrel{c}{\der}}
% \newcommand{\atomder}{\dashv}
% \newcommand{\patto}{\leadsto}

% \newcommand{\case}{~\texttt{case}}

\newcommand{\iI}{{i\in I}}
% \newcommand{\iIa}{{i\in I_1}}
% \newcommand{\iIb}{{i\in I_2}}
\newcommand{\jJ}{{j \in J}}
% \newcommand{\iIjJ}{{i \in I, j \in J}}

\newcommand{\of}{\mathpunct{:}\!}

\newcommand{\clet}[3]{\mathop{\code{let}} #1 = #2 \mathbin{\code{in}} #3}
\newcommand{\csubst}[3]{\mathopen{\code{subst}}(#1\backslash{}#2, #3)}
\newcommand{\cmatch}[3]{
  \mathop{\code{match}} #1 \mathbin{\code{with}} #2 \mapsto #3
}
\newcommand{\Rewto}[1]{\stackrel{#1}{\uad\leadsto\uad}}
\newcommand{\rewto}[2]{\Rewto{#1\backslash{}#2}}
%\newcommand{\redto}[1]{\stackrel{#1}{\implies}}
\newcommand{\redto}{\implies}
\newcommand{\credto}{\stackrel{c}{\implies}}

\newcommand{\noneed}{\lozenge}
\newcommand{\filter}[2]{{#1|}^{#2}}
\newcommand{\push}[1]{, #1}

% proof by cases
\newenvironment{caselist}{%
  \begin{list}{{\it Case}}{}%
}{\end{list}%
}
\newenvironment{subcaselist}{%
  \begin{list}{{\it Subcase}}{}%
}{\end{list}%
}
\newenvironment{subsubcaselist}{%
  \begin{list}{{\it Subsubcase}}{}%
}{\end{list}%
}

\newcommand{\nextcase}{\item~}

\newcommand{\Gammap}{{\Gamma^\prime}}
\newcommand{\Phip}{{\Phi^\prime}}

\newcommand{\Phicode}[1]{{{\Phi}_{\code{#1}}}}
\newcommand{\Phidef}{\Phicode{def}}
\newcommand{\Phibody}{\Phicode{body}}
\newcommand{\Phifun}{\Phicode{fun}}
\newcommand{\Phiarg}{\Phicode{arg}}
\newcommand{\Phiclos}{\Phicode{clos}}

\newcommand{\Phipcode}[1]{{{\Phi'}_{\code{#1}}}}
%\newcommand{\Phiparg}{\Phipcode{arg}}
\newcommand{\Phipclos}{\Phipcode{clos}}

\newcommand{\only}[2]{#1{#2}{}}

\newcommand{\fvenv}[1]{[#1]}
% \DeclareMathOperator\dom{dom}
\newcommand{\dom}[1]{\mathtt{dom}(#1)}

%%use short or long version?
\doLong
%\doMedium
%\doShort

\RRNo{8345}
\RRdate{August 2013}

\RRauthor{% les auteurs
Gabriel Scherer
\and
Jan Hoffmann\thanks{Yale University}
}
%% Ceci apparait sur chaque page paire.
\authorhead{Scherer \& Hoffmann}
%% titre francais long
\RRtitle{Types ouverts de fermetures,
  et une application au typage des flots de données}
%% English title
\RRetitle{Tracking Data-Flow with Open Closure Types}
%\titlehead{Example of RR.sty}
%%
%%
\RRresume{ Les systèmes de types cachent les variables capturées par
  une fermeture, et ce dès sa création. À un point donné du programme,
  il serait en fait possible de mentionner certaines de ces variables,
  celles qui sont toujours présentes dans l'environnement lexical de
  typage. Ce raffinement des types de fermetures, plus ``ouverts'' car
  mentionnant le contexte qui les entoure, est désirable pour
  certaines applications des systèmes de types à l'analyse de programmes.

  Cet article introduit formellement de tels types ouverts de
  fermetures, pour mettre à plat leur traitement théorique recélant
  quelques difficultés techniques: le type d'une fermeture mentionne
  ses dépendances sur le contexte, et varie donc selon les différents
  point du programme.

  En guise d'exemple, ils sont utilisés pour garder trace des
  informations de typage de flots de données induits par la capture
  des valeurs de l'environnement dans les fermetures.

  Un prototype d'implémentation de ce système de types est
  publiquement disponible.
}
\RRabstract{
  Type systems hide data that is captured by function closures in
  function types.  In most cases this is a beneficial design that
  enables simplicity and compositionality.  However, some applications
  require explicit information about the data that is captured in
  closures.

  This paper introduces open closure types, that is, function
  types that are decorated with type contexts.  They are used to track
  data-flow from the environment into the function closure.  
  %
  A simply-typed lambda calculus is used to study the properties of
  the type theory of open closure types.  A distinctive feature
  of this type theory is that an open closure type of a function
  can vary in different type contexts.
  %
  To present an application of the type theory, it is shown that a
  type derivation establishes a simple non-interference property in
  the sense of information-flow theory.
  %
  A publicly available prototype implementation of the system can be
  used to experiment with type derivations for example programs.
% \keywords{Type Systems, Closure Types, Static Analysis, Information Flow}
}
%%
\RRmotcle{typage, fermetures, types ouverts}
\RRkeyword{type systems, closures, open types}
%%
\RRprojet{Gallium}
%%
%% \URLorraine % pour ceux qui sont \`a l'est
%% \URRennes  % pour ceux qui sont \`a l'ouest
%% \URRhoneAlpes % pour ceux qui sont dans les montagnes
%% \URRocq % pour ceux qui sont au centre de la France
%% \URFuturs % pour ceux qui sont dans le virtuel
%% \URSophia % pour ceux qui sont au Sud.
%%
%% \RCBordeaux % centre de recherche Bordeaux - Sud Ouest
%% \RCLille % centre de recherche Lille Nord Europe
\RCParis % Paris Rocquencourt
%% \RCSaclay % Saclay \^Ile de France
%% \RCGrenoble % Grenoble - Rh\^one-Alpes
%% \RCNancy % Nancy - Grand Est
%% \RCRennes % Rennes - Bretagne Atlantique
%% \RCSophia % Sophia Antipolis M\'editerran\'ee

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: "RR-8114"
%%% End: 

\begin{document}

\selectlanguage{francais}
  \makeRR
\selectlanguage{english}

\tableofcontents
