\documentclass{report}
\usepackage[T1]{fontenc}
%\usepackage{fullpage}
\usepackage{amsmath,amssymb}
\usepackage{qsymbols}
\usepackage{code}
\usepackage{coq}
\usepackage[color]{coqdoc}
\usepackage{hyperref}
\usepackage{abbrevs}
\usepackage{natbib}
\usepackage{minitoc}
\usepackage[utf8x]{inputenc}

% \makeatletter
% \renewcommand{\tableofcontents}{\noindent\@starttoc{toc}}
% \makeatother
\def\texttau{\ensuremath{\tau}}
\def\textDelta{\ensuremath{\Delta}}
\def\textGamma{\ensuremath{\Gamma}}

\setlength{\coqdocbaseindent}{1em}

\def\eqnversion{\texttt{1.3beta2}\xspace}

\author{Matthieu Sozeau}
\date{\today}
\title{\Equations \eqnversion Reference Manual}
\begin{document}

\maketitle

\def\coqlibrary#1#2#3{}

\def\Equations{\texorpdfstring{\name{Equations}}{Equations}}

\chapter*{Introduction}
\label{cha:introduction}

\Equations is a toolbox built as a plugin on top of the \Coq proof assistant
to program and reason on programs defined by full \emph{dependent}
pattern-matching and \emph{well-founded} recursion. While the primitive
core calculus of \Coq allows definitions by \emph{simple} pattern-matching on
inductive families and \emph{structural} recursion, \Equations extends
the set of easily definable constants by allowing a richer form of
pattern-matching and arbitrarily complex recursion schemes. It can be
thought of as a twin of the \name{Function} package for Isabelle that
implements a \emph{definitional} translation from partial, well-founded
recursive functions to the HOL core logic. See
\cite{BoveKraussSozeau2011} for an overview of tools for defining
recursive definitions in interactive proof assistants like (\Coq, \Agda
or \Isabelle).

The first version of the tool was described in
\cite{sozeau.Coq/Equations/ITP10}, the most recent one is described in
\cite{equationsreloaded}. This manual provides a documentation of the plugin
commands (\autoref{cha:manual}) followed by a tutorial using basic
examples (\autoref{cha:gentle-intro}).  More elaborate examples are
available at \url{http://mattam82.github.io/Coq-Equations/examples}.

This manual describes version \eqnversion of the package.

\section*{Installation}

Equations is available through the
\texttt{opam}\footnote{\url{http://opam.ocaml.org}} package manager as
package \texttt{rocq-equations}. To install it on an already existing
\texttt{opam} installation with the \Coq repository, simply input the
command:
\begin{verbatim}
# opam install rocq-equations
\end{verbatim}

If you want to use it with the \href{https://github.com/HoTT/HoTT}{HoTT library for Coq}, simply install the 
\texttt{coq-hott} package before \Equations.

The development version and detailed installation instructions are available at
\url{http://mattam82.github.io/Coq-Equations}.

\doparttoc
\parttoc
\tableofcontents

\chapter{Manual}
\label{cha:manual}
\input{manual}

\chapter{A gentle introduction to Equations}
\label{cha:gentle-intro}

The source of this chapter that can be run in Coq with Equations
installed is available at:

\url{https://raw.githubusercontent.com/mattam82/Coq-Equations/main/doc/equations_intro.v}

\input{equations_intro}

\paragraph{Going further}

More examples are available at \url{http://mattam82.github.io/Coq-Equations/examples}

\bibliography{biblio}
\addcontentsline{toc}{chapter}{Bibliography}
\label{cha:bibliography}
\bibliographystyle{myplainnat}
\end{document}

