Commit 6f988c52 authored by Mickael Laurent's avatar Mickael Laurent
Browse files

candidate generation rules

parent aad136ff
......@@ -99,6 +99,80 @@ TODO: Algorithmic rules
\subsection{Candidates generation rules}
{ \Gamma \vdash y \triangleright_x \varnothing }
{ \Gamma \vdash c \triangleright_x \varnothing }
{\Gamma,(y:s)\vdash e\triangleright_x\dt}
\Gamma\vdash\lambda y:s.\ e\triangleright_x\dt
{x\neq y}
{\Gamma \vdash a_1\triangleright_x\dt_1 \and \Gamma \vdash a_2\triangleright_x\dt_2}
{\Gamma \vdash (a_1,a_2)\triangleright_x\dt_1\cup\dt_2}
{\Gamma \vdash a\triangleright_x\dt}
{\Gamma \vdash \pi_i a\triangleright_x\dt}
{\Gamma\subst{y}{\Gamma(y)\land t}\vdash e_1\triangleright_x\dt_1\\
\Gamma\subst{y}{\Gamma(y)\land \neg t}\vdash e_2\triangleright_x\dt_2}
{\Gamma\vdash \tcase{y}{t}{e_1}{e_2}\triangleright_x\dt_1\cup\dt_2\cup
\{\Gamma(x)\land t,\Gamma(x)\land\neg t\} \text{ if } y=x\arcr
\varnothing\text{ otherwise}
\Gamma \vdash a_1 : \textstyle{\bigvee \bigwedge_{i \in I}s_i\to t_i}\\
\Gamma \vdash a_1\triangleright_x\dt_1\\
\forall i\in I.\ \Gamma\fvdash{a_2}{s_i}\{\Gamma_i^j\}_{j\in J_i}
{ \Gamma \vdash a_1 a_2\triangleright_x\dt_1\cup\textstyle{\bigcup_{i\in I}
\bigcup_{j\in J_i}\{\Gamma_i^j(x)\}} }
\Gamma \vdash p: t\\
\Gamma, (y:t) \vdash e\triangleright_x\dt_x\\
\Gamma, (y:t) \vdash e\triangleright_y\dt_y\\
\forall u\in \dt_y.\ \Gamma\fvdash{p}{u}\{\Gamma_u^i\}_{i\in I_u}
{ \Gamma \vdash\letexp{y}{p}{e}\triangleright_x\dt_x\cup\textstyle{
\bigcup_{u\in \dt_y}\bigcup_{i\in I_u}\{\Gamma_u^i(x)\}
TODO: example: application $x y$ with $x$ an union of arrow. Candidates
of a variable with a function type should be all the union of arrows of its type?\\
More generally, a variable that can be written only has an union should be splitted
along this union. Otherwise, $\letexp{x}{\cdots}{x}$ will never be splitted. Or better:
there should be a special split that means "all splits" (it will also be useful when
we will add polymorphism).
TODO: test type system with $\lambda x:\pair{\Int}{\Int}\lor\pair{\Bool}{\Bool}. (\pi_1 x, \pi_2 x)$
\subsection{Forward refinement rules}
\subsection{Backward refinement rules}
......@@ -286,4 +286,8 @@
\ No newline at end of file
\makeatletter % allow us to mention @-commands
\ No newline at end of file
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