\section{Classification System}\seclabel{class} \index{classification} A \emph{classification} is a user-defined abstraction that describes (``classifies'') arbitrary data. Classifications can be used as predicates, generating functions, and can be composed into more complex classifications. Nearly all conditions in \tame{} are specified using classifications. \index{first-order logic!sentence} \index{classification!coupling} All classifications represent \emph{first-order sentences}---% that is, they contain no \emph{free variables}. Intuitively, this means that all variables within a~classification are \emph{tightly coupled} to the classification itself. This limitation is mitigated through use of the template system. \todo{$\Classify$ itself has not yet been defined.} \index{classification!conjunctive} \begin{definition}[\logand-Classification]\dfnlabel{classu} A conjunctive\footnote{% Conjunctive and disjunctive classifications used to be referred to, respectively, as \emph{universal} and \emph{existential}, referring to fact that $\forall\Set{a_0,\ldots,a_n}(a) \equiv a_0\logand\ldots\logand a_n$, and similarly for $\exists$. This terminology has changed since all classifications are in fact existential over their matches' index sets, and so the terminology would otherwise lead to confusion. } classification~$c$ performs conjunction on its match expressions $M_0\ldots M_n$. \begin{align*} &\xml{} \\ &\quad M_0 \\ &\quad \vdots \\ &\quad M_n \\ &\xml{} \equiv \Classify^c_\gamma M_0 \logand \ldots \logand M_n. \end{align*} \end{definition} \index{classification!disjunctive} \begin{definition}[\logor-Classification]\dfnlabel{classe} A disjunctive classification~$d$ with \xpath{@any="true"} performs disjunction on its match expressions $M_0\ldots M_n$.\footnote{% It is notationally convenient that~$c$ is a common prefix for both \underline{c}lassification \emph{and} \underline{c}onjunction, and also that~$d$ happens to follow~$c$ \emph{and} be the prefix for \underline{d}isjunction. This notation will only be used where such a distinction is relevant, and $c$~will otherwise refer generically to any type of classification.} \begin{align*} &\xml{} \\ &\quad M_0 \\ &\quad \vdots \\ &\quad M_n \\ &\texttt{} \equiv \Classify^d_\gamma M_0 \logor \ldots \logor M_n. \end{align*} \end{definition} \mremark{Note that these illustrate \emph{scalar} values only.} For example, consider the following classification $\Classify^\texttt{cost-exceeded}$. Let~\tameparam{cost} be a scalar parameter. \index{classification!classify@\xmlnode{classify}} \begin{lstlisting} \end{lstlisting} \noindent is then equivalent to the proposition \begin{equation*} \tameclass{cost-exceeded} \equiv \tameparam{cost} > 100.00. \end{equation*} \index{classification!domain} A classification is either \true or~\false. Let $\tameparam{cost}=150.00$. Then, \begin{align*} \tameclass{cost-exceeded} & \equiv \tameparam{cost} > 100.00 \\ & \equiv 150.00 > 100.00 \\ & \equiv \true. \end{align*} Each \xmlnode{match} of a classification is a~\emph{predicate}. Multiple predicates are by default joined by conjunction: \begin{lstlisting} \end{lstlisting} \noindent is equivalent to the proposition \begin{equation*} \tameclass{pool-hazard} \equiv \tameparam{diving\_board} \logand \tameparam{pool\_depth\_ft} < 8. \end{equation*} \subsection{Matches} \todo{Non-scalar values.} \begin{definition}[Match Equality] \begin{equation*} \xml{} \equiv x = y. \end{equation*} \end{definition} \begin{definition}[Match Equality Short Form] \begin{equation*} \xml{} \equiv \xml{}. \end{equation*} \end{definition} \begin{definition}[Match Equality Long Form] \begin{alignat*}{2} \xml{} &\equiv {}&&\xml{} \\ & &&\quad \xml{} \\ & &&\quad\quad \xml{} \\ & &&\quad \xml{} \\ & &&\xml{} \\ &\equiv {}&&\xml{}. \end{alignat*} \end{definition} \begin{definition}[Match Membership Equivalence] When $T$ is a type defined with \xmlnode{typedef}, \begin{equation*} \xml{} \equiv x \in T. \end{equation*} \end{definition}