% $Id: 4ab38b73d20edef7032a785ba8fc6325fc362bd8 $

\section{SAT Solving Modulo Tableau and Rewriting Theories}
\label{sec:smt}

In this section, we recall the classic architecture of SMT solvers and we then
introduce the tableau and rewriting theories.

Compared to genuine tableau automated theorem provers, like \princess{} or
\zenon{} for example, our approach has the benefit of being versatile since the
tableau rules are actually integrated as a regular SMT theory. This way, the
tableau rules can be easily combined with other theories, such as equality logic
with uninterpreted functions or arithmetic. The way we integrate the tableau
rules into the SAT solver (mainly by boxing/unboxing first order formulas) is
close to what is done in the \satallax{} tool~\cite{CEB12}. The difference
resides in the fact that we are in a pure first order framework, which has
significant consequences in the management of quantifiers and unification in
particular (see Sec.~\ref{sec:super}).

Regarding the integration of rewriting, automated theorem provers rely on
several solutions (superposition rule for first order provers, triggers for SMT
solvers, etc.). But deduction modulo theory~\cite{DA03} is probably the most
general approach, where a theory can be partly turned in to a set of rewrite
rules over both terms and propositions. Several proof search methods have been
extended to deduction modulo theory, resulting in tools such as \iproverm{} and
\zenm{}. This paper can be seen as a continuation of these previous experiments
adapted to the framework of SMT solving.

\subsection{SAT Solving Modulo Theories}

In this subsection, we recall the classic architecture of SMT
solvers~\cite{BEA06}. We introduce $\mathcal{T}$ and $\mathcal{F}$ respectively
the sets of first order terms and formulas over the signature
$\mathcal{S}=(\mathcal{S}_\mathcal{F},\mathcal{S}_\mathcal{P})$, where
$\mathcal{S}_\mathcal{F}$ is the set of function symbols, and
$\mathcal{S}_\mathcal{P}$, the set of predicate symbols, such that
$\mathcal{S}_\mathcal{F}\cap\mathcal{S}_\mathcal{P}=\emptyset$. The set
$\mathcal{T}$ is extended with two kinds of terms specific to tableau proof
search, i.e. $\epsilon{}$-terms (used instead of Skolemization) of the form
$\epsilon(x).P(x)$, where $P(x)$ is a formula, and which means some $x$ that
satisfies $P(x)$, if it exists, and metavariables (often named free variables in
the tableau-related literature) of the form $X_P$, where $P$ is the formula that
introduces the metavariable, and which is either $\forall{}x.Q(x)$ or
$\neg\exists{}x.Q(x)$, with $Q(x)$ a formula.

A boxed formula is of the form $\lfloor{}P\rfloor$, where $P$ is a formula. A
boxed formula is called atom, and a literal is either an atom, or the negation
of an atom. A literal is such that there is no negation on top of the boxed
formula (which means that $\lfloor\neg{}P\rfloor=\neg\lfloor{}P\rfloor$, and
$\neg\neg\lfloor{}P\rfloor=\lfloor{}P\rfloor$). A clause is a disjunction of
literals. It should be noted that SAT solving usually reasons over sets of
clauses composed of first order literals; here, a literal is a first order
formula (possibly with quantifiers), which requires to box formulas to get a
regular SAT solving problem where boxed formulas are propositional variables.

An assignment of the boxed formulas is a partial function that assigns to boxed
formulas an element of $\{\top,\bot\}$ (values of the Boolean algebra). Given a
clause $C$, we say that $C$ is valid and write $\models{}C$, if $C$ evaluates to
$\top$ for every assignment. Given a set of clauses $S$, we say that $S$ is
valid and write $\models{}S$, if each clause of $S$ is valid. Given two sets of
clauses $S$ and $S'$, we say that $S$ implies $S'$ and write $S\models{}S'$ if,
for every assignment, if each clause of $S$ evaluates to $\top$ then each clause
of $S'$ evaluates to $\top$. If $S$ is a set of literals, then we say that $S$
is a model of $S'$.

A theory $T$ is a set of formulas over a given signature $\mathcal{S}$, which
are called axioms of the theory $T$. A clause $C$ is a tautology in the theory
$T$, written $\models_TC$, if the axioms of $T$ imply the formula $C'$, where
$C'$ is the clause $C$ where all the boxed formulas have been unboxed. A set of
clauses $S$ is a tautology in the theory $T$ if each clause of $S$ is a
tautology in $T$. Given two sets of clauses $M$ and $S$, we say that $M$ is a
model of $S$ modulo the theory $T$ and write $M\models_TS$, if $M$ is a model of
$S$ and $M$ is a tautology in $T$.

A SAT solver modulo theories is characterized by a set of theories $S_T$ and an
internal state of the form $M\parallel{}S$, where $M$ is an ordered list of
literals (if $M=l_1,l2,\ldots,l_n$ then $l_1<l_2<\ldots<l_n$) and $S$ a set of
clauses. Intuitively, $M$ represents the model of $S$, which will be built
progressively (initially, we have $M=\emptyset$) by the application of a set of
rules over the internal state of the solver. This set of rules is presented in
Fig.~\ref{fig:smt}. Each time a literal is propagated (rule
``$\mathrm{unit~prop}$'') or decided (rule ``$\mathrm{decide}$''), it is given
to each theory, which may generate new clauses (rule ``$\mathrm{learn}$''). If a
clause is unvalidated by the model, then it is possible to backtrack the
decision over a given literal of the model if it exists (rule
``$\mathrm{backjump}$''). There are two final states in this transition
system. The first one is ``$\mathrm{unsat}$'', which means that $S$ is
unsatisfiable (rule ``$\mathrm{unsat}$''). The second one is $M\parallel{}S$,
where $M$ is a model of $S$ and a tautology for every theory in $S_T$. In this
last case, if $M$ is not a tautology in a theory $T$, this theory generates a
set of conflict clauses (rule ``$\mathrm{learn}$'').

\begin{figure}[t]
\parbox{\textwidth}
{\small
\begin{center}
$\begin{array}{l@{\hspace{0.4cm}}l@{\hspace{0.4cm}}l}
M\parallel{}S,C\lor{}l\longrightarrow{}M,l\parallel{}S,C\lor{}l &
(\mathrm{unit~prop}) & \mbox{if }l\not\in{}M\mbox{ and }M\models{}\neg{}C\\\\

M\parallel{}S\longrightarrow{}M,l^\mathrm{d}\parallel{}S & (\mathrm{decide}) &
\mbox{if }l\not\in{}M\mbox{, and }l\in{}S\mbox{ or }\neg{}l\in{}S\\\\

M\parallel{}S,C\longrightarrow\mathrm{unsat} & (\mathrm{unsat}) &
\mbox{if }M'\models{}\neg{}C\mbox{ s.t. }M'\subseteq{}M\\
&& \mbox{and there is no }l^\mathrm{d}\leq{}l'\mbox{ in }M\\
&& \mbox{for all }l'\in{}M'\\\\

M,l^\mathrm{d},M'\parallel{}S,C\longrightarrow{}M,l'\parallel{}S,C &
(\mathrm{backjump}) & \mbox{if }M,l^\mathrm{d},M'\models\neg{}C
\mbox{, and there is}\\
&& \mbox{some clause }C'\lor{}l' s.t.:\\
&& l'\not\in{}M\mbox{, and }l'\in{}S\mbox{ or }\neg{}l'\in{}S\\
&& \mbox{or }l'\in{}M,l^\mathrm{d},M'\mbox{ or }
\neg{}l'\in{}M,l^\mathrm{d},M',\\
&& \mbox{and }S,C\models{}C'\lor{}l'\mbox{, and }M\models\neg{}C'\\\\

M\parallel{}S\longrightarrow{}M\parallel{}S,S'
& (\mathrm{learn}) & \models_TS'\mbox{, where }T\mbox{ is a theory}
\end{array}$
\end{center}}
\caption{Rules of SAT Solving Modulo Theory}
\label{fig:smt}
\end{figure}

\subsection{The Tableau Theory}

In the SAT solver previously described, the tableau proof search method is
integrated as a regular theory. When a literal is propagated or decided, we
generate a set of clauses corresponding to the application of a tableau rule
over the logical connective at root of the formula in the box of the
literal. More precisely, for a literal $l$, we generate the set of clauses
$\llbracket{}l\rrbracket$, where the function $\llbracket\cdot\rrbracket$ is
described by the rules of Fig.~\ref{fig:tabth}. When a literal is propagated or
decided, we use all the rules of Fig.~\ref{fig:tabth} except the instantiation
$\gamma$-rules (rules $\gamma_{\forall\mathrm{inst}}$ and
$\gamma_{\neg\exists\mathrm{inst}}$). It should be noted that we use the same
names for the rules than in tableau calculus ($\alpha$-rules, $\beta$-rules,
etc.), but there is no precedence between rules and therefore no priority in the
application of the rules contrary to the tableau proof search method (where
$\alpha$ rules are applied before $\beta$-rules, and so on).

When the SAT solver reaches a state $M\parallel{}S$, where $M$ is a model of
$S$, we look for a conflict in $M$ between two literals by unification and we
generate the clauses corresponding to the instantiation of the metavariables
using the result of the unification. More precisely, if there exist two literals
$l$ and $\neg{}l'$ in $M$ such that $l=\lfloor{}Q\rfloor$ and
$l'=\lfloor{}R\rfloor$, with $Q$ and $R$ two formulas, then for each
substitution $(X_{\forall{}x.P(x)}\mapsto{}t)\in\mathrm{mgu}(Q,R)$ (resp.
$(X_{\neg\exists{}x.P(x)}\mapsto{}t)\in\mathrm{mgu}(Q,R)$) such that there is no
$Y_T\in\forall{}x.P(x)$ (resp. $Y_T\in\neg\exists{}x.P(x)$), we can generate the
clauses $\llbracket\lfloor\forall{}x.P(x)\rfloor{}\rrbracket$
(resp. $\llbracket\neg\lfloor\exists{}x.P(x)\rfloor{}\rrbracket$) using the rule
$\gamma_{\forall\mathrm{inst}}$ (resp. $\gamma_{\neg\exists\mathrm{inst}}$) of
Fig.~\ref{fig:tabth}.

\begin{figure}[t]
\parbox{\textwidth}
{\small
\underline{Analytic Rules}
\begin{center}
$\begin{array}{lll@{\hspace{0.5cm}}l}
\llbracket\lfloor{}P\land{}Q\rfloor{}\rrbracket & = &
\neg\lfloor{}P\land{}Q\rfloor\lor\lfloor{}P\rfloor,
\neg\lfloor{}P\land{}Q\rfloor\lor\lfloor{}Q\rfloor & (\alpha_\land)\\\\

\llbracket\neg\lfloor{}P\land{}Q\rfloor{}\rrbracket & = &
\lfloor{}P\land{}Q\rfloor\lor\neg\lfloor{}P\rfloor\lor\neg\lfloor{}Q\rfloor &
(\beta_{\neg\land})\\\\

\llbracket{}\lfloor{}P\lor{}Q\rfloor{}\rrbracket & = &
\neg\lfloor{}P\lor{}Q\rfloor\lor\lfloor{}P\rfloor\lor\lfloor{}Q\rfloor &
(\beta_\lor)\\\\

\llbracket\neg\lfloor{}P\lor{}Q\rfloor{}\rrbracket & = &
\lfloor{}P\lor{}Q\rfloor\lor\neg\lfloor{}P\rfloor,
\lfloor{}P\lor{}Q\rfloor\lor\neg\lfloor{}Q\rfloor &
(\alpha_{\neg\lor})\\\\

\llbracket{}\lfloor{}P\Rightarrow{}Q\rfloor{}\rrbracket & = &
\neg\lfloor{}P\Rightarrow{}Q\rfloor\lor\neg\lfloor{}P\rfloor\lor
\lfloor{}Q\rfloor & (\beta_\Rightarrow)\\\\

\llbracket\neg\lfloor{}P\Rightarrow{}Q\rfloor{}\rrbracket & = &
\lfloor{}P\Rightarrow{}Q\rfloor\lor\lfloor{}P\rfloor,
\lfloor{}P\Rightarrow{}Q\rfloor\lor\neg\lfloor{}Q\rfloor &
(\alpha_{\neg\Rightarrow})\\\\

\llbracket{}\lfloor{}P\Leftrightarrow{}Q\rfloor{}\rrbracket & = &
\neg\lfloor{}P\Leftrightarrow{}Q\rfloor\lor\lfloor{}P\Rightarrow{}Q\rfloor,
\neg\lfloor{}P\Leftrightarrow{}Q\rfloor\lor\lfloor{}Q\Rightarrow{}P\rfloor &
(\beta_\Rightarrow)\\\\

\llbracket{}\neg\lfloor{}P\Leftrightarrow{}Q\rfloor{}\rrbracket &
= &
\lfloor{}P\Leftrightarrow{}Q\rfloor\lor\neg\lfloor{}P\Rightarrow{}Q\rfloor\lor
\neg\lfloor{}Q\Rightarrow{}P\rfloor & (\beta_{\neg\Rightarrow})
\end{array}$
\end{center}

\underline{$\delta$-Rules}
\begin{center}
$\begin{array}{lll@{\hspace{0.5cm}}l}
\llbracket\lfloor\exists{}x.P(x)\rfloor{}\rrbracket & = &
\neg{}\lfloor\exists{}x.P(x)\rfloor\lor\lfloor{}P(\epsilon(x).P(x))\rfloor &
(\delta_\exists)\\\\

\llbracket\neg\lfloor\forall{}x.P(x)\rfloor{}\rrbracket & = &
\lfloor\forall{}x.P(x)\rfloor\lor\neg\lfloor{}P(\epsilon(x).\neg{}P(x))\rfloor &
(\delta_{\neg\forall})
\end{array}$
\end{center}

\underline{$\gamma$-Rules}
\begin{center}
$\begin{array}{lll@{\hspace{0.5cm}}l}
\llbracket\lfloor\forall{}x.P(x)\rfloor{}\rrbracket & = &
\neg\lfloor\forall{}x.P(x)\rfloor\lor\lfloor{}P(X_{\forall{}x.P(x)})\rfloor &
(\gamma_{\forall{}M})\\\\

\llbracket\neg\lfloor\exists{}x.P(x)\rfloor{}\rrbracket & = &
\lfloor\exists{}x.P(x)\rfloor\lor
\neg\lfloor{}P(X_{\neg\exists{}x.P(x)})\rfloor &
(\gamma_{\neg\exists{}M})\\\\

\llbracket\lfloor\forall{}x.P(x)\rfloor{}\rrbracket & = &
\neg\lfloor\forall{}x.P(x)\rfloor\lor\lfloor{}P(t)\rfloor &
(\gamma_{\forall\mathrm{inst}})\\\\

\llbracket\neg\lfloor\exists{}x.P(x)\rfloor{}\rrbracket & = &
\lfloor\exists{}x.P(x)\rfloor\lor\neg\lfloor{}P(t)\rfloor &
(\gamma_{\neg\exists\mathrm{inst}})
\end{array}$
\end{center}}
\caption{Rules of Tableau Theory}
\label{fig:tabth}
\end{figure}

