\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.

Usually, the auxiliary files are invisible:
if the Curry module $M$ is stored in directory $dir$,
the corresponding auxiliary files are stored in directory
\ccode{$dir$/.curry/pakcs-$v$} where $v$ is the version of \CYS.
Thus, the auxiliary files produced by different versions of \CYS
causes no conflicts.
This scheme is also used for hierarchical module names:
if the module $D1.D2.M$ is stored in directory $dir$
(i.e., the module is actually stored in $dir/D1/D2/M.curry$),
then the corresponding Prolog program is stored in directory
\ccode{$dir$/.curry/pakcs-$v$/D1/D2}.

\medskip

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.

\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.icurry}:] This file contains the interface
of the program used by the front end for modular compilation.

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

\item[\code{prog.po}:] This file contains the Prolog program
\code{prog.pl} in an intermediate format for faster loading
with SICStus-Prolog.

\item[\code{prog}:] This file contains the executable
after compiling and saving a program with \CYS
(see Section~\ref{sec:pakcs-commands}).
In contrast to the auxuiliary files, it is stored
in the main directory.

\end{description}


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