
\section{Coq}
\label{sec:coq}
\index{Coq proof assistant}

This section describes the content of the Coq files generated by \why for
both proof obligations and theory realizations. When reading a Coq
script, \why is guided by the presence of empty lines to split the
script, so the user should refrain from removing empty lines around
generated parts or adding empty lines inside them.

\begin{enumerate}
\item	The header of the file contains all the library inclusions
	required by the driver file. Any user-made changes to this part
	will be lost when the file is regenerated by \why. This part ends
	at the first empty line.
\item	Abstract logic symbols are assumed with the vernacular directive
	\verb+Parameter+. Axioms are assumed with the \verb+Axiom+
	directive. When regenerating a script, \why assumes that all such
	symbols have been generated by a previous run. As a consequence,
	the user should not introduce new symbols with these two
	directives, as they would be lost.
\item	Definitions of functions and inductive types in theories are
	printed in a block that starts with \verb+(* Why3 assumption *)+.
	This comment should not be removed; otherwise \why will assume
	that the definition is user-made.
\item	Finally, proof obligations and symbols to be realized are
	introduced by \verb+(* Why3 goal *)+. The user is supposed to
	fill the script after the statement. \why assumes that the
	user-made part extends up to \verb+Qed+, \verb+Admitted+,
	\verb+Save+, or \verb+Defined+, whichever comes first. In the
	case of definitions, the original statement can be replaced by
	a \verb+Notation+ directive, in order to ease the usage of
	already defined symbols. \why also recognizes \verb+Variable+
	and \verb+Hypothesis+ and preserves them; they should be used in
	conjunction with Coq's \verb+Section+ mechanism to realize
	theories that still need some abstract symbols and axioms.
\end{enumerate}

Currently, the parser for Coq scripts is rather naive and does not know
much about comments. For instance, \why can easily be confused by
some terminating directive like \verb+Qed+ that would be present in a
comment.


%%% Local Variables:
%%% mode: latex
%%% TeX-PDF-mode: t
%%% TeX-master: "manual"
%%% End:
