\documentclass[a4paper,english]{article}
\usepackage{tgtermes}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{hyperref}
\usepackage{amssymb}
\usepackage[cm]{fullpage}
\usepackage{babel}

\newcommand{\universe}{\mathcal{P}}
\newcommand{\closure}{\mathcal{C}}
\newcommand{\installation}{\mathcal{I}}
\newcommand{\removed}{\mathcal{R}}
\newcommand{\optimization}{\mathcal{O}}
\newcommand{\name}{\mathrm{name}}
\newcommand{\version}{\mathrm{version}}
\newcommand{\conflicts}{\mathrm{conflicts}}
\newcommand{\recommends}{\mathrm{recommends}}
\newcommand{\depends}{\mathrm{depends}}
\newcommand{\reason}{\mathrm{reason}}
\newcommand{\eval}{\mathrm{eval}}
\newcommand{\funsatrecom}{\mathrm{unsat\_recommends}}
\newcommand{\fcount}{\mathrm{count}}
\newcommand{\fsum}{\mathrm{sum}}
\newcommand{\faligned}{\mathrm{aligned}}
\newcommand{\fnotuptodate}{\mathrm{notuptodate}}
\newcommand{\selmax}{S^\infty}
\newcommand{\reasonmax}[1]{S^+(#1)}
\newcommand{\reasonmin}[1]{S^-(#1)}
\newcommand{\attr}[1]{\mathit{#1}}
\newcommand{\ssolution}{\mathrm{solution}}
\newcommand{\schanged}{\mathrm{changed}}
\newcommand{\snew}{\mathrm{new}}
\newcommand{\sremoved}{\mathrm{removed}}
\newcommand{\selup}{\mathrm{up}}
\newcommand{\sdown}{\mathrm{down}}
\newcommand{\sinstallrequest}{\mathrm{installrequest}}
\newcommand{\supgraderequest}{\mathrm{upgraderequest}}
\newcommand{\srequest}{\mathrm{request}}

\begin{document}

\section{Preliminaries}

\begin{itemize}
  \item See: \url{http://www.mancoosi.org/misc-2012/criteria/}
  \item Package universe: $\universe$ 
  \item Installation: $\installation\subseteq\universe$
  \item Closure: $\closure\subseteq\universe$
  \item Removed (by explicit request): $\removed\subseteq\universe$
  \item Optimization criteria: $\optimization$
  \item Names: $X.\name=\{p.\name\mid p\in X\}$
  \item Versions: $X.\version(p)=\{q.\version\mid q\in X,p.\name=q.\name\}$
\end{itemize}

\section{Closure}

\begin{itemize}
  \item Table \ref{tab:selectors} lists available selectors
    \begin{itemize}
      \item $\selmax$ is an upper bound for packages in a selector
      \item $\reasonmin{q}$ for $q\in\selmax$ is the set of packages whose installation might remove $q$ from the selector
      \item $\reasonmax{q}$ for $q\in\selmax$ is the set of packages whose installation might add $q$ to the selector
    \end{itemize}
  \item a package $p \in \universe \setminus \removed$ is relevant if at least one of the following conditions holds
    \begin{itemize}
      \item $+f \in \optimization$ where
        \begin{itemize}
          \item $f = \fcount(S)$, $q \in \selmax$, and $p \in \reasonmax{q}$,
          \item $f = \fsum(S,\attr{attr})$, $q \in \selmax$, $q.\attr{attr} > 0$, and $p \in \reasonmax{q}$,
          \item $f = \fsum(S,\attr{attr})$, $q \in \selmax$, $q.\attr{attr} < 0$, and $p \in \reasonmin{q}$,
          \item $f = \fnotuptodate(S)$, $q \in \selmax$, $q.\version \neq \max(\universe.\version(q))$, and $p \in \reasonmax{q}$,
          \item $f = \funsatrecom(S)$, $q \in \selmax$, $q.\recommends \neq \emptyset$, and $p \in \reasonmax{q}$, or
          \item $f = \faligned(S,\attr{group},\attr{value}))$, $q\in \selmax$, $q' \in \selmax$, $q.\attr{group} = q'.\attr{group}$, $q.\attr{value} \neq q'.\attr{value}$, and $p \in \reasonmax{q}$\\
        \end{itemize}
      \item $-f \in \optimization$ where
        \begin{itemize}
          \item $f = \fcount(S)$, $q \in \selmax$, and $p \in \reasonmin{q}$,
          \item $f = \fsum(S,\attr{attr})$, $q \in \selmax$, $q.\attr{attr} > 0$, and $p \in \reasonmin{q}$,
          \item $f = \fsum(S,\attr{attr})$, $q \in \selmax$, $q.\attr{attr} < 0$, and $p \in \reasonmax{q}$,
          \item $f = \fnotuptodate(S)$, $q \in \selmax$, $q.\version \neq \max(\universe.\version(q))$, and $p \in \reasonmin{q}$,
          \item $f = \funsatrecom(S)$, $q \in \selmax$, $q.\recommends \neq \emptyset$, and $p \in \reasonmin{q}$,
          \item $f = \funsatrecom(S)$, $q \in \selmax$ and $p \in q.\recommends\setminus\removed$, or
          \item $f = \faligned(S,\attr{group},\attr{value}))$, $q\in \selmax$, $q' \in \selmax$, $q.\attr{group} = q'.\attr{group}$, $q.\attr{value} \neq q'.\attr{value}$, and $p \in \reasonmin{q}$\\
        \end{itemize}
    \end{itemize}
  \item the closure $\closure$ is the least set that
    \begin{itemize}
      \item contains all relevant packages, and
      \item if $p\in \closure$ then $p.\depends\setminus\removed\subseteq\closure$
    \end{itemize}
\end{itemize}

\begin{table}
  \scriptsize
  \centering{}\begin{tabular}{r|l|l|l}
    selector $S$       & $\selmax$ & $\reasonmin{q}$ & $\reasonmax{q}$ \\
    \hline 
    $\ssolution$       & $\universe\setminus\removed$ & $\emptyset$ & $\{q\}$ \\
    $\schanged$        & $\universe\setminus\removed\cup\installation$ & $\{q\}\cap\installation\setminus\removed$ & $\{q\}\setminus\installation$ \\
    $\snew$            & $\{p\in \universe\setminus\removed\mid p.\name\notin \installation.\name\}$ & $\emptyset$ & $\{q\}$ \\
    $\sremoved$        & $\installation$ & $\{p\in\universe\setminus\removed\mid p.\name = q.\name\}$ & $\emptyset$ \\
    $\selup$           & $\{p\in \universe\setminus\removed\mid p.\name\in \installation.\name,p.\version>\max(\installation.\version(p))\}$ & $\emptyset$ & $\{q\}$ \\
    $\sdown$           & $\{p\in \universe\setminus\removed\mid p.\name\in \installation.\name,p.\version<\max(\installation.\version(p))\}$ & $\emptyset$ & $\{q\}$ \\
    $\sinstallrequest$ & $\{ p \in P\setminus\removed \mid q \mbox{ mentioned in install request } p.\name = q.\name \}$ & $\emptyset$ & $\{q\}$ \\
    $\supgraderequest$ & $\{ p \in P\setminus\removed \mid q \mbox{ mentioned in upgrade request } p.\name = q.\name \}$ & $\emptyset$ & $\{q\}$  \\
    $\srequest$        & $\sinstallrequest^\infty \cup \supgraderequest^\infty$ & $\emptyset$ & $\{q\}$ \\
  \end{tabular}\caption{Selectors\label{tab:selectors}}
\end{table}

\section{Fact Format}

\begin{itemize}
  \item \texttt{unit($p.\name$,$p.\version$,in).} for $p\in\closure$
  \item \texttt{unit($p.\name$,$p.\version$,out).} for $p\in\removed$
  \item \texttt{installed($p.\name$,$p.\version$).} for $p\in\universe$
  \item \texttt{maxversion($p.\name$,$p.\version$).} for $p\in\universe$ and $p.\version=\max(\universe.\version(p))$
  \item \texttt{satisfies(Name,Version,Condition).} for $p\in\closure$
    \begin{itemize}
      \item applies to various parts of the CUDF-document
        \begin{itemize}
          \item dependencies
          \item conflicts
          \item requests
          \item recommendations
          \item keep flags
        \end{itemize}
    \end{itemize}
  \item \texttt{depends($p.\name$,$p.\version$,Condition).} for $p\in\closure$
  \item \texttt{conflict($p.\name$,$p.\version$,Condition).} for $p\in\closure$
  \item \texttt{recommends($p.\name$,$p.\version$,Condition,Weight).}
    \begin{itemize}
      \item $\pm f\in\optimization$, $f=\funsatrecom(S)$, and $p\in\selmax$
    \end{itemize}
  \item \texttt{request(Condition).}
    \begin{itemize}
      \item requests
      \item keep flags
    \end{itemize}
  \item \texttt{attribute($p.\name$,$p.\version$,Attribute,Value).}
    \begin{itemize}
      \item $\pm f\in\optimization$, $f=\fsum(S,\attr{attr})$, and $p\in\selmax$, or
      \item $\pm f\in\optimization$, $f=\faligned(S,\attr{group},\attr{value})$, and $p\in\selmax$, or
    \end{itemize}
  \item \texttt{installrequest(Name,Version).}
  \item \texttt{upgraderequest(Name,Version).}
  \item 
    \texttt{clique($I$,$p.\name$,$p.\version)$} where $p\in I$ and $I$ is a non-singular clique in the graph\\
    $(\closure, \{ (p,q) \mid p,q\in\closure, p\neq q, q\in p.\conflicts \})$
    \begin{itemize}
      \item no overlapping cliques will be added
    \end{itemize}
  \item \texttt{criterion(Maximize,Selector,$\fcount$,Priority).}
  \item \texttt{criterion(Maximize,Selector,$\fsum(\attr{attr})$,Priority).}
  \item \texttt{criterion(Maximize,Selector,$\fnotuptodate$, Priority).}
  \item \texttt{criterion(Maximize,Selector,$\funsatrecom$,Priority).}
  \item \texttt{criterion(Maximize,Selector,$\faligned(\attr{group},\attr{value})$,Priority).}
\end{itemize}

\end{document}
