\documentclass[12pt]{article}
\usepackage{blindtext}
\usepackage{enumerate}
\usepackage{hyperref, bookmark}
\usepackage{amsmath, amsfonts, amssymb, amsthm}
\usepackage{xcolor}

\title{Strong Separation}
% \author{---}
\date{\vspace{-2em}\today{}}

\input{macros}
\renewcommand{\Lam}[2]{\lambda#1.\, \{\!\!\{#2\}\!\!\}}

\begin{document}

\maketitle

\section*{The Calculus}
\subparagraph{Syntax}
\[\begin{array}{lll}
  \tm, \tmtwo & \ddef & \var \mid \tm\,\tmtwo \mid \Lam\var{\tm\Comma\vec\tm} \\
  n & \ddef & \Lam\var{n\Comma\vec n} \mid \var\,\vec n \\
  \\
  C & \ddef & \Box \mid C\,\tm \mid \tm\,C \\
  P & \ddef & \vec\tm \Comma \Box \Comma \vec\tm \mid \vec\tm \Comma C[\Lam\var P] \Comma \vec\tm  \\
\end{array}\]

\subparagraph{Reduction rules}
\[\begin{array}{lll}
  P[C[(\Lam\var{\tm\Comma\vec\tm})\,\tmtwo]] & \Red{}{\var\in \tm,\vec\tm} &
   P[C[\tm\Subst\var\tmtwo]\Comma \vec\tm\Subst\var\tmtwo]\\
   P[C[(\Lam\var{\tm\Comma\vec\tm})\,\tmtwo]] & \Red{}{\var\not\in\tm,\vec\tm} &
    P[C[\tm] \Comma \vec\tm\Comma\tmtwo]\\
\end{array}\]

\subparagraph{Properties}
\begin{itemize}
  \item Every term is normalizing iff it is strongly normalizing.
  \item Ogni strategia e' perpetua!
  \item \ldots
\end{itemize}

\clearpage
\section*{Separation}
\newcommand{\HeadOf}[1]{\operatorname{head}(#1)}
\newcommand{\FstOf}[1]{\operatorname{fst}(#1)}
\newcommand{\DegOf}[1]{\operatorname{deg}(#1)}
\newcommand{\SubtmOf}[2]{#1\preceq #2}
\begin{itemize}
  % \item \textbf{$\boldsymbol\sigma$-separation.}
  %  \textcolor{red}{come definirlo? con le variabili? con i termini?
  %   problematico in cbv}
  %  Two terms are $\sigma$-separable iff there exists a substitution
  %   $\sigma$ such that \textcolor{red}{???}
  % \item \textbf{Semi-$\boldsymbol\sigma$-separation.}
  %  Two terms are semi-$\sigma$-separable iff there exists a substitution
  %   $\sigma$ such that -- in short -- it makes one diverge and the other one converge.
  % \item \textbf{Our subproblem:} Semi-$\sigma$-separating two (usual) $\boldsymbol\lambda$-terms
   % (in deep normal form)
   \item \textbf{Subterm:} $\SubtmOf\tm\tmtwo$ means that $\tm$ is an ($\eta/\Omega$)-subterm of $\tmtwo$.
   \item \textbf{Subterm at position $\boldsymbol\pi$:} TODO
   \item \textbf{Distinction:} Let $\var\defeq \HeadOf D$. Let $T_{\var} \defeq \{\tm \preceq T \mid \HeadOf{\tm} = \var \}$.
  $C_{\var}$ is $D$--\emph{distinct} iff it is empty, or there exists path $\pi$ s.t.:
  \begin{itemize}
    \item \emph{effective} for $D$, cioe' $\FstOf{\pi} \leq \DegOf{D}$;
    \item $\forall \tm\in D_\var$, $\tm_\pi \neq \Omega$;
    \item $\exists \tm\in C_\var$ s.t. $\tm \not\sim_\pi D$;
    \item $\{\tm\in C_\var \mid \tm \sim_\pi D\}$ is $D$--distinct.
  \end{itemize}

 \item $\bullet$ $\bullet$ $\bullet$ $\bullet$ $\bullet$
 $\bullet$ $\bullet$ $\bullet$ $\bullet$ $\bullet$
 $\bullet$ $\bullet$ $\bullet$ $\bullet$ $\bullet$

 \item \textbf{Unlockable variables.}
  We use the following contexts:
  $E ::= \Box \mid E\, t \mid t\, E \mid \Lam\var{\vec t\Comma E \Comma \vec t} $.
 A variable $\var$ is \emph{unlockable} in a context $E$ if:
  \begin{itemize}
    \item it is not bound in $E$, or
    \item $E[\cdot] = E'[\vartwo\, \vec\tm \, (\Lam{\cdots\var\cdots}{\vec\tmtwo \Comma E'[\cdot]\Comma\vec\tmthree})]$
     and $\vartwo$ is unlockable in $E'$.
  \end{itemize}

  Transformation removing an unlockable variable bound at position $\pi$:
  \[\tau_{n::\pi}[\alpha] := \lambda x_1..x_n\,x.\, \alpha\,\vec x\,(\tau_\pi[x])\]

  % \textcolor{red}{For every term there exists an equivalent term with no unlockable variables}

\end{itemize}

% \clearpage
% \section*{NP-hardness}
% \newcommand{\Pacman}{\Omega}
% \newcommand{\sep}{\cdot}
% \begin{example}[Graph 3-coloring]\label{example:3col}
% Let $G=(V,E)$ be a graph, with $N \defeq |V|$.
% We encode the problem of finding a 3-coloring of $G$ in the following problem of semi-$\sigma$-separation:
%  \[\begin{array}{cl}
%  \Uparrow & x \sep t_1^1\,t_1^2\,t_1^3 \sep t_2^1\,t_2^2\,t_2^3 \sep \cdots t_n^1\,t_n^2\,t_n^3 \\
%  \\
%  \Downarrow & x \sep \Pacman\,\Pacman\,\Pacman \sep t_2^1\,t_2^2\,t_2^3 \sep \cdots t_n^1\,t_n^2\,t_n^3 \\
%  \Downarrow & x \sep t_1^1\,t_1^2\,t_1^3 \sep \Pacman\,\Pacman\,\Pacman \sep \cdots t_n^1\,t_n^2\,t_n^3 \\
%  \vdots & \vdots \\
%  \Downarrow & x \sep t_1^1\,t_1^2\,t_1^3 \sep t_2^1\,t_2^2\,t_2^3 \sep \cdots \Pacman\,\Pacman\,\Pacman \\
%  \end{array}\]
%
% Where: $\dummy$ is (probably) a variable, $\bomb\defeq \lambda\_.\,\bot$, and the $a$'s are defined as follows:
%
% \begin{itemize}
%
%  \item $\begin{array}{ll}
%   a_1^1 \defeq & \lambda\_. \, x \sep y\bomb\bomb \sep\bomb\ldots \\
%   a_1^2 \defeq & \lambda\_. \, x \sep \bomb y\bomb \sep\bomb\ldots \\
%   a_1^3 \defeq & \lambda\_. \, x \sep \bomb\bomb y \sep\bomb\ldots \\
%  \end{array}$
%
%  \item $a_2^1 \defeq \begin{cases}
%   \lambda\_.\, x \sep \bomb \dummy\dummy \sep y\bomb\bomb \cdot \bomb\ldots & \text{if } (v_1, v_2)\in E \\
%   \lambda\_.\, x \sep \dummy\dummy\dummy \sep y\bomb\bomb \cdot \bomb\ldots & \text{if } (v_1, v_2)\not\in E \\
%  \end{cases}$
%
%  \item \ldots
%
% \end{itemize}
%
% \begin{definition}[Index notation]
%  Let $t = x \sep x_1^1 x_2^1 x_3^1 \sep x_1^2 x_2^2 x_3^2 \sep \ldots \sep x_1^m x_2^m x_3^m$. Then: \[t[\,_k^j] \defeq x_k^j.\]
%  \end{definition}
%
% Let $z_0$, $z_1$, $z_2$ be variables.
%
% Define:
% \[a_k^j[\,_{k'}^{j'}]\defeq\begin{cases}
%  \bomb & \text{if } j<j' \\
%  \begin{cases}
%   \bomb & \text{if } k\neq k' \\
%   y & \text{if } k = k' \\
%  \end{cases} & \text{if } j = j' \\
%  \begin{cases}
%   \bomb & \text{if } k = k' \\
%   \dummy & \text{if } k \neq k' \\
%  \end{cases} & \text{if } (v_j,v_{j'}) \in E \\
%  \dummy & \text{if } (v_j,v_{j'}) \not\in E
% \end{cases}\]
%
% Attenzione! Le $a$ vanno protette da lambda ($\lambda\_$)!
%
% % Dimensione del problema: circa $(3\times m^2)^2$.
%
% Intuitively, if $\sigma(x)$ ``uses'' $a_j^i$, then $\sigma$ colors $v_j$ with color $i$.
%
% \begin{lemma}[Extraction of the coloring]
%  Let $\sigma$ be a substitution which is a solution for the semi-separation problem. Then for example:
%
% \begin{itemize}
%  \item $\operatorname{color}(v_1) = 2$ iff
%   \[(x \sep \Pacman\,\bomb\,\Pacman \sep \bomb\,\bomb\,\bomb \,\sep \bomb\,\bomb\,\bomb \,\sep \cdots \sep \bomb\,\bomb\,\bomb)\,\sigma \to \bot\]
%  \item $\operatorname{color}(v_2) = 3$ iff:
%   \[(x \sep \dummy\,\dummy\,\dummy \sep \Pacman\,\Pacman\,\bomb \,\sep \bomb\,\bomb\,\bomb \,\sep \cdots \sep \bomb\,\bomb\,\bomb)\,\sigma \to \bot\]
% \end{itemize}
% \end{lemma}
%
% % Where $\Pacman \equiv \lambda\_.\,\Pacman$.
%
% \end{example}

\end{document}