To show how this theory works, let us prove that
$\exists{}x.P(x)\Rightarrow{}P(a)\land{}P(b)$, where $P$ is a predicate symbol
and $a,b$ two constants. The SAT solver is initiated with the state
$\emptyset\parallel
\neg\lfloor\exists{}x.P(x)\Rightarrow{}P(a)\land{}P(b)\rfloor$, and the proof is
described in Fig.~\ref{fig:tab}, where $X$ is a shortcut for
$X_{\neg\exists{}x.P(x)\Rightarrow{}P(a)\land{}P(b)}$. It should be noted that
to do this proof in sequent calculus, a right contraction is necessary to
instantiate the formula twice (with $a$ and $b$). In Fig.~\ref{fig:tab}, it is
done by propagating the literal $\lfloor{}P(X)\rfloor{}$, which can provide as
many instantiations (by unification) as necessary.

\begin{figure}[t!]
\parbox{\textwidth}
{\small
\begin{center}
$\begin{array}{lcl}
\emptyset\parallel\neg{}A & \longrightarrow & (\mathrm{unit~prop})\\

\boldsymbol{\neg{}A}\parallel{}\neg{}A & \longrightarrow & (\mathrm{learn})\\

\neg{}A\parallel\neg{}A,\boldsymbol{A\lor\neg{}B} & \longrightarrow &
(\mathrm{unit~prop})\\

\neg{}A,\boldsymbol{\neg{}B}\parallel\neg{}A,A\lor\neg{}B & \longrightarrow &
(\mathrm{learn})\\

\neg{}A,\neg{}B\parallel\neg{}A,A\lor\neg{}B,\boldsymbol{B\lor{}C},
\boldsymbol{B\lor\neg{}D} & \longrightarrow & (\mathrm{unit~prop})\times{}2\\

\neg{}A,\neg{}B,\boldsymbol{C},\boldsymbol{\neg{}D}\parallel\neg{}A,
A\lor\neg{}B,B\lor{}C,B\lor\neg{}D & \longrightarrow & (\mathrm{learn})\\

\neg{}A,\neg{}B,C,\neg{}D\parallel\neg{}A,A\lor\neg{}B,B\lor{}C,B\lor\neg{}D,\\
~~~~\boldsymbol{D\lor\neg{}E\lor\neg{}F} & \longrightarrow & (\mathrm{decide})\\

\neg{}A,\neg{}B,C,\neg{}D,\boldsymbol{\neg{}E^d}\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C, & \longrightarrow &
(\mathrm{learn})\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F && \{X\mapsto{}a\}=\mathrm{mgu}(C,E)\\

\neg{}A,\neg{}B,C,\neg{}D,\neg{}E^d\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,\boldsymbol{A\lor\neg{}G} &
\longrightarrow & (\mathrm{unit~prop})\\

\neg{}A,\neg{}B,C,\neg{}D,\neg{}E^d,\boldsymbol{\neg{}G}\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G & \longrightarrow &
(\mathrm{learn})\\

\neg{}A,\neg{}B,C,\neg{}D,\neg{}E^d,\neg{}G\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G,\boldsymbol{G\lor{}E},
\boldsymbol{G\lor\neg{}D} & \longrightarrow & (\mathrm{backjump})\\

\neg{}A,\neg{}B,C,\neg{}D,\boldsymbol{E}\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G,G\lor{}E,G\lor\neg{}D &
\longrightarrow & (\mathrm{unit~prop})\times{}2\\

\neg{}A,\neg{}B,C,\neg{}D,E,\boldsymbol{\neg{}F},\boldsymbol{\neg{}G}\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C, & \longrightarrow & (\mathrm{learn})\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G,G\lor{}E,G\lor\neg{}D &&
\{X\mapsto{}b\}=\mathrm{mgu}(C,F)\\

\neg{}A,\neg{}B,C,\neg{}D,E,\neg{}F,\neg{}G\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G,G\lor{}E,G\lor\neg{}D\\
~~~~\boldsymbol{A\lor\neg{}H} & \longrightarrow & (\mathrm{unit~prop})\\

\neg{}A,\neg{}B,C,\neg{}D,E,\neg{}F,\neg{}G,\boldsymbol{\neg{}H}\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G,G\lor{}E,G\lor\neg{}D\\
~~~~A\lor\neg{}H & \longrightarrow & (\mathrm{learn})\\

\neg{}A,\neg{}B,C,\neg{}D,E,\neg{}F,\neg{}G,\neg{}H\parallel
\neg{}A,A\lor\neg{}B,B\lor{}C,\\
~~~~B\lor\neg{}D,D\lor\neg{}E\lor\neg{}F,A\lor\neg{}G,G\lor{}E,G\lor\neg{}D\\
~~~~A\lor\neg{}H,\boldsymbol{H\lor{}F},\boldsymbol{H\lor{}\neg{}D} &
\longrightarrow & (\mathrm{unsat})\\

\mathrm{unsat}
\end{array}$
\end{center}
\begin{flushleft}
$\begin{array}{l}
\mbox{where:}\\
\begin{array}{ll}
~~~~A\equiv\lfloor\exists{}x.P(x)\Rightarrow{}P(a)\land{}P(b)\rfloor &
~~~~B\equiv\lfloor{}P(X)\Rightarrow{}P(a)\land{}P(b)\rfloor\\
~~~~C\equiv\lfloor{}P(X)\rfloor{} &
~~~~D\equiv\lfloor{}P(a)\land{}P(b)\rfloor{}\\
~~~~E\equiv\lfloor{}P(a)\rfloor &
~~~~F\equiv\lfloor{}P(b)\rfloor\\
~~~~G\equiv{}\lfloor{}P(a)\Rightarrow{}P(a)\land{}P(b)\rfloor &
~~~~H\equiv{}\lfloor{}P(b)\Rightarrow{}P(a)\land{}P(b)\rfloor
\end{array}
\end{array}$
\end{flushleft}}
\caption{Example of Proof Using the Tableau Theory}
\label{fig:tab}
\end{figure}

\subsection{The Rewriting Theory}
\label{sec:rew}

A rewriting theory allows us to introduce a computational behavior to the SAT
solver. We aim to integrate rewriting in the broadest sense of the term as
proposed by deduction modulo theory. Deduction modulo theory~\cite{DA03} focuses
on the computational part of a theory, where axioms are transformed into rewrite
rules, which induces a congruence over propositions, and where reasoning is
performed modulo this congruence. In deduction modulo theory, this congruence is
then induced by a set of rewrite rules over both terms and propositions.

In the following, we borrow some of the notations and definitions
of~\cite{DA03}. We call $\mathrm{FV}$ the function that returns the set of
free variables of a term or a formula. A term rewrite rule is a pair of terms
denoted by $l\rew{}r$, where $\mathrm{FV}(r)\subseteq\mathrm{FV}(l)$. A
proposition rewrite rule is a pair of propositions denoted by $l\rew{}r$, where
$l$ is an atomic proposition and $r$ is an arbitrary proposition, and where
$\mathrm{FV}(r)\subseteq\mathrm{FV}(l)$. A class rewrite system is a pair of
rewrite systems, denoted by $\mathcal{RE}$, consisting of $\mathcal{R}$, a set
of proposition rewrite rules, and $\mathcal{E}$, a set of term rewrite rules.

Given a class rewrite system $\mathcal{RE}$, the relations $=_\mathcal{E}$ and
$=_\mathcal{RE}$ are the congruences generated respectively by the sets
$\mathcal{E}$ and $\mathcal{R}\cup\mathcal{E}$. In the following, we use the
standard concepts of subterm and term replacement: given an occurrence $\omega$
in a proposition $P$, we write $P_{|\omega}$ for the term or proposition at
$\omega$, and $P[t]_\omega$ for the proposition obtained by replacing
$P_{|\omega}$ by $t$ in $P$ at $\omega$. Given a class rewrite system
$\mathcal{RE}$, the proposition $P$ $\mathcal{RE}$-rewrites to $P'$, denoted by
$P\rew_\mathcal{RE}P'$, if $P=_\mathcal{E}Q$, $Q_{|\omega}=\sigma(l)$, and
$P'=_\mathcal{E}Q[\sigma(r)]_\omega$, for some rule $l\rew{}r\in\mathcal{R}$,
some proposition $Q$, some occurrence $\omega$ in $Q$, and some substitution
$\sigma$.

The relation $=_\mathcal{RE}$ is not decidable in general, but there are some
cases where this relation is decidable depending on the class rewrite system
$\mathcal{RE}$ and the rewrite relation $\rew_\mathcal{RE}$. In particular, if
the rewrite relation $\rew_\mathcal{RE}$ is confluent and (weakly) terminating,
then the relation $=_\mathcal{RE}$ is decidable.

The rewriting theory is integrated into the SAT solver in a similar way than for
the tableau theory. When a literal is propagated or decided, we generate a
clause introducing a new formula that is congruent to the formula in the box of
the literal. More precisely, given a literal $\lfloor{}P\rfloor$, where $P$ is a
formula, and a formula $P'$ such that $P=_\mathcal{RE}P'$, we generate the
following clause:

$$\left(\bigvee_{(l,r)\in\mathcal{R}}
\neg\lfloor\forall{}\vec{x}.l\Leftrightarrow{}r\rfloor\right)\lor
\left(\bigvee_{(l,r)\in\mathcal{E}}\neg\lfloor\forall{}\vec{x}.l=r\rfloor\right)\lor
\lfloor{}P\Leftrightarrow{}P'\rfloor$$

where $\vec{x}=\mathrm{FV}(l)\cup\mathrm{FV}(r)$.

It should be noted that in usual SMT solvers, rewriting can be emulated by means
of triggers that are actually the left-hand side members of the class rewrite
system $\mathcal{RE}$ introduced above. But in our rewriting theory, we can
generate the formula where rewritings have been done, while triggers can just
generate bindings, i.e. instances of the rewrite rules, which are used later to
relate the initial and rewritten formulas. Moreover, in our case, we can perform
several rewritings at once, while a trigger can only emulate one rewriting at a
time.

Let us illustrate the use of the rewriting theory by means of an example in set
theory. Let us prove that
$(\forall{}s,t.s\subseteq{}t\Leftrightarrow{}\forall{}x.x\in{}s\Rightarrow{}
x\in{}t)\Rightarrow{}a\subseteq{}a$, where $a$ is a constant. The proof is given
by Fig.~\ref{fig:rew}, where the rules ``$\mathrm{learn~tab}$'' and
``$\mathrm{learn~rew}$'' represent the rule ``$\mathrm{learn}$'' using
respectively the tableau and rewriting theories.

\begin{figure}[t!]
\parbox{\textwidth}
{\small
\begin{center}
$\begin{array}{lcl}
\emptyset\parallel
\neg{}A & \longrightarrow & (\mathrm{unit~prop})\\

\boldsymbol{\neg{}A}\parallel{}\neg{}A & \longrightarrow &
(\mathrm{learn~tab})\\

\neg{}A\parallel
\neg{}A,\boldsymbol{A\lor{}B},\boldsymbol{A\lor\neg{}C} & \longrightarrow &
(\mathrm{unit~prop})\times{}2\\

\neg{}A,\boldsymbol{B},\boldsymbol{\neg{}C}\parallel
\neg{}A,A\lor{}B,A\lor\neg{}C & \longrightarrow & (\mathrm{learn~rew})\\

\neg{}A,B,\neg{}C\parallel\neg{}A,A\lor{}B,A\lor\neg{}C,
\boldsymbol{\neg{}B\lor{}D} & \longrightarrow & (\mathrm{unit~prop})\\

\neg{}A,B,\neg{}C,\boldsymbol{D}\parallel\neg{}A,A\lor{}B,A\lor\neg{}C,
\neg{}B\lor{}D & \longrightarrow & (\mathrm{learn~tab})\\

\neg{}A,B,\neg{}C,D\parallel\neg{}A,A\lor{}B,A\lor\neg{}C,\neg{}B\lor{}D,
\boldsymbol{\neg{}D\lor{}E},\boldsymbol{\neg{}D\lor{}F} & \longrightarrow &
(\mathrm{unit~prop})\times{}2\\

\neg{}A,B,\neg{}C,D,\boldsymbol{E},\boldsymbol{F}\parallel
\neg{}A,A\lor{}B,A\lor\neg{}C,\neg{}B\lor{}D,\neg{}D\lor{}E,\\
~~~~\neg{}D\lor{}F & \longrightarrow & (\mathrm{learn~tab})\\

\neg{}A,B,\neg{}C,D,E,F\parallel\neg{}A,A\lor{}B,A\lor\neg{}C,\neg{}B\lor{}D,
\neg{}D\lor{}E\\
~~~~\neg{}D\lor{}F,\boldsymbol{\neg{}F\lor\neg{}G\lor{}C} & \longrightarrow &
(\mathrm{unit~prop})\\

\neg{}A,B,\neg{}C,D,E,F,\boldsymbol{\neg{}G}\parallel\neg{}A,A\lor{}B,
A\lor\neg{}C,\neg{}B\lor{}D,\neg{}D\lor{}E\\
~~~~\neg{}D\lor{}F,\neg{}F\lor\neg{}G\lor{}C & \longrightarrow &
(\mathrm{learn~tab})\\

\neg{}A,B,\neg{}C,D,E,F,\neg{}G\parallel\neg{}A,A\lor{}B,A\lor\neg{}C,
\neg{}B\lor{}D,\neg{}D\lor{}E\\
~~~~\neg{}D\lor{}F,\neg{}F\lor\neg{}G\lor{}C,\boldsymbol{G\lor\neg{}H} &
\longrightarrow & (\mathrm{unit~prop})\\

\neg{}A,B,\neg{}C,D,E,F,\neg{}G,\boldsymbol{\neg{}H}\parallel\neg{}A,A\lor{}B,
A\lor\neg{}C,\neg{}B\lor{}D\\
~~~~\neg{}D\lor{}E,\neg{}D\lor{}F,\neg{}F\lor\neg{}G\lor{}C,
G\lor\neg{}H & \longrightarrow & (\mathrm{learn~tab})\\

\neg{}A,B,\neg{}C,D,E,F,\neg{}G,\neg{}H\parallel\neg{}A,A\lor{}B,A\lor\neg{}C,
\neg{}B\lor{}D\\
~~~~\neg{}D\lor{}E,\neg{}D\lor{}F,\neg{}F\lor\neg{}G\lor{}C,
G\lor\neg{}H,\boldsymbol{H\lor{}I},\boldsymbol{H\lor\neg{}I} & \longrightarrow &
(\mathrm{unit~prop})\\

\neg{}A,B,\neg{}C,D,E,F,\neg{}G,\neg{}H,\boldsymbol{I}\parallel\neg{}A,A\lor{}B,
A\lor\neg{}C,\neg{}B\lor{}D\\
~~~~\neg{}D\lor{}E,\neg{}D\lor{}F,\neg{}F\lor\neg{}G\lor{}C,
G\lor\neg{}H,H\lor{}I,H\lor\neg{}I & \longrightarrow & (\mathrm{unsat})\\

\mathrm{unsat}
\end{array}$
\end{center}
\begin{flushleft}
$\begin{array}{l}
\mbox{where:}\\
\begin{array}{ll}
\multicolumn{2}{l}{
~~~~A\equiv\lfloor(\forall{}s,t.s\subseteq{}t\Leftrightarrow{}
\forall{}x.x\in{}s\Rightarrow{}x\in{}t)\Rightarrow{}a\subseteq{}a\rfloor}\\
~~~~B\equiv\lfloor\forall{}s,t.s\subseteq{}t\Leftrightarrow{}
\forall{}x.x\in{}s\Rightarrow{}x\in{}t\rfloor &
~~~~C\equiv\lfloor{}a\subseteq{}a\rfloor\\
~~~~D\equiv\lfloor{}a\subseteq{}a\Leftrightarrow
\forall{}x.x\in{}a\Rightarrow{}x\in{}a\rfloor &
~~~~E\equiv\lfloor{}a\subseteq{}a\Rightarrow
\forall{}.x\in{}a\Rightarrow{}x\in{}a\rfloor\\
~~~~F\equiv\lfloor(\forall{}.x\in{}a\Rightarrow{}x\in{}a)
\Rightarrow{}a\subseteq{}a\rfloor &
~~~~G\equiv\lfloor\forall{}.x\in{}a\Rightarrow{}x\in{}a\rfloor\\
~~~~H\equiv\lfloor\epsilon_x\in{}a\Rightarrow\epsilon_x\in{}a\rfloor &
~~~~I\equiv\lfloor\epsilon_x\in{}a\rfloor
\end{array}\\\\
\mbox{with: }\epsilon_x=\epsilon(x).\neg(x\in{}a\Rightarrow{}x\in{}a)
\end{array}$
\end{flushleft}}
\caption{Example of Proof Using the Rewriting Theory}
\label{fig:rew}
\end{figure}


\section{Notations}
\begin{table}[H]
  \centering
  \caption{Important Notations.}
  \label{Notation}
  \begin{tabular*}{\hsize}{@{\extracolsep{\fill}}clc}
    \toprule
    Symbol & Description & Unit \\
    \midrule
    $S_{cylinder}$ & side surface area of cylinder & $m^2$ \\
    $\bm{E}$ & electric field intensity on the surface of uniformly charged cylinder & $N/C$ \\
    $\Phi$ & electric flux & $N\cdot m^2/C$ \\
    $DR$ & decomposition rate & Unitless \\
    $\alpha$ & fungi linear density & Unitless \\
    $\varepsilon_{DR}$ & environmental decomposition constant & Unitless \\
    $ACT$ & fungal activity factor & Unitless \\
    $\beta$ & fungi areal density & Unitless \\
    $HER$ & hyphal extension rate & $mm/day$ \\
    $RMT$ & relative moisture tolerance & Unitless \\
    $R^2$ & sample correlation coefficient & Unitless \\
    $N(t)$ & current population size & Unitless \\
    $RGB$ & relative growth blocking index & Unitless \\
    $X$ & time series data & Unitless \\
    \bottomrule
  \end{tabular*}
\end{table}


\documentclass{article}
\pagestyle{empty}
\textwidth155mm
\oddsidemargin2.1mm
\topmargin-8mm
\textheight225mm

\def\rgtbox#1#2{\phantom{#1}\hbox to0pt{\hss#2}}
\def\lftbox#1#2{\hbox to0pt{#2\hss}\phantom{#1}}

\begin{document}

\subsection*{The Apriori Algorithm for Finding Association Rules}

\vskip5mm
\begin{tabbing}
00 \= 00 \= 00 \= 00 \= \hskip60mm \= \kill
{\bf function} apriori $(I, T, s_{\min}, c_{\min}, k_{\max})$
   \>\>\>\>\> $(*$ apriori algorithm for association rules $*)$ \\
{\bf begin} \\
\> $\lftbox{C_k}{$k$} := 1$;
   \>\>\>\> $(*$ --- find frequent item sets $*)$ \\
\> $C_k := \bigcup_{i \in I} \{i\};$
   \>\>\>\> $(*$ start with single element sets $*)$ \\
\> $\lftbox{C_k}{$F_k$} := \mbox{prune}(C_k, T, s_{\min})$;
   \>\>\>\> $(*$ and determine the frequent ones $*)$ \\
\> {\bf while} $F_k \neq \emptyset$
   {\bf and}   $k \le k_{\max}$ {\bf do begin}
   \>\>\>\>   $(*$ while there are frequent item sets $*)$ \\
\> \> $C_{k+1} := \mbox{candidates}(F_k)$;
   \>\>\>     $(*$ create item sets with one item more $*)$ \\
\> \> $\lftbox{C_{k+1}}{$F_{k+1}$}
               := \mbox{prune}(C_{k+1}, T, s_{\min})$;
   \>\>\>     $(*$ and determine the frequent ones $*)$ \\
\> \> $\lftbox{C_{k+1}}{$k$} := k+1$;
   \>\>\>     $(*$ increment the item counter $*)$ \\
\> {\bf end}; \\
\> $R := \emptyset$;
   \>\>\>\>   $(*$ --- generate association rules $*)$ \\
\> {\bf forall} $f \in \bigcup_{j=2}^k F_j$ {\bf do begin}
   \>\>\>\>   $(*$ traverse the frequent item sets $*)$ \\
\> \> $\lftbox{H_m}{$m$} := 1$;
   \>\>\>     $(*$ start with rule heads (consequents) $*)$ \\
\> \> $H_m := \bigcup_{i \in f} \{i\}$;
   \>\>\>     $(*$ that contain only one item $*)$ \\
\> \> {\bf repeat}
   \>\>\>     $(*$ traverse rule heads of increasing size $*)$ \\
\> \> \> {\bf forall} $h \in H_m$ {\bf do}
   \>\>       $(*$ traverse the possible rule heads $*)$ \\
\> \> \> \> {\bf if} $\frac{s(f)}{s(f-h)} \ge c_{\min}$
   \>         $(*$ if the confidence of the rule $*)$ \\
\> \> \> \> {\bf then} $\lftbox{H_m}{$R$}
                       := R \cup \{ [(f-h) \to h] \}$;
   \>         $(*$ is high enough, add it to the result, $*)$ \\
\> \> \> \> \lftbox{\bf then}{\bf else} $H_m := H_m - \{h\}$;
   \>         $(*$ otherwise discard the rule head $*)$ \\
\> \> \> $H_{m+1} := \mbox{candidates}(H_m)$;
   \>\>       $(*$ create rule heads with one item more $*)$ \\
\> \> \> $\lftbox{H_{m+1}}{$m$} := m+1$;
   \>\>       $(*$ increment the head item counter $*)$ \\
\> \> {\bf until} $H_m = \emptyset$ {\bf or} $m \ge |f|$;
   \>\>\>     $(*$ until there are no more rule heads $*)$ \\
\> {\bf end};
   \>\>\>\>   $(*$ or the antecedent would become empty $*)$ \\
\> {\bf return} $R$;
   \>\>\>\>   $(*$ return the rules found $*)$ \\
{\bf end} $(*$ apriori $*)$ \\
\\
{\bf function} candidates $(F_k)$
   \>\>\>\>\> $(*$ generate candidates with $k+1$ items $*)$\\
{\bf begin} \\
\> $C := \emptyset$;
   \>\>\>\>   $(*$ initialize the set of candidates $*)$ \\
\> {\bf forall} $f_1, f_2 \in F_k$
   \>\>\>\>   $(*$ traverse all pairs of frequent item sets $*)$ \\
\> \lftbox{\bf forall}{\bf with} $f_1 = \{i_1,\ldots,i_{k-1},i_k\}$
   \>\>\>\>   $(*$ that differ only in one item and $*)$ \\
