Commit 399fad4d authored by Mickael Laurent's avatar Mickael Laurent
Browse files

comment previous 'new systems' and add rules for the declarative system

parent c274a79b
......@@ -335,24 +335,29 @@ The authors thank Paul-André Melliès for his help on type ranking.
\section{A crack to Flow Analysis}\label{app:flowanalysis}
\input{flowanalysis}
\newpage
%\newpage
\section{New typecase system}
\input{typecase}
%\section{New typecase system}
%\input{typecase}
\newpage
%\newpage
\section{New function refinement rules}
\input{refining2}
%\section{New function refinement rules}
%\input{refining2}
\newpage
%\newpage
%\section{Full new system with normal form}
%\input{new_system}
%\newpage
\section{Full new system with normal form}
\input{new_system}
%\section{Full new system with normal form (experimentation)}
%\input{new_system2}
\newpage
\section{Full new system with normal form (experimentation)}
\input{new_system2}
\section{New system with normal form}
\input{new_system3}
\end{document}
\subsection{Syntax}
\[
\begin{array}{lrcl}
\textbf{Types} & t & ::= & b\alt t\to t\alt t\times t\alt t\vee t \alt \neg t \alt \Empty
\end{array}
\]
\begin{equation}\label{expressions2}
\begin{array}{lrclr}
\textbf{Atomic expr} &a &::=& c\alt x\alt\lambda x:t.e\alt (x,x)
\alt x x\alt \tcase{x}{t}{e}{e}\alt \pi_i x\\[.3mm]
\textbf{Expressions} &e &::=& \letexp{x}{a}{e}\alt a \\[.3mm]
\textbf{Values} &v &::=& c\alt\lambda x:t.e\alt (v,v)\\
\end{array}
\end{equation}
TODO: Which restrictions on types? (cannot test a precise arrow type, etc)
\subsection{Declarative type system}
\begin{mathpar}
\Infer[Const]
{ }
{\Gamma\vdash c:\basic{c}}
{ }
\quad
\Infer[Var]
{ }
{ \Gamma \vdash x: \Gamma(x) }
{ x\in\dom\Gamma }
% \qquad
% \Infer[Inter]
% { \Gamma \vdash e:t_1\\\Gamma \vdash e:t_2 }
% { \Gamma \vdash e: t_1 \wedge t_2 }
% { }
\\
\Infer[Proj]
{\Gamma \vdash x:\pair{t_1}{t_2}}
{\Gamma \vdash \pi_i x:t_i}
{ }
\qquad
\Infer[Pair]
{\Gamma \vdash x_1:t_1 \and \Gamma \vdash x_2:t_2}
{\Gamma \vdash (x_1,x_2):\pair {t_1} {t_2}}
{ }
\\
\Infer[App]
{
\Gamma \vdash x_1: \arrow {t_1}{t_2}\quad
\Gamma \vdash x_2: t_1
}
{ \Gamma \vdash {x_1}{x_2}: t_2 }
{ }
\\
\Infer[Case]
{
\Gamma\vdash x:t_\circ\\
\Gamma\subst{x}{t_\circ\land t} \vdash e_1:t'\\
\Gamma\subst{x}{t_\circ\land \neg t} \vdash e_2:t'}
{\Gamma\vdash \tcase {x} t {e_1}{e_2}: t'}
{ }
\\
\Infer[Abs]
{\Gamma,(x:s)\vdash e:t}
{\Gamma\vdash\lambda x:s.e: t}
{ }
\qquad
\Infer[Let]
{\Gamma\vdash a:t_\circ\\
\Gamma,(x:t_\circ)\vdash e:t}
{
\Gamma\vdash\letexp x a e : t
}
{ }
\end{mathpar}
\begin{mathpar}
\Infer[Subs]
{ \Gamma \vdash e:t\\t\leq t' }
{ \Gamma \vdash e: t' }
{ }
\qquad
\Infer[Efq]
{ \exists x\in\dom{\Gamma}.\ \Gamma(x)=\Empty }
{ \Gamma \vdash e: t }
{ }
\\
\Infer[Split]
{
\Gamma, (x:t_1)\vdash e: t\\
\Gamma, (x:t_2)\vdash e: t\\
}
{
\Gamma, (x:t_1\vee t_2)\vdash e: t
}
{ }
\Infer[AbsSplit]
{
\Gamma\vdash \lambda x:s_1.\ e: t_1\\
\Gamma\vdash \lambda x:s_2.\ e: t_2\\
}
{
\Gamma\vdash \lambda x:s_1\vee s_2.\ e: t_1\wedge t_2
}
{ }
\end{mathpar}
TODO: Inter rule needed?
\newpage
\subsection{Algorithmic type system}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment