\section{Auxiliary Files}
\label{sec-auxfiles}

During the translation and execution of a Curry program with \CYS,
various intermediate representations of the source program are created
and stored in different files which are shortly explained in this section.
If you use \CYS, it is not necessary to know about
these auxiliary files because they are automatically generated
and updated. You should only remember the command for deleting
all auxiliary files (\ccode{cleancurry}, see Section~\ref{sec-general})
to clean up your directories.

The various components of \CYS create the following auxiliary files.
\begin{description}
\item[\code{prog.fcy}:] This file contains the Curry program
in the so-called ``FlatCurry'' representation where all functions are global
(i.e., lambda lifting has been performed) and pattern matching
is translated into explicit case/or expressions
(compare Appendix~\ref{sec-flatcurry}).
This representation might be useful for other back ends and
compilers for Curry and is the basis doing meta-programming in Curry.
This file is implicitly
generated when a program is compiled with \CYS.
It can be also explicitly generated by the
front end of \CYS:\pindex{pakcs frontend}
\begin{curry}
pakcs frontend --flat -i$\cyshome$/lib prog
\end{curry}
The FlatCurry representation of a Curry program is usually
generated by the front-end after parsing, type checking and eliminating
local declarations.

If the Curry module $M$ is stored in the directory $dir$,
the corresponding FlatCurry program is stored in the directory
\ccode{$dir$/.curry}.
This is also the case for hierarchical module names:
if the module $D1.D2.M$ is stored in the directory $dir$
(i.e., the module is actually stored in $dir/D1/D2/M.curry$),
then the corresponding FlatCurry program is stored in
\ccode{$dir$/.curry/D1/D2/M.fcy}.

\item[\code{prog.fint}:] This file contains the interface
of the program in the so-called ``FlatCurry'' representation,
i.e., it is similar to \code{prog.fcy} but contains only exported
entities and the bodies of all functions omitted (i.e., ``external'').
This representation is useful for providing a fast access
to module interfaces.
This file is implicitly generated when a program is compiled with \CYS
and stored in the same directory as \code{prog.fcy}.

\item[\code{prog.pl}:] This file contains a Prolog program
as the result of translating the Curry program with \CYS.

If the Curry module $M$ is stored in the directory $dir$,
the corresponding Prolog program is stored in the directory
\ccode{$dir$/.curry/pakcs}.
This is also the case for hierarchical module names:
if the module $D1.D2.M$ is stored in the directory $dir$
(i.e., the module is actually stored in $dir/D1/D2/M.curry$),
then the corresponding Prolog program is stored in
\ccode{$dir$/.curry/pakcs/D1/D2/prog.pl}.

\item[\code{prog.po}:] This file contains the Prolog program
\code{prog.pl} in an intermediate format for faster loading.
This file is stored in the same directory as \code{prog.pl}.

\item[\code{prog}:] This file contains the executable
after compiling and saving a program with \CYS
(see Section~\ref{sec:pakcs-commands}).

\end{description}


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