\> \lftbox{\bf forall}{\bf and}  $f_2 = \{i_1,\ldots,i_{k-1},i_k'\}$
   \>\>\>\>   $(*$ are in a lexicographic order $*)$ \\
\> \lftbox{\bf forall}{\bf and}  $i_k < i_k'$ {\bf do begin}
   \>\>\>\>   $(*$ (the order is arbitrary, but fixed) $*)$ \\
\> \> $f := f_1 \cup f_2 = \{i_1,\ldots,i_{k-1},i_k,i_k'\}$;
   \>\>\>     $(*$ the union of these sets has $k+1$ items $*)$ \\
\> \> {\bf if} $\;\forall i \in f:\; f -\{i\} \in F_k$
   \>\>\>     $(*$ only if all $k$ element subsets are frequent, $*)$ \\
\> \> {\bf then} $C := C \cup \{f\}$;
   \>\>\>     $(*$ add the new item set to the candidates $*)$ \\
\> {\bf end};
   \>\>\>\>   $(*$ (otherwise it cannot be frequent) $*)$ \\
\> {\bf return} $C$;
   \>\>\>\>   $(*$ return the generated candidates $*)$ \\
{\bf end} $(*$ candidates $*)$ \\
\\
{\bf function} prune $(C, T, s_{\min})$
   \>\>\>\>\> $(*$ prune infrequent candidates $*)$ \\
{\bf begin} \\
\> {\bf forall} $c \in C$ {\bf do}
   \>\>\>\>   $(*$ initialize the support counters $*)$ \\
\> \> $s(c) := 0$;
   \>\>\>     $(*$ of all candidates to be checked $*)$ \\
\> {\bf forall} $t \in T$ {\bf do}
   \>\>\>\>   $(*$ traverse the transactions $*)$ \\
\> \> {\bf forall} $c \in C$ {\bf do}
   \>\>\>     $(*$ traverse the candidates $*)$ \\
\> \> \> {\bf if} $c \in t$
   \>\>       $(*$ if the transaction contains the candidate, $*)$ \\
\> \> \> {\bf then} $s(c) := s(c) +1$;
   \>\>       $(*$ increment the support counter $*)$ \\
{\bf end} $(*$ prune $*)$
\end{tabbing}

\end{document}


\documentclass{article}

\usepackage[top=.75in, bottom=.75in]{geometry}

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{xcolor}

\begin{document}

\newcommand{\tda}[1]{\textcolor{red}{#1}}
\newcommand{\tdb}[1]{\textcolor{orange}{#1}}
\newcommand{\tdc}[1]{\textcolor{blue}{#1}}
\newcommand{\unk}[1]{\textcolor{red}{#1}}
\newcommand{\der}[1]{\textcolor{orange}{#1}}
\newcommand{\off}[2]{\textnormal{\emph{Off}}_{#1\rightarrow#2}}

\section*{Setup:} Assume 3 polypoint tags (A, B, C), all 1~m from each other.

\begin{itemize}
  \item $t_A$ = tx delay for tag A (unknown)
  \item $r_A$ = rx delay for tag A (unknown)
  \item $\lambda$ = time of flight for 1~m ($\lambda = \frac{1}{c}\times\textnormal{\texttt{DWT\_TIME\_UNITS}}$)
  \item $\epsilon$ = precise delay before sending the next packet (i.e.\ 5\,ms)
\end{itemize}

The goal is to determine the calibration factor for a tag, $cal_A = t_A + r_A$.

\section*{Protocol:}

The following sequence will recover the $cal_C$. Note that timestamps from
local clocks are not synchronized, nor can the clocks be assumed to be running
at exactly the same speed.

\bigskip

\noindent
\begin{minipage}{.35\textwidth}
  \begin{enumerate}
    \item Tag A sends a packet
    \item Tag C sends a packet after $\epsilon$
    \item Tag C sends a packet after $\epsilon$
  \end{enumerate}
\end{minipage}%
~~~~~%
\begin{minipage}{.65\textwidth}
  \includegraphics[width=\linewidth]{calibration_diagram}
\end{minipage}

\begin{align}
  BRX1 &= ATX1 + t_A + \lambda + r_B \\
  BRX2 &= ATX1 + t_A + \lambda + r_C + \epsilon_C + t_C + \lambda + r_B \\
  BRX2-BRX1 = \Delta_B &= r_C + t_C + \epsilon_C + \lambda \\
  ~\nonumber\\
  k_{C\rightarrow B} &= \frac{BRX3-BRX2}{CTX3-CTX2} \\
  ~\nonumber\\
  r_C + t_C &= \Delta_B - \epsilon_C \times k_{C\rightarrow B} - \lambda
\end{align}

\end{document}


\chapter{Conclusions}\label{ch6}
\setlength{\epigraphrule}{0pt}
\setlength{\epigraphwidth}{0.75\textwidth}
\epigraph{\textit{The true delight is in the finding out rather than in the knowing.}}{Isaac Asimov}

In this work we have introduced the \acrlong{v2dm} to solve the many-body problem.
The \acrfull{2dm} contains all necessary information to describe such a system, and the expectation value of one- or two-particle operators
can be expressed as a linear function of the \gls{2dm}.
Unlike the more conventional quantum mechanical methods, the wave function is never used. This method itself has a long history and attracted quite some attention in the second half of
the previous century. At first glance, it has many interesting properties: the \gls{2dm} has a much better scaling than the wave function,
and the method is strictly variational. Unlike wavefunction-based methods, it produces a strict lower bound on the energy (instead of an
upper bound).
Unfortunately, the complexity of the many-body problem has not disappeared, but is shifted to the $N$-representability problem: what are the
necessary and sufficient conditions for a \gls{2dm} to be derivable from an ensemble of many-fermion wave functions?
In the 1960's, there was still hope that this problem could be solved in some way, but time has learned that it is a very hard problem (see
later).

% vim: spell spelllang=en syntax=tex tw=140


\chapter{Characterization of the grating testing setup}

\section{Monochromator}

%Cartoon of overall layout
\begin{figure}
\begin{center}
    \includegraphics[width=0.48\textwidth]{question_mark.ps}
  \end{center}
  \caption[DK480 monochromator layout]{Spectral products' DK480 monochromator layout.  The monochromator is an SP DK480 with selectable 300 g/mm and 150 g/mm gratings on the grating assembly.  Table 1 summarizes the expected properties of the monochromator.  The image is from \url{http://www.spectralproducts.com}.}
\end{figure}

First, let's work out the expected resolution of the monochromator.  The monochromator has 2 gratings, one with a blaze peak at 2.0 $\mu$m and one with a blaze peak at 4.0 $\mu$m.  For the purposes of this document we will concern ourselves with the 2.0 $\mu$m blazed grating because this one is in the $1.5 < \lambda/\mu\rm{m} <\;2.5$ range of the IGRINS instrument.  The monochromator table summarizes the properties of these gratings.  There we see that the 2 $\mu$m grating is 300 grooves/mm, or $\sigma$=3.3 $\mu$m.  The grating has a blaze angle of 17.5$^\circ$, operates in first order, and has $\beta \sim 8^\circ$ so $\cos{\beta} \sim 1$.  From classical diffraction grating theory (Schroeder 2000) we can calculate the angular dispersion, and then calculate the linear dispersion at the exit slit with the monochromator focal length (480 mm):
\begin{eqnarray}
  \frac{d\beta}{d\lambda}&=& \frac{m}{\sigma \cos{\beta}}      \nonumber \\
  \frac{dx}{d\lambda}&=& \frac{d\beta}{d\lambda} \times f = \frac{f}{\sigma}  \nonumber\\
  	&\sim& 480 / (3.3 \times 10^{-3}) \sim 1.5 \times 10^{5}
\end{eqnarray}
For example, a 1 mm slit will cover approximately 7 nm of spectral bandwidth, and the entire visible portion of the spectrum $(\Delta \lambda = 300 \;\rm{nm})$ should cover about 4 cm at the focal plane, which is consistent with visual inspection.  The minimum slitwidth of 10 $\mu$m should provide a resolution of 0.07 nm, which is equivalent to a resolution $R=\frac{\lambda}{\delta \lambda}=30,000$.  However, diffraction and optical aberrations limit the resolution to $R<30,000$.  Specifically, the resolution for a given number $N$ of illuminated grooves in order $m$ is given by $R=mN$, with the number of illuminated grooves given by $N=W/\sigma$, where $W=68$ mm is the width of the grating in the DK480.  $R=20,000$, which is the same as saying $\delta x = \lambda/W \times f \sim 14\;\mu$m for $\lambda=2\;\mu$m.  This spot size is comparable to the minimum slitwidth, and so this spot size and grating limited resolution is convolved with the slit function.  To take all these contributions into account, we add the $\delta \lambda$'s in quadrature:
\begin{eqnarray}
	 \delta \lambda_{net}^2 &=& \delta \lambda_{disp}^2 + \delta \lambda_{grat}^2
\end{eqnarray}

In any case, the delivered resolution will be somewhat less than the predicted resolution due to optical aberrations.  The delivered resolution was measured with a HeNe laser at the factory, and is listed in the table.  For the 10 $\mu$m slit the average delivered resolution is 0.25 nm or $R=2500$.  The figure below shows the expected and delivered resolution as a function of slit width.  In the next section on the camera and detector system, we study how the finite angular resolution of the camera system provides a related limitation to our spectral resolution.

%Table of monochromator properties
\input{gta_CA1_tab_SP_monch.tex}

%Efficiency as a function of wavelength for the 300 g/mm grating
\begin{figure}
\begin{center}
    \includegraphics[width=0.8\textwidth]{question_mark.ps}
  \end{center}
  \caption[Absolute efficiency of the 300 g/mm grating in the DK480 monochromator]{Absolute efficiency of the 300 g/mm grating in the DK480 monochromator.  The light intensity delivered to the optic is the product of the efficiencies of the light source spectral energy distribution, the filter curves, the gratings in the monochromator, the post slit lenses and mirrors, and the detector efficiency.}
\end{figure}

\begin{figure}
\begin{center}
    \includegraphics[width=0.8\textwidth]{question_mark.ps}
  \end{center}
  \caption[Absolute efficiency of the 300 g/mm grating in the DK480 monochromator, part II. ]{Absolute efficiency of the 300 g/mm grating in the DK480 monochromator over the wavelength range 0.5 to 2.5 $\mu$m.}
\end{figure}

\begin{figure}
  \centering
  \subfloat[Visible lamp]{\label{fig:vis_curve}\includegraphics[width=0.5\textwidth]{GTA_eff_vis_clear_2um_PbS}}
  \subfloat[NIR lamp]{\label{fig:nir_curve}\includegraphics[width=0.5\textwidth]{GTA_eff_nir_clear_2um_PbS}}
  \caption[Predicted relative spectral efficiency of experimental setup- visible and near-IR]{Expected relative efficiency for the specified combination of monochromator light source, monochromator grating, and detector.  We assume no filter is in the beam path.  The relative efficiency is roughly what we've seen from experiments.  The left plot demonstrates the visible lamp light source which has a color temperature of 3100 K, the right plot demonstrates the near-IR light source which has a color temperature of 950$^\circ$ C.  The visible light source lamp was used in experiments 8 and 9, and the NIR lamp was used primarily in more recent experiments.  Experiments employing the visible light source will demonstrate order-overlap since there is quite a bit of blue second order light overlapping.  We do not know if the PbS detector is sensitive below 1.0 $\mu$m.  It's important to note that these are (predicted) relative efficiencies, not absolute efficiencies.  The visible lamp may be brighter at any given near-IR wavelength, depending on its power, and coupling to the entrance slit.  This plot is merely to inform the design of experiments, and over what wavelength ranges we can expect to achieve relatively high signal to noise.  It looks like 1.5 to 2.5 $\mu$m has relatively smoothly variable signal in both scenarios.}
  \label{fig:GTA_layout}
\end{figure}

\subsection{Filterwheel and filters}
The filter wheel is the AB300-T from Spectral Products.  The AB300-T is connected to the DK480 monochromator by a serial cable, and can be commanded through the DK480's connection to the computer.  The AB300-T has five slots sized for 1 inch filters.  Commercially available 1-inch filters generally are unthreaded and need to be secured with a 1-inch retaining ring such as Thorlabs part number SM1RR, and then tightened or loosened with a pin spanner wrench like Thorlabs part number SPW602.  On November 15, 2011 I identified that the filter wheel was unresponsive to the DK480 commands issued from the computer.  I  contacted Spectral Products to troubleshoot the issue.  I will send the filter wheel back to Spectral Products.

%Table of filter wheel slots
\input{gta_CA1_tab_filters.tex}

%Efficiency as a function of wavelength for the AB Filters
\begin{figure}
    \includegraphics[width=1.0\textwidth]{question_mark.ps}
  \caption[Spectral products filter curves]{Filter curves for the AB series filters provided by Spectral Products.  We have two low pass filters from Spectral products- AB3190, AB3300. The filter curve for AB3300 is not shown, and was not included in their supplied filter curves data.  The online table indicates that AB3300 is a low pass filter with transition wavelength of 3000 nm, with a transition tolerance of 50nm.  We also have a Melles Griot 10 nm FWHM interference filter.  See the table on filter properties.  It is important to use order blocking filters because second order light could overlap and mimic ghost orders, or throw off the calibration with reference mirrors.  Since we want to measure efficiencies at the few percent levels, we probably should use order blocking filters unless it is demonstrated the order overlap is negligible.}
\end{figure}

%Efficiency as a function of wavelength for the AB Filters
\begin{figure}
    \includegraphics[width=0.9\textwidth]{exp48_49}
  \caption[FEL1450 LP filter]{The need for order blocking filters.  The left panel shows the raw data with and without the FEL1450 LP filter.  The light blue and purple curves are scans of an Al mirror with the visible light source before and after the green curve scan, which is a scan of the identical system, but with an FEL1450 Thorlabs low-pass filter placed directly behind the post-slit collimating lens (optic number 10 in the diagram of our optical bench configuration).  In subsequent trials employing the FEL1450 filter we placed the filter on an easily removable flip mount post at position 11, which is roughly the position of the image of the grating since it is almost one focal length behind the post-slit lens.  The FEL1450 has an cut-on wavelength of 1450 nm.  The primary purpose of this filter is to block second order light from the bright visible lamp from blanketing the first order infrared light.  The presence of this pernicious second order visible light is clear in the figure on the right, in which the efficiency approaches 100\% at 2900 nm, which is where second order 1450 nm light will cut on.  The blue curve on the right panel is the ratio of the green and light blue curves on the right, so with and without the FEL1450 filter.  The solid red curve is the manufacturer-provided specification data for the cut-on filter efficiency in the range $1400 < \lambda(\mathrm{nm}) < 1650 $.  The dotted red curve is the extrapolation of that curve from the manufacturer claim that the the minimum peak efficiency is 70\% through 2200 nm.  It is not clear how the filter performs after this wavelength.  It is also surprising that the observed flux ratio just after the cut-on wavelength at 1500$-$1700 nm exceeds the manufacturer provided efficiency data.  Either our filter is out-performing the specification or there is additional second order light falling at 1500 nm, which would be coming from 750 nm.  The filter properties at that short of a wavelength are not known, but this scenario is unlikely anyways since the detector and grating are inefficient at these wavelengths.}
\end{figure}

\section{Camera System and Differential lens/detector motion}
\subsection{Angular resolution of the camera system}
It is important to understand the camera system's angular resolution, because our system must be able to separate adjacent diffraction orders of the diffraction gratings we seek to measure.  The pixel sizes for our detectors are listed in the table detailing detector properties in the appendix.  We have two camera lenses- with focal lengths of 110 mm and 200 mm.  Note that examination of the pixel is deceiving because the active detecting area is actually much smaller than the entire surface area of the metallic surface seen in visual inspection.  The next figure demonstrates the sub-area which is active.  Experiments 26, 27, 28, 31, and 32 probed the demonstrated slit image width.  We were surprised to find that experiments 26, 27 and 28 demonstrated a big dip in the center of the convolved intensity profile.

One cause of angular resolution loss and a potential cause of systematic error is the differential camera lens and detector motion.  In our design the camera lens and detector system share a common axis which pivots about the axis rotation, which through the immersion grating.  The next figure shows a cartoon of the geometry of the differential lens and detector motion.

\begin{figure}
  \centering
  \subfloat[Dispersion relation]{\includegraphics[width=0.5\textwidth]{question_mark.ps}}
  \subfloat[160 $\mu$m slit with CA1a, 2D profile]{\includegraphics[width=0.5\textwidth]{question_mark.ps}} \\
    \subfloat[160 $\mu$m slit with Al mirror]{\includegraphics[width=0.5\textwidth]{question_mark.ps}}
      \subfloat[160 $\mu$m slit with CA1a, 1D profile]{\includegraphics[width=0.5\textwidth]{question_mark.ps}}
  \caption[Dispersion for $f$=200 mm camera]{Dispersion for the $f$=200 mm camera, as measured by the $\alpha$NIR focal plane array.  The $\alpha$NIR detector has small (39 $\mu$m) pixels and does not require detector motion, so these values are accurate unconvolved profiles of the dispersion relation.  The light blue solid line in the upper left panel is the expected behavior for perfect imaging optics- the imaged width would be about twice the slit width, assuming a 2:1 camera to collimator focal length ratio.}
\end{figure}

\begin{figure}
\begin{center}
    \includegraphics[width=0.8\textwidth]{question_mark.ps}
  \end{center}
  \caption[Differential camera motion]{Cartoon of the camera's differential motion}
\end{figure}

We can work out the amplitude of the differential camera motion in the following way.  First, notice in the previous figure in the first and third panel that beams diffracted from the grating at an angle $\theta_{d} = \theta_{a}$ from the optical axis are centered on the detector and so centroids of diffracted beams are undeviated.  The apparent angular widths are deviated by a factor involving the geometric values of the system.  Specifically, we are interested in case 2 in the figure, in which $\theta_{d} \ne \theta_{a}$.  In this case the focused spot position is one focal length behind the lens, parallel to the incoming beam.

\begin{eqnarray}
	%x_{lens}&=&L \cos{\theta_a} \nonumber \\
	y_{lens}&=&L \sin{\theta_a} \nonumber \\
	x_{spot}&\sim&(L+f_c)\cos{\theta_a}  \nonumber \\
	y_{spot}&=&y_{lens} \nonumber \\
	\tan{\theta_d} &=& \frac{y_{spot}}{x_{spot}} \sim \frac{L \sin{\theta_a}}{ (L+f_c)\cos{\theta_a}}  \nonumber
\end{eqnarray}

What we really want is $d\theta_d/d\theta_a$:

\begin{eqnarray}
	\frac{d}{d\theta_a} \tan{\theta_d} &=& \frac{d}{d\theta_a} \frac{1}{1+\frac{f_c}{L}} \tan{\theta_a} \nonumber \\
	\frac{d\theta_d}{d\theta_a} &=& k  \nonumber \\
	\mathrm{with \;}k=\frac{1}{1+\frac{f_c}{L}}  \nonumber
\end{eqnarray}

What is it we are actually measuring?  The output signal, which we will call $h(\theta)$, from the detector is the convolution of many angular and spectral functions:
\begin{description}
\item[$s(\theta)$]	The exit slit function. Set by the slit width, a negligibly weak function of $\lambda$.
\item[$b(\theta)$]	The blur spot of the optics. Principally from intentional defocusing at the detector plane.
\item[$g(\theta, \lambda)$]	The grating dispersion function.  This is a function of wavelength and angle.
\item[$p(\theta)$]	The pixel response function.  Looks like a tophat, but can have sub-pixel efficiency variations.
\end{description}

In principle, everything is a weak function of wavelength, for example the blur spot will change as a function of wavelength through chromatic aberrations.  We ignore these negligible wavelength dependent effects, except for the the grating which disperses the finite bandwidth beam into an angular spread (see previous figures).  For the purposes of figuring out the effect of the differential camera motion, will group $s$, $b$, and $g$, and any other heretofore unaccounted for (albeit negligible) angular and spectral functions, into a single delivered focal plane intensity profile, $f(\theta, \lambda)=g \convolution b \convolution s$.  First, let's consider the case in which the beam is monochromatic, so that $g(\theta, \lambda)=g(\theta)\delta(\lambda)$.  Let us further compare two different cases of angular motion.  In case 1 the beam and lens are stationary and only the detector moves steadily through the focal plane, pivoting about the axis of rotation centered on the immersion grating.  In case 2 both the lens and detector move along the same rigid arm, so that the image spot and detector are moving, albeit at different angular rates.  Let $\tau=\theta_a$ represent the angular position of the swing arm holding the detector for case 1, or lens and detector for case 2, with $\tau=0^\circ$ equal to the principal ray of the diffracted beam.  The angular center position of the focused spot in the detector plane is $\theta_d$, with $\theta_d= k \theta_a$ with $k$ defined above.

\begin{figure}
\begin{center}
    \includegraphics[width=1.0\textwidth]{question_mark.ps}
  \end{center}
  \caption[Immersion grating transfer function]{Cartoon of the immersion grating transfer function.  The grating transfer function $g=g(\theta, \lambda)$ is a function of angle and wavelength.}
\end{figure}

Case 1: Detector motion only, lens fixed
\begin{eqnarray}
	h(\tau) = \int_{-\infty}^{\infty} f(\theta) p(\tau - \theta)\,\mathrm{d}\theta  \nonumber \\
	h(\tau)=f(\theta) \convolution p(\theta)  \nonumber
\end{eqnarray}

Case 2: Detector and lens differential motion
\begin{eqnarray}
	h(\tau) = \int_{-\infty}^{\infty} f(\theta_d - \theta) p(\theta_a - \theta)\,\mathrm{d}\theta  \nonumber \\
%	\mathrm{Which\; is\; the\; same\; as:\;}  \nonumber \\
	h(\tau) = \int_{-\infty}^{\infty} f(\theta) p([1-k]\tau-\theta)\,\mathrm{d}\theta  \nonumber \\
	h([1-k]\tau)=f(\theta) \convolution p(\theta) \nonumber
\end{eqnarray}

Case 1 is a pure convolution, which is consistent with our intuition of smearing pixels with PSFs.  No problemo.  Case 2 is similar, the output function $h(\theta)$ is a convolution of $f$ and $p$, except stretched out by a factor of $1-k$.  Neat.  If the input signal is polychromatic, then $g(\theta)$ is a strong function of wavelength, but in fact the convolution proceeds the same way, stretching convolution of $g$ and $p$ by the factor $1-k$.  At the end of the day what we really want is the ratio, $r$, of the integrated intensity of a single monochromatic order from the immersion grating to the integrated intensity of a monochromatic beam from a reference mirror.  In terms of the quantities already defined, $r= \int h_{g}(\theta)/h_{m}(\theta)\,\mathrm{d}(\theta)$.  The area under the curve of a convolution is the product of the areas under the curves, so the pixel function (which is common to both the denominator and numerator in the ratio $r$), cancels out, as do all other common factors like $s$ and $b$.  Evidently $r$ is indifferent to the differential camera motion, which was not initially obvious to me, but now makes intuitive sense since the effect of the differential camera motion is merely a stretching of the pixel function.  To get a sense for the magnitude of the stretching, let us predict the factor $1-k$ for the geometry of our system under its two different operation modes.  For these modes $L=20.5$ and $f=110 \mathrm{\;or\;} 200$ mm.  The angular profiles will be stretched by factors of 2.9 and 2.0, respectively.  That there is less stretching for the longer focal length camera can be understood since it is more similar to the scenario of the detector moving freely from the lens, or in other words the relative motion is faster.  This whole angular rates problem is analogous to the difference between sidereal and synoptic rates in the apparent motion of celestial bodies in the solar system- Mars moves more slowly through the sky than does Jupiter even though Mars' angular space motion relative to the sun is faster than that of Jupiter.

\begin{figure}
\begin{center}
    \includegraphics[width=0.8\textwidth]{exp45_46}
  \end{center}
  \caption[Angular resolution experiment]{Experiment 45 and experiment 46 angular resolution experiments- observed instrumental profiles.  The width of the mirror slit is a few times smaller than the pixel width so that these profiles mostly indicate the instrumental pixel and motion response.The left panel is the instrumental profile of a monochromatic mirror beam with the lens mounted to the optical bench.  The right panel is the instrumental profile of a monochromatic mirror beam with the lens mounted to the swinging arm along the same axis as the detector.  The last panel is the latter experiment with its $x-$axis shrunk by a factor of 2, which is predicted from the differential motion and geometry of the system.  The match is good.  Based on the first panel we can directly estimate the effective width of the pixel- the $0.16^\circ$ width translates into 0.54 mm pixel width, but strictly less than this value since there is also some small contribution from the convolution of the slit.  This width is almost half as small as the 1 mm width we had been assuming based on the specs of comparable detectors and the limited information we had about our model. Our operational instrumental profile is the second panel, which has an angular width of about $0.30^\circ$.}
\end{figure}

In experiments 45 and 46 I directly measured the stretching factor for the system with $L=205$mm and $f_C=200$mm.  In experiment 45 I mounted the camera lens to the static optical bench so that the lens did not move with the swing arm, but the detector swung about the optical axis.  Experiment 46 had the lens mounted to the camera swing arm.  The angular scan profiles are shown in the next figure, with raw signal plotted against angular position, that is the angle of the arm.  The first panel shows experiment 45, the second panel shows experiment 46, and the last panel shows experiment 46 with its $x-$ scale compressed by a factor of 2, as predicted above for this camera system.

\begin{figure}
\begin{center}
    \includegraphics[width=0.45\textwidth]{question_mark.ps}
  \end{center}
  \caption[Observed and predicted slit functions]{The observed slit function for the 110 mm focal length camera system.  The pixel demonstrates non-uniform sub-pixel response, up to a factor of 20\%.}
\end{figure}

\section{Detectors}
%Table of single pixel detector properties
\input{gta_CA1_tab_detectors.tex}

\begin{figure}
\begin{center}
    \includegraphics[width=0.8\textwidth]{question_mark.ps}
  \end{center}
  \caption[PbS detector pixel geometry]{PbS detector pixel geometry.  The active area of the pixel is a subset of the entire metallic surface.  The dashed white lines show the detector's active area.  The ruler numbers demonstrate centimeters with sub-ticks equal to 1 mm.  The thick white bars near the pixel on the blow up image represent 3 and 1 mm.  The long axis of the detector active area must be parallel to the image long axis.  This requirement is tricky to accommodate with simple mountings, however, since the detector mounting set-screw is perpendicular to the long axis.  Casey Deen pointed out these issues in the geometry on October 31, 2011.  Experiments I performed before this date should not demonstrate sharp top-hat function PSFs.}
\end{figure}

\begin{figure}
  \centering
  \subfloat[Slit image]{\label{fig:GTA_slit}\includegraphics[width=0.5\textwidth]{question_mark.ps}}
  \subfloat[Pupil image]{\label{fig:GTA_im01}\includegraphics[width=0.5\textwidth]{question_mark.ps}}
  \caption[Slit and pupil image compared to single pixel detector size]{

  \emph{Left-} Layout of the IR detector areas compared to the image of the slit, as produced with a reference mirror and the current optical camera configuration, which includes a $f=110$mm focal length lens.  The blue dashed line is the footprint of the $\alpha$NIR 2D focal plane array, which has 316 $\times$ 252 array of 39 $\mu$m square pixels.  The solid red line is the single pixel detector which is 1 $\times$ 3 mm, as shown in the previous figure.  The background shows a filled contour plot of the slit image taken with the $\alpha$NIR from 100 combined dark subtracted frames, with the $f=110$ mm focal length camera lens, 250 $\mu$m slit width and the minimum slit height provided by the monochromator, with $\lambda$=1.6 $\mu$m.  Apparently the minimum slit height the monochromator provides is not sufficiently small to capture the full slit image height.  Either the slit height should be reduced or the camera lens focal length should be reduced to capture all the incident light.

  \emph{Right-} Same as the previous figure, except the background shows a filled contour plot of an image of the light source lamp filament with a 2.9 mm slit width and the maximum slit height provided by the monochromator, with $\lambda$=1.6 $\mu$m.  The contours on the image are black-blue-light blue with 10, 20, 40, 80, 160, 320 counts/pixel, with the noise floor at 5.4 counts with $\sigma=$ 2.5 counts/pixel.  The single pixel detector cannot capture all the light of the grating image onto the single pixel detector.  I discourage the choice of this image, since the image width does not shrink appreciably with decreasing slit size, meaning we lose light off the sides of the detector, and we lose angular resolution.}
\end{figure}

\begin{figure}
  \centering
  \subfloat[PbS and PbSe detectors]{\label{fig:PbS_det_eff}\includegraphics[width=0.8\textwidth]{question_mark.ps}} \\
  \subfloat[InGaAs and Ge detectors]{\label{fig:Ge_det_eff}\includegraphics[width=0.8\textwidth]{question_mark.ps}}
  \caption[Relative efficiency of single pixel detectors]{Relative efficiency of detectors comparable to but different from the models in our lab.  See the table with information on the detectors. The data are from \url{http://www.newport.com}.}
\end{figure}

\section{Equipment operation and performance}
The measurement system presents some challenges, specifically aligning and collimating the low intensity invisible monochromatic beam, and scanning the diffracted orders with a small single pixel detector.  In this section we characterize the measurement equipment through tests of the resolution and delivered optical and electronic performance.  We scrutinize the experimental strategy for sources of systematic errors.

\subsection{Repeatability}
A key limitation in our measurement strategy is the repeatability and stability of the optical alignment, and electronic and lamp conditions.  Specifically, our strategy is to take reference beam or reference mirror measurements before and after the scans of our grating or optic of interest.  Since our scans last up to 30 hours or more, reference calibration measurements can be temporally separated by several days.  The measured signal can drift for many reasons, for example drift in the lamp filament temperature or detector temperature, or mechanical sag of mirror mounts induced by thermal expansion or vibration.  Ideally our measurement strategy would take contemporaneous calibrations or near-contemporaneous calibrations on scales much shorter than the thermal drift time scale.  Our measurement system's structural design currently makes contemporaneous reference measurements prohibitive.  In principle the addition of a motorized retractable mirror or a beam splitter could provide near-contemporaneous or contemporaneous reference measurement, but these hardware upgrades are not going to be pursued at this time.  In this section we quantify the delivered repeatability of our measurements.  Naturally, we can repeat measurements many times to average out the variations in repeatability, but of course this adds to the measurement timescale and turnaround.  Our goal is to achieve about 5\% repeatability of measurements.  This level of uncertainty is comparable to what is delivered in industry applications (as noted from our experience with II-VI Infrared, who reported a 3\% systematic error in their wafer witness samples for the JWST project, for example).  Furthermore, 5\% is a fair estimate for our other systematic errors arising from vignetting of optical components or chromatic aberrations, among milliard other factors, so doing much better than this in any single experiment is likely just fooling ourselves.

The next figure demonstrates the repeatability of experiment 22 and 24.  These experiments served as the pre- and post- reference mirror calibrations for experiment 23.  The measurements were separated by 4 days, specifically from a experiment 22 was started on Friday November 17, 2011 and experiment 24 was started on Monday November 21, 2011.  Both experiments took 20 hours to complete.  One aspect of the experimental setup was altered over this time- the necessary swapping of the reference mirror for the CA1 immersion grating, and the subsequent re-replacement of the mirror.  This process has its own affiliated repeatability limitations, but notably our mount was designed to be stable by using a 2-pin ball stud plate and 2-hole base plate.  The repeatability of this mount has not be independently examined, but in principle could be tested to a few arcseconds with a simple laser.  In any case when replacing the ball stud plate I typically monitor the instantaneous signal reported on the lock-in amplifier front panel, and I carefully attempt to torque the ball stud plate.  I did not notice any change in the instantaneous signal.

\begin{figure}
\begin{center}
    \includegraphics[width=0.7\textwidth]{exp22-24_plusdif}
  \end{center}
  \caption[Repeatability experiment]{Experiment 22 and experiment 24 overplotted to demonstrate the level of the repeatability of the measurements separated by 4 days.  The bottom panel shows the fractional difference of two curves which was computed as the absolute value of the difference divided by the sum of the two experiments, which is the same as half of the difference divided by the mean of the two experiments.  Blue line is the raw data, overplotted in black with a 21 pixel boxcar smooth.  The yellow dashed line is 5\% fractional difference from the mean.  The repeatability is better than 5\% over 1.5 $-$ 2.5 $\mu$m, which is our wavelength range of interest.}
\end{figure}

\begin{figure}
\begin{center}
    \includegraphics[width=1.0\textwidth]{exp25and30}
  \end{center}
  \caption[Stability experiment]{Experiment 25 and experiment 30 overplotted to demonstrate the level of the stability of measurements at $\lambda = 2.0 \; \rm{ and } \;2.3\; \mu$m. \emph{Left:} The measured signal normalized to its starting value as a function of time.  No changes were made to the experimental setup over the duration of the experiment.  Experiment 25 lasted 17.6 hours, experiment 30 lasted 52.9 hours.  The standard deviations over those times was about 9\% and 2\%, with peak to valley amplitudes of and 91\% and 23\%.  Experiment 25 shows about 4.5 times as much instability as does experiment 30, despite the fact that experiment 25 is 3 times shorter than experiment 30.  This level of instability is demonstrated in the previous figure, where the curves at $\lambda=2.3 \; \mu$m match to 0.3\%, but the difference at $\lambda=2.0\;\mu$m is about 2\%.  It's not clear what is the cause of the wavelength-dependent instability, but my guess is that the near-IR lamp is warming or cooling and since 2.0 $\mu$m is on the Wein side of the black body curve, it is much more sensitive to minute temperature differences than the 2.3 $\mu$m measurements, which are close to the blackbody peak.  The sampling rates were semi-regular, with delivered mean time steps and standard deviations of $15.86\pm0.34$ and $15.85\pm0.09$ s, but maximum separations of up to 29 and 20 seconds respectively.  \emph{Right:} The power spectrum of experiment 30, normalized to its peak value, with the DC component removed.  The red dashed line is an unweighted linear fit to the data frequencies less than 0.001 Hz, excluding the DC component.  Since the sampling was not strictly regular, we interpolated (i.e. \emph{interpol()} in IDL) the time samples onto a 5 times finer grid than the semi-regular native sampling.  The fitted power law slope is -1.4, which is consistent with 1/$f$ ``flicker" noise.}
\end{figure}

\section{Early Experiments}

\begin{figure}
  \centering
  \subfloat[Early polychromatic beam profile experiment]{\label{fig:exp7}\includegraphics[width=0.45\textwidth]{dat07_wls_1}}
  \subfloat[90$^\circ$ Rotated PbS detector]{\label{fig:rot_detect}\includegraphics[width=0.45\textwidth]{exp7_vs_ex8_norm}}
  \caption[Rotating the PbS detector improved the angular resolution by a factor of 3]{ \emph{Left-} Experiment 7 polychromatic detector profiles.  These profiles were taken before we rotated the slit so its long axis was perpendicular to the direction of the angular scanning, and before improvements to the optical quality, particularly the focus.  \emph{Right-} Factor of 3 improvement in angular resolution from correct detector mounting. Experiment 7 and 8 detector profiles for $\lambda = 2.5 \; \mu$m.  Between experiment 7 and 8 I rotated the PbS detector so that the long axis of the photosensitive detector area was perpendicular to the axis of the swinging arm.  The detector area is 1 $\times$ 3 mm$^{2}$, so with our $f=$ 110 mm camera lens and PbS detector configuration we expect 1.8$^\circ$ and 0.6$^\circ$ field of view for experiments 7 and 8, respectively.  The measured FWHM of the PSFs for experiments 7 and 8 are 1.8$^\circ$ and 0.63$^\circ$.  Notice the sidelobes on experiment 8, these came from calibration problems, specifically a background scan was subtracted off of this scan, but the background scan was not taken with a dark aperture cover and so this PSF is really the difference of two PSFs.  Still the width of the feature is unaffected, and the improved spectral resolution from rotating is demonstrated.}
\end{figure}

\begin{figure}
\begin{center}
    \includegraphics[width=0.6\textwidth]{question_mark.ps}
  \end{center}
  \caption[Factor of 50-100 improvement in signal from optical and electronic improvements]{Voltage as a function of wavelength for a 100 $\mu$m slit width, during experiments 1-5 and experiment 7$-$ experiments 1-5 are clustered below 1 mV, whereas experiment 7 is well above 10 mV.  The optical setup was unchanged during experiments 1-5.  I aborted experiment 6 because the scanning was goofed up.  Before experiment 7 I increased the on-detector gain setting by a factor of 5, maximized the signal by nulling the signal to 0 and then adding 90$^\circ$ of phase, increased the chopper frequency from 80 to 180 Hz, reset the lock-in amplifier pre- and post- measurement time-constant to steady the signal reported on the LCD display, fine adjusted the detector focus and height by comparison to the lock-in amplifier LCD display.  I also fine adjusted the exit-slit collimator lens, coarse-adjusted the input light source positioning on the lab jack, and triggered the TE cooler for the detector.  It is not clear if these last 3 changes had any effect, but all the changes combined to improve the signal by a factor of 50-100.  The beam profile also improved, although they are still not flat-topped.  See the figure of the beam profiles.}
\end{figure}

%------------------------------------------------------------------------------------------
%Long Tables
%------------------------------------------------------------------------------------------
\input{gta_CA1_tab_exper_parms.tex}
\input{gta_CA1_tab_experlog2.tex}


\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{graphicx}
\graphicspath{ {images/} }
\newcommand{\Mod}[1]{\ (\mathrm{mod}\ #1)}

\title{Sonny: A curve designed to perform high security circuit operations for Elliptic Curve protocols in Zero Knowledge }
\author{
  Carlos Perez\\
  Dusk Foundation\footnote{https://dusk.network/}\\
  \texttt{carlos@dusk.network}
  \and
  Luke Pearson\\
  Dusk Foundation\\
  \texttt{luke@dusk.network}
}
\date{October 2019}

\begin{document}

\maketitle
\thispagestyle{empty}
\pagestyle{empty}

\begin{abstract}

\end{abstract}

\newpage

\tableofcontents

\newpage

\section{Introduction}
The construction and use of elliptic curves is paramount to many cryptographic protocols. Elliptic curves are among the fastest performing primitives where the Discrete Logarithm Problem (DLP) is hard, which is why they are regarded as dominant in the field of cryptography. As the field of cryptography advances, elliptic curves have been proven to be unparalleled in their use for cryptographic systems which have speed and security as two of the most outstanding features. As they are held in such high regard, they can greatly steer the direction of new cryptographic protocols. When outlining new protocols which rely upon elliptic curves, there are a multitude of features which are affected depending on design; often regarded as factors of opportunity cost which leads to compromise on critical features within Elliptic Curve Cryptography (ECC). However, some contemporary techniques can be used to better facilitate systems that rely so heavily upon these primitives. Since many previous protocols are proven to be secure, it is $often$ far more efficient to add to these standards with compound technologies rather than seeking entire system replacements. \\\\ One of the most groundbreaking techniques used in state of the art cryptography is the constructing of Zero Knowledge  (ZK) proofs for nearly universal computation. As is with many cryptographic protocols, there is a choice of which proof system is best tailored to a system. Which includes a trade off, between proof sizes, verification times and other factors making up a ZK proof.  For particular proof systems, their expression relies upon an elliptic curve and an arithmetic circuit. The elliptic curve here is a function used to encode the public outputs which are represented as field elements, upon which a lot of operations rely. The operations for these proofs systems, however, are expressed in terms of a circuit which is determined by scalar curve arithmetic. This unfortunately restricts the operations which can be performed as they are dependent upon standard arithmetic circuit outputs - addition, multiplication, subtraction and division. Many protocols such as Elliptic Curve Digital Signature Algorithms (ECDSA), which are performed using field encodings, are in operable through the medium of generic ZK proofs which are expressed in terms of a circuit. \\\\
\boldsymbol{A} \boldsymbol{profound} \boldsymbol{solution}.
In section 3, we elaborate on how we use our derived curve, which is embedded into the scalar field of Curve25519, in order to extend the circuit operations to those which exceed the traditional bounds of constraint systems. The curve is constructed across a scalar field, as a base field, thus allowing the portability of ZK proofs onto non scalar protocols.\\\\
As with all elliptic curves, their construction will strongly influence the outcomes of the protocols in which they are implemented. In addition to this, there can be discrepancies in both the security and speed of cryptographic systems dependant upon on how they're implemented. For this reason, we wanted to make use of the the fastest complete formulas for elliptic curves, which are Twisted Edwards curves. In conjunction to their complete formulas, Twisted Edwards curves have been proven by Bernstein et al, to be Birationally equivalent to Montgomery curves. Which fit the purpose of the augmented construction, as Montgomery operations in arithmetic circuits were proven by the Z-cash team to provide a fast Montgomery ladder for in circuit multiplication. Whilst these curves models can provide some of the fastest and most simplistic operations, they do provide issues in security. Neither Montgomery, nor Edwards curves deliver prime order groups in their implementations. They provide curves which have a cofactor, $h$, which multiplies the prime of the subgroup to give the group order. Whereas curves like Weierstrass give prime order but their formulas are too inefficient for circuit operations.\\\\
For non prime order curve groups, the mismatch in desirability of prime order curves and inability to implement one directly from the curve can be patched with uniquely tailored modifications.  However, these fixes oft become perplexing to the non-implementors and with higher level protocols they are seldom straightforward. Using curves which provide prime order groups, such as Weierstrass Curves, have slower formulae and are very difficult to implement in constant time. Plentiful curve families allow for the encoding of different related curves for protocol specific purposes. For example, [] library uses Twisted Edwards forms for out of circuit operations like public key generation to exploit the high speed formula but uses Montgomery form for in circuit operations to benefit from the ladder multiplication. If an ad hoc fix needs to be given to each related curve model, then the implementation can become tedious and very complex.\\\\
\boldsymbol{A} \boldsymbol{centric} \boldsymbol{solution}.
In section 4, we explain how to use the Ristretto technique, which constructs prime order Edwards curves from non prime order groups, with our embedded curve, to compress the cofactor such that $h$ = 1. Ristretto makes use of the relationship between curves and provides a fix for the cofactor complication for all models in one place.\\\\

\subsection{$Compatibility$} (isogenies/facility) ristretto - sig - scalar

\section{Notation and Formulae}
\subsection{General notation}
$Finite Field$: $F_p$ is the finite field where the $char$ \neq {2}\vee{3}\\\\
$\varepsilon_{a,d}$ is a Edwards curve, given by the equation: $$ {a}x^2+y^2=1+{d}x^2y^2 $$ where {$d$} and {$ad$} are none square in $F$ and has no points at infinity. In this paper, the primary focus is upon Twisted Edwards curves, where $a = -1$. The identity point of an Edwards curve, $\varepsilon$, where (X,Y) $\epsilon$ in $F_p$, is given encoded to (0,1). When Edwards points are expressed in Extended Twisted coordinates, the identity encoding is given by (X : Y : Z : T) = (0 : 1 : 1 : 0).\\\\
${M}_{a,\frac{2-4d}{a}}$ is a Montgomery curve, given by the equation: $$ y^2=x^3+Ax^2+Bx $$ A Montgomery curve is Birationally equivalent to an Edwards curve - a definition used for algebraic substitution -  where its point at of infinity is the identity point, denoted as (0 : 1 : 0).\\\\
$\jmath_{a^{2},a−{2d}}$ is a Jacobi curve, given by the equation: $$y
^2 = {e}x^4 + 2Ax^2 + 1$$ A Jacobi curve, better known as a Jacobi quartic, is central to all curve models and to utilise this curve relationship we will only be using Jacobi curves where $e = {a}^2$, as such curves have a full 2-torsion point.\\\\
$Torsion\ points$:\ An element [P] in  $G$ is a torsion point if there is a mapping of $M$, by means of multiplication, where $M$ \cdot\ [P] = $0_{G}$. Torquing elements for a curve form a subgroup, $G$[$M$], where the order is divisible by ${M}^2$. The torsion subgroups for this curve family have order 1, 2 or 4.  \\\\
$Isogeny$: An isogeny, $\varphi$ , is a function which maps algebraic groups whilst preserving the group structure. This mapping must satisfy the properties of being surjective and having a finite kernel. The isogeny, in this paper, is used to transport an encoding between different curve models.\\\\
$Curve forms$: $\varepsilon_{a,d}$; ${M}_{a,\frac{2-4d}{a}}$; $\jmath_{a^{2},a-{2d}}$ \\\\ These curve models are all isogenous to one another. The Edwards, Montgomery and Twisted Edwards are independently 2-isogenous to the Jacobi quartic and are therefore 4-isogenous to one another.  \\\\
$Arithmetic$\ $circuits$: These are the computational models for computing circuits. They are universally bound to add and multiply, which are the functions performed at each node on all given inputs. \\\\
$Cofactor$\ $compression$: This refers a quasi-construction of cofactor 1 curves from cofactor 8 groups. Also known as cofactor division, it involves the process of point compression when points of order 4 or 8 are produced.\\

\subsection{Our contributions}
\subsubsection{Elliptic curve}
Here we present an elliptic curve, created for an safe and efficient Elliptic curve operations inside bulletproofs; called Sonny. Sonny is defined as an embedded curve which the gives the input for the proofs and the discrete log based proof is implemented using the outer curve, Curve25519. \\\\

\noindent\fbox{%
    \parbox{\textwidth}{%
    $$ Sonny  $$
        \begin{itemize}
    \item Curve equation in Twisted Edwards form: $$ ax^2+y^2=1-dx^2y^2 $$
    \item $a= -1$
    \item $d= -\frac{126296}{126297}$
    \item $Basepoint: Y = \frac{3}{5}$\\
    \item Montgomery form equivalent: $$ y^2=x^3+Ax^2+x $$
    \item $A = 505186 $
    \item $Basepoint: X = 4$\\
    \item The curve group order, G, is $$ 2^{252}+115924404605461509904689566245241897752 $$
    \item The order of the scalar field, $r$, is $$ 2^{249}+15114490550575682688738086195780655237219 $$       \item The order of the base field, $p$, is  $$ 2^{252} + 27742317777372353535851937790883648493 $$
    \item Cofactor: $$ h =\frac{G}{r} = 8$$
    \item Weierstrass form equivalent: \\  $$y^2=x^3+ax+b $$
    \item $a$ = 7237005577332262213973186563042994240857116359379907606001\\950828033483786813
    \item $b$ = 445582015604702849664
\end{itemize}
    }%
}\\\\

\section{Finite fields}
A finite field is a set of numbers on which arithmetic operations are performed and satisfies a specific set of rules. These operations include multiplication, addition, subtraction and division - notably, the most fundamental operations in ECC. Elliptic Curve arithmetic uses the finite field of integers reduced mod$p$, where $p$ is some prime. The use of finite fields as the extension of elliptic curves is to reinforce the hardness of the DLP, as well as make certain cryptographic assumptions about the order of the set. The choice of finite fields for elliptic curves, known as base curves, provide a cyclic group which gives precise knowledge to the amount of bits that need to be stored by point outputs. As stated, the base fields dictate the operations for the elliptic curves and thus selection of these fields affects the security, speed and simplicity of the implementation of the curve. Supplementary to standard operations performed mod$p$, there are many protocols can be performed in ECC which are implemented using finite sets but do not make use of the base field. They rely upon another prime order field, which is the curves scalar field, also known as the subgroup.  The existing systems like the verification systems are already deployed and because their operations are performed on on the base field, and not a scalar field, they are not directly updateable with a large range of contemporary techniques. This paper and findings focuses on Zero Knowledge  proofs as the 'add-on technology' for existing schemes. \\\\ Elliptic curves have both a base field, which is the finite field in which they are defined; and a scalar field, which is associated with the number of points on the curve. DL based proofs which use a curve and a circuit rely upon both of the finite fields. The base field here is a function used to encode the public coordinates which are represented as field elements. However, as the operations are performed mod$p$, where $p$ is prime,  the outputs are reduced to the prime scalar field. Thus operations which require the base field, cannot be performed inside proof systems which use arithmetic circuits as an expression. As a result the ZK outputs are limited to what circuit operations can be performed by the elliptic curves scalar field. The circuit, in this case, encodes relation between the input and outputs.
\subsection{Efficient ZK for higher operability }
To extend the range of ZK elliptic curves operations to those which employ the base field, we have built a curve which has a base field equal to the scalar field of Curve25519. This is defined in the following manner: Let $\varepsilon_{1}$ and $\varepsilon_{2}$ be elliptic curves. Where the prime subgroup order, or scalar field, of $\varepsilon_{1}$ is $r$; we define $\varepsilon_{2}$ over the base field $F_p$, where \#$F_p$ = $r$.
This will allow us to perform fast in circuit operations using $\varepsilon_{2}$ as the embedded curve within the scalar field of $\varepsilon_{1}$.One particular current issue that embedding curves helps to alleviate is the adding to, or updating of, existing software protocols with privacy techniques so that already deployed systems can benefit from high levels of privacy preservation. By constructing this, we are making a quasi representation of one finite field as both a scalar and a base field. We can therefore encode the field based protocols curve over the scalar field of existing systems - and protocols such as key signature verification, can be performed inside a Zero Knowledge  proof. We present a means of verifying only the scalar operation, in Zero Knowledge , so that Zero Knowledge  proof of statements derived for signature schemes can be proven rather than the signature itself. This is performed by expressing ZK proof of computations as the argument for computational models, such as arithmetic circuits.\\\\
In the case of Zerocaf protocol, we have the outer curve operations, using Curve25519, which implement the ZK proof system, where the operations are performed as integers mod the base field. Then there is Sonny, the inner curve, known as the embedded curve which is the curve we make the proofs about. For the case of signature schemes, like Elliptic Curve Digital Signature Algorithm (ECDSA), the operations for the signature generation are made using Sonny then the Zero Knowledge  arguments for these outputs are generated using Curve25519. By setting the scalar field of Curve25519 as the base field of Sonny, all the operations are efficient when expressed in terms of a circuit. The validation keys here are effectively turned into discrete log proofs, as the generation of ZK values is performed in one amalgamated protocol, even though it comes from two different curves. \\\\
Many software layers require information from the user - just like authentication certificates for websites, where the type of secret keys is known to the website for verification. The information given is often burnt into the hard memory of the website, which can be used by the software owners to discriminate against different keys and brands of keys hence the need to preserve privacy on these existing protocols.
\subsection{Circuits}
An circuit is combinational set of operations which are aligned in a set or series for the ultimate purpose of optimising otherwise standardised mathematical process. The operations, better known as the basic arithmetic operations (addition, subtraction, multiplication, and division), are theoretically performed in constant time. This statement is derived from the fact that the required RAM required is roughly equal for all operations. However, when computing these operations for some large integers, it is apparent that the magnitude greatly affects the costs of RAM. Thus giving a discrepancy for computational time between the theoretical arguments and the practical implementation. When the expression of these arithmetic operations is performed in a circuit, it is referred to as an arithmetic circuit. When expressed for computations within computer systems, any arithmetic circuit is constructed from various combinational elements, which are connected by wires. A combinational element is fixed element which performs a specific function from a constant number of inputs and outputs.
Circuits are used alongside the elliptic curves to construct discrete log based proof systems; when the circuit is defined over the scalar field.

\section{Prime order groups}
'A group of prime order' is always a cyclic group, that has a mapping - which respects the group structure - to the quotient of the group of integers by a subgroup. This subgroup is generated by a prime number. Groups of prime order are often a prerequisite to crytpographic prototcols, as they provide the basis for a hard DLP and thus increased security for implementation. For implementation, we have made efficiency the most paramount factor for curve selection, which led to us choosing a Twisted Edwards curve form. This is because the Edwards forms of the curves provide the fastest known formulas, which can be accredited to extended Twisted Edwards, introduced by Hysil et al, where auxiliary points are used with fewer field inversions. As elliptic curves are Abelian groups, they provide varying order for their respective groups. Edwards curves and their birational Montgomery equivalents, provide 'not quite' prime order groups over fields - the absence of prime groups can lead to timing variations when implementing protocols such as the signature schemes Sonny implements. Instead of certain Elliptic curve groups being prime, they have a cofactor $h$, meaning that $h \cdot q$ is the group order, where $h > 1$ and $q$ is a large prime. Having this property where $h > 1$ can lead to many implementation complexities.\\\\
There are cofactor relates attacks designed to extract information, in the form of bits, about a users private key. When generating a public key, it is ideally performed using a point operation on a given curve point, where a chosen scalar outputs a new point, modulo the base field. This provides a public key, from which the scalar, known as the private key, cannot be extracted. However, if points on the curve are selected by attackers to have order which divides $h$, then presented as valid curve points, they can be mistakenly used by a user. If an incognizant user generates a public key by inputting a secret scalar to a function which operates with points of order $h$, then the attacker can gain some bits about the input scalar. Whereas within a prime order group, there is no means of generating valid points which have order dividing $h$. The abstraction of having non prime order groups can be solved with specialised modifications towards individual protocols. One notorious method is to multiply points by the cofactor and check the result; if the resulting point is the identity point then it can be discarded. Many of the individual techniques produce continuous and substantial flaws, especially with regards to patchwork comprehension, which occurs when the protocols are being implemented by those who did not design them, i.e. Implementors not knowing at which step to multiply by $h$.
\subsection{Cofactor compression}
There are various advantages and disadvantages to having a cofactor larger than one, therefore a thorough analysis must be performed,  so that it is known whether or not cofactor manipulation is needed. For all curves, except for Hessian curves, the cofactor is divisible by 4. To become more useful to a broad spectrum of cryptography, Ristretto is apt for a large number of curves, which have a cofactor of 8 or 4. When the cofactor is greater than 1 multiple operations can be hindered. A quotient group can be constructed to allow for the implementation of prime order groups, thus effectively compressing the cofactor, by applying the Ristretto technique. This technique requires just one additional step to Mike Hamburgs decaf proposal for cofactor-4 curves. The technique works using following four functions:\\\\
${Equality}$ ${testing}$ This function checks the equality of group elements. \\\\
${Encode}$\ The encoding function is applied to an Edwards point and this becomes the internal representation for the new "Ristretto point', meaning the same Edwards point operations are performed on the Ristretto point, and with no overhead cost. The function encodes the elements as byte strings so that that the Ristretto elements can be encoded identically.\\\\
${Decode}$\ This function decodes the byte strings into the internal representations of Ristretto points. There is also a validity check which assesses the canonical representation of points, and only accepts those which are outputs of the encoding function. \\\\
${Curve}$ ${hashing}$\ For many protocols, mapping elements in a group to a curve is done by a hash function, as it provides standardised digests which can be encoded. Ristretto using an Elligator 2, which gives a 1:1 mapping of group elements to the curve. Elliga

\subsection{Isogenies}
By using the Ristretto technique, we are able to solve all cofactor related issues in one place and with one step. This is facilitated by its use in the relationship of the curves, and how this lets us transport the cofactor compression for curves, via the isogeny, to another curve in the same family. Which in turn means we work with prime order points in any operations of ECC. Otherwise, the implementation would have to deal with the issue at varying stages which is dependent upon a protocols ultimate design. An isogeny is a function which maps one algebraic group to another, whilst maintaining the structure of the group - which in terms of elliptic curves, means that a curve is allowed curve to take on the values of another and preserve the same point addition method. These functions are non-constant and are used as a tool for effective 'transportation' between curve models. Just as with all concrete mathematical formulae, these functions have a domain and co-domain, which means that given these two, it is possible to compute the function itself. In this document isogenies will be given the generalization as the multiplication by $m$ map, where they have a finite kernel and are restricted to rational mappings.
A deeper understanding of isogenies for elliptic curves has greatly advanced the field of ECC, as it is possible to deduce one mapping from the form of another. Additionally, if these relationships are well understood then they can be applied or integrated into other functions and broaden their domain of propriety to more use cases.\\\\
When there exists a non-constant function, $\varphi$, which gives a rational mapping from one group to another denoted as $\varphi$ : $\varepsilon$ $\rightarrow$ $\varepsilon\prime$. This mapping from $\varepsilon$ to $\varepsilon\prime$ has degree $n$. Where there is this separable isogeny, then exists a mapping from $\varepsilon$ to $\varepsilon\prime$, which is known as the dual isogeny, $\hat{\varphi}$, where both functions have degree $n$. The dual isogeny is conveyed as $\hat{\varphi}$ : $\varepsilon\prime$ $\rightarrow$ $\varepsilon$ of degree $n$. The isogeny $\hat{\varphi}$ here is known as the dual of $\varphi$, such that $\hat{\varphi}$ $\circ$ $\varphi$ is the multiplication by $n$, where $n$ = $\hat{\varphi}$ $\circ$ $\varphi$, from $\varepsilon$ to $\varepsilon\prime$. This dual isogeny has certain properties which allow for the two way transportation of functions between curves. These can be exploited to provide abstraction of protocols where it would otherwise be inapplicable.

\subsubsection {Curve mappings}
As curve models $\varepsilon_{a,d}$; ${M}_{a,\frac{2-4d}{a}}$; $\jmath_{a^{2},a-{2d}}$, have different implementation features we can utilise these relationships to achieve the implementation we desire, namely a prime order curve. It is possible to construct prime order curves using the Montgomery and Edwards curve forms by transporting encoding to and from the Jacobi quartic, via isogenies. The functions for cofactor compression would typically be used on the Jacobi quartic form, by means of canonically selecting outputs for curve points. Now this selection process can be applied to the Edwards and Montgomery form by integrating it to the function which maps between them. \\\\

\subsubsection{Encoding types}
\section{Zerocaf}
As is previously explained our curve has a base field which is the scalar field of Curve25519, to allow for the use of efficient Zero Knowledge  on operations within a circuit. the difficulty of breaking cryptographic systems stems solely from the hardness of the mathematical problems on which they are based. However, this proves not to be the case in practical implementations because of side channel attacks, which target the implementation as medium of encoding the cryptography - to circumvent these attacks, the operations need to be performed in constant time. The use of Edwards curves results in a uniform implementation which better facilitates these constant time operations.  The Edwards form of a curve is considered complete, as any two inputs, given as x and y, provide a correct result. Whereas in circuit operations can greater benefit from variable time implementations, as they perform faster. They can be applied when there is no secret data to protect, as they may lead to leakage of data. We therefore present an implementation which performs statement proofs in constant time with high security, and verification in variable time and high speed. \\

\section{Future work}
R1CS optimisation for constraints
Further isogeny use cases

\section{Conclusion}

\section{Acknowledgements}
We would like to give special thanks to Henry de Valence for his personalised help in understanding the Ristretto Protocol and being so responsive for questions regarding the implementation. We would also like to show our strong appreciation for Marta Bellés Muñoz for her contributions with the discrete log based theory used in the understanding of this project.

\newpage

\begin{thebibliography}{99}

\bibitem{c1} Stanford University, University College London and BlockStream, Benedikt Bünz, Johnathan Bootle, Dan Boneh, Andrew Polestra, Pieter Wuille and Greg Maxwell. Bulletproofs: Short Proofs for Confidential Transactions and More.\\ https://eprint.iacr.org/2017/1066.pdf
\bibitem{c2} Shafi Goldwasser, Silvio Micali, and Charles Rackoff. The knowledge complexity of interactive
proof-systems (extended abstract). In 17th Annual ACM Symposium on Theory of Computing
(STOC’85), pages 291–304, 1985."
\bibitem{c3} Pedersen T.P. (1992) Non-Interactive and Information-Theoretic Secure Verifiable Secret Sharing. In: Feigenbaum J. (eds) Advances in Cryptology — CRYPTO ’91. CRYPTO 1991. Lecture Notes in Computer Science, vol 576. Springer, Berlin, Heidelberg
\bibitem{c4} Isis Lovecruft and Henry de Valence. Ristretto. https://Ristretto.group/Ristretto.html
\bibitem{c5} Mike Hamburg : Deacaf. November, 2015. https://eprint.iacr.org/2015/673.pdf
\bibitem{c6} Feng Hao, Thales E-Security, Cambridge, UK https://eprint.iacr.org/2010/149.pdf
\bibitem{c7}Robert Dijkgraaf: Mirror Symmetry and Elliptic Curves, university of Amsterdam, November 15, 2002
\bibitem{c8} Tehcnological University of Visvesvaraya, Jnana Sangama https://www.academia.edu/8777556/

\end{thebibliography}

\end{document}


\section{The Trust Graph}
  We now engage in the formal description of the proposed system, accompanied by helpful examples.
  \subimport{common/definitions/}{gamegraph.tex}
  \noindent The nodes represent the players, the edges represent the existing direct trusts and the weights represent the
  amount of value attached to the corresponding direct trust. As we will see, the game evolves in turns. The subscript of the
  graph represents the corresponding turn.
  \subimport{common/definitions/}{players.tex}
  \noindent Each node has a corresponding non-negative number that represents its capital. A node's capital is the total value
  that the node possesses exclusively and nobody else can spend.
  \subimport{common/definitions/}{capital.tex}
  \noindent The capital is the value that exists in the game but is not shared with trusted parties. The capital of $A$ can be
  modified only during her turns, according to her actions. No capital can be added in the course of the game through external
  means.

  We also define a player's assets to be the sum of her capital and her total outgoing trust.

  \subimport{thesis/definitions/}{assets.tex}
  \noindent We consider the outgoing trust of a player as part of her assets. The formal definition of direct trust follows:
  \subimport{common/definitions/}{directtrust.tex}
  \noindent This definition agrees with the title of this paper and coincides with the intuition and sociological experimental
  results of \cite{kmrs} that the trust $Alice$ shows to $Bob$ in real-world social networks corresponds with the extent of
  danger in which $Alice$ is willing and able to expose herself to in order to help $Bob$. An example graph with its
  corresponding transactions in the UTXO can be seen below.

  \subimport{common/figures/}{utxo.tikz}

  \noindent Any algorithm that has access to the graph $\mathcal{G}_j$ has implicitly access to all direct trusts of this
  graph.  We use the notation $N^{+}(A)$ to refer to the nodes directly trusted by $A$ and $N^{-}(A)$ for the nodes that
  directly trust $A$. We also use the notation $in_{A, j}, out_{A, j}$ to refer to the total incoming and outgoing direct
  trust respectively. For a reference of common definitions, see the Appendix.


\section{Inter Rater Agreement}
\label{chp:fundamentals:sec:inter_rater_agreement}
Many \ac{ML} models require a dataset which is used to train them.
This data is often generated by multiple raters which assign a label to each datapoint.
The used dataset directly influences the \ac{ML} model \parencite{Gray:2011} and therefore, well designed research studies must include mechanisms to capture \ac{IRA} \parencite{McHugh:2012}.

This section gives an introduction to different \ac{IRA} metrics and their applications.

\input{chapters/02_fundamentals/sections/inter_rater_agreement/subsections/cohens_kappa}
\input{chapters/02_fundamentals/sections/inter_rater_agreement/subsections/scotts_pi}
\input{chapters/02_fundamentals/sections/inter_rater_agreement/subsections/fleiss_kappa}
\input{chapters/02_fundamentals/sections/inter_rater_agreement/subsections/free_marginal_multirater_kappa}