% generated by GAPDoc2LaTeX from XML source (Frank Luebeck)
\documentclass[11pt]{report}
\usepackage{a4wide}
\sloppy
\pagestyle{myheadings}
\usepackage{amssymb}
\usepackage[latin1]{inputenc}
\usepackage{makeidx}
\makeindex
\usepackage{color}
\definecolor{DarkOlive}{rgb}{0.1047,0.2412,0.0064}
\definecolor{FireBrick}{rgb}{0.5812,0.0074,0.0083}
\definecolor{RoyalBlue}{rgb}{0.0236,0.0894,0.6179}
\definecolor{RoyalGreen}{rgb}{0.0236,0.6179,0.0894}
\definecolor{RoyalRed}{rgb}{0.6179,0.0236,0.0894}
\definecolor{LightBlue}{rgb}{0.8544,0.9511,1.0000}
\definecolor{Black}{rgb}{0.0,0.0,0.0}
\definecolor{FuncColor}{rgb}{1.0,0.0,0.0}
%% strange name because of pdflatex bug:
\definecolor{Chapter }{rgb}{0.0,0.0,1.0}

\usepackage{fancyvrb}

\usepackage{pslatex}

\usepackage{amstex}\usepackage[
        a4paper=true,bookmarks=false,pdftitle={Written with GAPDoc},
        colorlinks=true,backref=page,breaklinks=true,linkcolor=RoyalBlue,
        citecolor=RoyalGreen,filecolor=RoyalRed,
        urlcolor=RoyalRed,pagecolor=RoyalBlue]{hyperref}

% write page numbers to a .pnr log file for online help
\newwrite\pagenrlog
\immediate\openout\pagenrlog =\jobname.pnr
\immediate\write\pagenrlog{PAGENRS := [}
\newcommand{\logpage}[1]{\protect\write\pagenrlog{#1, \thepage,}}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\C}{\mathbb{C}}
\newcommand{\Z}{\mathbb{Z}}
\newcommand{\N}{\mathbb{N}}
\newcommand{\F}{\mathbb{F}}

\newcommand{\GAP}{\textsf{GAP}}

\newsavebox{\backslashbox}
\sbox{\backslashbox}{\texttt{\symbol{92}}}
\newcommand{\bs}{\usebox{\backslashbox}}

\begin{document}

\logpage{[ 0, 0, 0 ]}
\begin{titlepage}
\begin{center}{\Huge \textbf{ \textsf{Singular} }}\\[1cm]
\markright{\scriptsize \mbox{}\hfill  \textsf{Singular}  \hfill\mbox{}}
{Version 4.04.15}\\[1cm]
\mbox{}\\[2cm]
{\large \textbf{ Marco Costantini   }}\\
{\large \textbf{Willem A. de Graaf   }}\\
\end{center}\vfill

\mbox{}\\
{\mbox{}\\
\small \noindent \textbf{ Marco Costantini   } --- Email: \href{mailto:// costanti@science.unitn.it }{\texttt{ costanti@science.unitn.it }}\\
 --- Homepage: \href{http://www-math.science.unitn.it/~costanti/}{\texttt{http://www-math.science.unitn.it/\~{}costanti/}}}\\
{\mbox{}\\
\small \noindent \textbf{Willem A. de Graaf   } --- Email: \href{mailto:// quagroup@hetnet.nl}{\texttt{ quagroup@hetnet.nl}}\\
 --- Homepage: \href{http://www-circa.mcs.st-and.ac.uk/~wdg/}{\texttt{http://www-circa.mcs.st-and.ac.uk/\~{}wdg/}}}\\
\end{titlepage}

\newpage\setcounter{page}{2}
{\small 
\section*{Copyright}
\logpage{[ 0, 0, 1 ]}
{\copyright} 2003 Marco Costantini and Willem A. de Graaf 

 }\\[1cm]
\newpage

\def\contentsname{Contents\logpage{[ 0, 0, 2 ]}}

\tableofcontents
\newpage

 
\chapter{\textcolor{Chapter }{The \textsf{GAP} interface to \textsf{Singular} }}\logpage{[ 1, 0, 0 ]}
{
  This is the manual of the \textsf{GAP} package ``\textsf{singular}'' that provides an interface to the \textsf{Singular} computer algebra system. One of the main things provided by this interface is
a function for computing Groebner bases of ideals in polynomial rings. This
function uses the \textsf{Singular} implementation, which is very fast. 

 This manual is yet incomplete, and the next version will be released shortly. 
\section{\textcolor{Chapter }{Background}}\logpage{[ 1, 1, 0 ]}
{
  The interface to \textsf{Singular} relies on the Gap function \mbox{\texttt{InputOutputLocalProcess}} (see the \textsf{GAP} manual), and this function is available only in Gap 4.2 (or newer) for an Unix
environment or in Gap 4.4 (or newer) for Windows with Cygwin; auto-detection
is used. In the case that the Gap function \mbox{\texttt{InputOutputLocalProcess}} is not available, then the singular interface will use the Gap function \mbox{\texttt{Process}}; however in this case only a limited subset of the functionalities of the
interface will be available: for example \mbox{\texttt{StartSingular}} and \texttt{GeneratorsOfInvariantRing} (\ref{GeneratorsOfInvariantRing}) are not available, but \texttt{GroebnerBasis} (\ref{GroebnerBasis}) is. }

 
\section{\textcolor{Chapter }{How things are started}}\logpage{[ 1, 2, 0 ]}
{
  In order to use this interface one must have \textsf{GAP}4, and \textsf{Singular} installed. \textsf{Singular} can be obtained for free from \href{http://www.singular.uni-kl.de}{\texttt{http://www.singular.uni-kl.de}}. 

 Then in order to use the interface, \textsf{GAP} has to be told where to find \textsf{Singular}. This can be done in three ways. First, if the \textsf{Singular} executable file is in the search path, then \textsf{GAP} will find it. Second, it is possible to edit one of the first lines of the
file \mbox{\texttt{singular/gap/singular.g}} (that comes with this package). Third, it is possible to give the path of the \textsf{Singular} executable file during the \textsf{GAP} session assigning it to the variable \mbox{\texttt{sing\_exec}} (after this package has been loaded). For example: 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> LoadPackage("singular");
  The GAP interface to Singular
  true
  gap> sing_exec:= "/home/wdg/Singular/2-0-3/ix86-Linux/Singular";;
\end{Verbatim}
 After the interface has been loaded, \textsf{Singular} is started when one of the functions of the interface is called.
Alternatively, one can start \textsf{Singular} with the command 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  StartSingular();
\end{Verbatim}
 If at some point \textsf{Singular} is no longer needed, then it can be closed with the command 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  CloseSingular();
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{InfoSingular}}
\logpage{[ 1, 2, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{InfoSingular\index{InfoSingular@\texttt{InfoSingular}}
\label{InfoSingular}
}\hfill{\scriptsize (info class)}}\\


 This is the info class used by the interface. It can be set to levels 0, 1, 2,
3. At level 0 no information is printed on the screen. At level 1 (default)
the interface prints a message when it starts \textsf{Singular}. At level 2, information on the activities of the interface are printed
(e.g., when a Groebner basis calculation is started, or terminated). At level
3 all strings that \textsf{GAP} sends to \textsf{Singular} are printed, as well as all strings that \textsf{Singular} sends back. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SetInfoLevel( InfoSingular, 2 );
  gap> G:= SymmetricGroup( 3 );;
  gap> R:= PolynomialRing( GF(2), 3 );;
  gap> GeneratorsOfInvariantRing( R, G );
  #I  using temporary Directory("/tmp/tmp.9Aqqkx/")
  #I  Started Singular (version 2003)
  [ x_1+x_2+x_3, x_1*x_2+x_1*x_3+x_2*x_3, x_1*x_2*x_3 ]
  gap> I:= Ideal( R, last );;
  gap> GroebnerBasis( I );
  #I  running GroebnerBasis...
  #I  done GroebnerBasis.
  [ x_1+x_2+x_3, x_2^2+x_2*x_3+x_3^2, x_3^3 ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{The functions of the package}}\logpage{[ 1, 3, 0 ]}
{
  

\subsection{\textcolor{Chapter }{TermOrdering}}
\logpage{[ 1, 3, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{TermOrdering( R )\index{TermOrdering@\texttt{TermOrdering}}
\label{TermOrdering}
}\hfill{\scriptsize (attribute)}}\\


 All non-trivial algorithms in \textsf{Singular} require the prior definition of a (polynomial) ring, and any polynomial (resp.
vector) in \textsf{Singular} is ordered w.r.t. a term ordering (or, monomial ordering), which has to be
specified together with the declaration of a ring; see the documentation of \textsf{Singular}, paragraph ``3.3 Rings and orderings''. 

 Let \mbox{\texttt{R}} be a polynomial ring. The value of \mbox{\texttt{TermOrdering ( R )}} can be a string, a list, or a monomial ordering of Gap. If it is a string, for
instance one of \mbox{\texttt{"lp"}} (lexicographical ordering), \mbox{\texttt{"dp"}} (degree reverse lexicographical ordering), or \mbox{\texttt{"Dp"}} (degree lexicographical ordering), this string will be passed to \textsf{Singular} without being interpreted. It can also be a list of two elements, namely a
string, and a list of positive integers. In that case the string has to be \mbox{\texttt{"wp"}} (weighted reverse lexicographical ordering) or \mbox{\texttt{"Wp"}} (weighted lexicographical ordering); the second element is a list of length
equal to the number of variables of the ring \mbox{\texttt{R}}, that specifies the degree of each variable. 

 \mbox{\texttt{SetTermOrdering}} can be used to set the term ordering of a ring. The term ordering must be set
before the ring is sent to \textsf{Singular}, see \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}). If no term ordering is set, then the default \mbox{\texttt{"dp"}} will be used. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> SetTermOrdering( R, [ "wp", [1,1,2] ] );
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SingularSetBaseRing}}
\logpage{[ 1, 3, 2 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SingularSetBaseRing( R )\index{SingularSetBaseRing@\texttt{SingularSetBaseRing}}
\label{SingularSetBaseRing}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{R}} is a polynomial ring. This function sets the base ring in \textsf{Singular} equal to \mbox{\texttt{R}}. After this, all functions of the interface will work with this ring.
However, for some functions it is not necessary to explicitly set the base
ring first. This will be specified for each function in the corresponing
section of this manual. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> SingularSetBaseRing( R );
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SingularLibrary}}
\logpage{[ 1, 3, 3 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SingularLibrary( string )\index{SingularLibrary@\texttt{SingularLibrary}}
\label{SingularLibrary}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{string}} is a string containing the name of a \textsf{Singular} library. This function makes sure that this library is loaded into \textsf{Singular}. For some functionality of \textsf{Singular} this is necessary, see the example in \texttt{SingularInterface} (\ref{SingularInterface}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SingularLibrary( "general.lib");
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SingularHelp}}
\logpage{[ 1, 3, 4 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SingularHelp( topic )\index{SingularHelp@\texttt{SingularHelp}}
\label{SingularHelp}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{topic}} is a string containing the name of a \textsf{Singular} topic. This function provides an help on that topic using the \textsf{Singular} help system; see the \textsf{Singular} documentation, paragraphs ``3.1.3 The online help system'' and ``5.1.43
help''. If \mbox{\texttt{topic}} is the empty string, then the title page of the manual is displayed. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SingularHelp("");
  #I  // ** Displaying help in browser 'mozilla'.
  // ** Use 'system("--browser", <browser>);' to change browser,
  // ** where <browser> can be: "mozilla", "xinfo", "info", "builtin", "dummy", \
  "emacs".
\end{Verbatim}
 The \textsf{Singular} function \mbox{\texttt{system}} can be accessed with the function \texttt{SingularInterface} (\ref{SingularInterface}). }

 

\subsection{\textcolor{Chapter }{GroebnerBasis}}
\logpage{[ 1, 3, 5 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GroebnerBasis( I )\index{GroebnerBasis@\texttt{GroebnerBasis}}
\label{GroebnerBasis}
}\hfill{\scriptsize (operation)}}\\


 Here \mbox{\texttt{I}} is an ideal of a polynomial ring. This function computes a Groebner basis of \mbox{\texttt{I}}. For this function it is \emph{not} necessary to set the base ring with \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}). 

 As term ordering \textsf{Singular} will use the value of \texttt{TermOrdering} (\ref{TermOrdering}) (of the corresponding ring). Again, if this value is not set, then the degree
reverse lexicographical ordering will be used (\mbox{\texttt{"dp"}}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> i:= IndeterminatesOfPolynomialRing(R);;
  gap> x:= i[1]; y:= i[2]; z:= i[3];
  x
  y
  z
  gap> r:= [ x*y*z -x^2*z, x^2*y*z-x*y^2*z-x*y*z^2, x*y-x*z-y*z];;
  gap> I:= Ideal( R, r );
  <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (3 generators)>
  gap> GroebnerBasis( I );
  [ x*y-x*z-y*z, x^2*z-x*z^2-y*z^2, x*z^3+y*z^3, -x*z^3+y^2*z^2-y*z^3 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SINGULARGBASIS}}
\logpage{[ 1, 3, 6 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SINGULARGBASIS\index{SINGULARGBASIS@\texttt{SINGULARGBASIS}}
\label{SINGULARGBASIS}
}\hfill{\scriptsize (global variable)}}\\


 This is a record containing the component \mbox{\texttt{GroebnerBasis}}. When this record is assigned to the global record \mbox{\texttt{GBASIS}}, then the computation of a Groebner basis via \textsf{GAP}'s internal function for that (\mbox{\texttt{GroebnerBasis}}, see the \textsf{GAP} manual) are done by \textsf{Singular}. 

 \textsf{Singular} claims that it ``features one of the fastest and most general implementations
of various algorithms for computing Groebner bases''. The \textsf{GAP}'s internal function claims to be ``a na{\"\i}ve implementation of
Buchberger's algorithm (which is mainly intended as a teaching tool): it might
not be sufficient for serious problems.'' Currently, the term orderings that
can be used with this function are \mbox{\texttt{MonomialLexOrdering}}, \mbox{\texttt{MonomialGrevlexOrdering}}, \mbox{\texttt{MonomialGrlexOrdering}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, 3 );;
  gap> i:= IndeterminatesOfPolynomialRing( R );;
  gap> pols:= [i[1]+i[2]+i[3], i[1]*i[2]+i[1]*i[3]+i[2]*i[3], i[1]*i[2]*i[3]];;
  gap> o:= MonomialLexOrdering();;
  gap> GroebnerBasis( pols, o );   # This is the internal GAP method.
  [ x_1+x_2+x_3, x_1*x_2+x_1*x_3+x_2*x_3, x_1*x_2*x_3, -x_2^2-x_2*x_3-x_3^2,
    x_3^3 ]
  gap> GBASIS:= SINGULARGBASIS;;
  gap> GroebnerBasis( pols, o ); # Now this uses Singular.
  [ x_3^3, x_2^2+x_2*x_3+x_3^2, x_1+x_2+x_3 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{HasTrivialGroebnerBasis}}
\logpage{[ 1, 3, 7 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{HasTrivialGroebnerBasis( I )\index{HasTrivialGroebnerBasis@\texttt{HasTrivialGroebnerBasis}}
\label{HasTrivialGroebnerBasis}
}\hfill{\scriptsize (function)}}\\


 This returns \mbox{\texttt{true}} if the Groebner basis of the ideal \mbox{\texttt{I}} is trivial, false otherwise. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> i:= IndeterminatesOfPolynomialRing(R);;
  gap> x:= i[1];; y:= i[2];; z:= i[3];;
  gap> f:= (x*y-z)*(x*y*z+y^2*z+x^2*z);;
  gap> g:= (x*y-z)*(x*y*z^2+x*y^2*z+x^2*y*z);;
  gap> I:= Ideal( R, [f,g] );;
  gap> HasTrivialGroebnerBasis( I );
  false
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{GcdUsingSingular}}
\logpage{[ 1, 3, 8 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GcdUsingSingular( arg )\index{GcdUsingSingular@\texttt{GcdUsingSingular}}
\label{GcdUsingSingular}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{arg}} are (possibly multivariate) polynomials separated by commas, or it is a list
of polynomials. This function returns the greatest common divisor of these
polynomials. For this function it is \emph{necessary} for the polynomials to lie in the base ring, as set by \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> i:= IndeterminatesOfPolynomialRing(R);;
  gap> x:= i[1];; y:= i[2];; z:= i[3];;
  gap> f:= (x*y-z)*(x*y*z+y^2*z+x^2*z);
  x^3*y*z+x^2*y^2*z+x*y^3*z-x^2*z^2-x*y*z^2-y^2*z^2
  gap> g:= (x*y-z)*(x*y*z^2+x*y^2*z+x^2*y*z);
  x^3*y^2*z+x^2*y^3*z+x^2*y^2*z^2-x^2*y*z^2-x*y^2*z^2-x*y*z^3
  gap> SingularSetBaseRing( R );
  gap> GcdUsingSingular( f, g );
  -x*y*z+z^2
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{FactorsUsingSingularNC}}
\logpage{[ 1, 3, 9 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{FactorsUsingSingularNC( f )\index{FactorsUsingSingularNC@\texttt{FactorsUsingSingularNC}}
\label{FactorsUsingSingularNC}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{f}} is a (multivariate) polynomial. This function returns the factorization of \mbox{\texttt{f}} into irreducible factors. The function does not check that the product of
these factors gives \mbox{\texttt{f}} (for that use \texttt{FactorsUsingSingular} (\ref{FactorsUsingSingular})): \textsf{Singular} version 2-0-3 contains a bug so that the command \mbox{\texttt{factorize}} may give wrong results. For this function it is \emph{necessary} that \mbox{\texttt{f}} lies in the base ring, as set by \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> i:= IndeterminatesOfPolynomialRing(R);;
  gap> x:= i[1];; y:= i[2];; z:= i[3];;
  gap> f:= (x*y-z)*(x*y*z+y^2*z+x^2*z);
  x^3*y*z+x^2*y^2*z+x*y^3*z-x^2*z^2-x*y*z^2-y^2*z^2
  gap> SingularSetBaseRing( R );
  gap> FactorsUsingSingularNC( f );
  [ 1, -x^2-x*y-y^2, -x*y+z, z ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{FactorsUsingSingular}}
\logpage{[ 1, 3, 10 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{FactorsUsingSingular( f )\index{FactorsUsingSingular@\texttt{FactorsUsingSingular}}
\label{FactorsUsingSingular}
}\hfill{\scriptsize (function)}}\\


 This does the same as \texttt{FactorsUsingSingularNC} (\ref{FactorsUsingSingularNC}), except that on the \textsf{GAP} level it is checked that the product of these factors gives \mbox{\texttt{f}}. Again it is \emph{necessary} that \mbox{\texttt{f}} lies in the base ring, as set by \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}). }

 

\subsection{\textcolor{Chapter }{GeneratorsOfInvariantRing}}
\logpage{[ 1, 3, 11 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{GeneratorsOfInvariantRing( R, G )\index{GeneratorsOfInvariantRing@\texttt{GeneratorsOfInvariantRing}}
\label{GeneratorsOfInvariantRing}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{R}} is a polynomial ring, and \mbox{\texttt{G}} a finite group, which is either a matrix group or a permutation group. If it
is a matrix group then its degree must be less than or equal to the number of
indeterminates of \mbox{\texttt{R}}. If it is a permutation group, then its maximal moved point must be less than
or equal to the number of indeterminates of \mbox{\texttt{R}}. This function computes a list of generators of the invariant ring of \mbox{\texttt{G}}, corresponding to its action on \mbox{\texttt{R}}. This action is taken to be from the left. 

 For this function it is \emph{not} necessary to set the base ring with \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> m:=[[1,1,1],[0,1,1],[0,0,1]]*One(GF(3));;
  gap> G:= Group( [m] );;
  gap> R:= PolynomialRing( GF(3), 3 );
  PolynomialRing(..., [ x_1, x_2, x_3 ])
  gap> GeneratorsOfInvariantRing( R, G );
  [ x_3, x_1*x_3+x_2^2+x_2*x_3, x_1^3+x_1^2*x_3-x_1*x_2^2-x_1*x_2*x_3 ]
\end{Verbatim}
 }

 

\subsection{\textcolor{Chapter }{SingularInterface}}
\logpage{[ 1, 3, 12 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SingularInterface( singcom, arguments, type\_output )\index{SingularInterface@\texttt{SingularInterface}}
\label{SingularInterface}
}\hfill{\scriptsize (function)}}\\


 Here \mbox{\texttt{singcom}} is a \textsf{Singular} command (given as a string), \mbox{\texttt{arguments}} is a list of \textsf{GAP} objects, and \mbox{\texttt{type\_output}} is the type of the output in \textsf{Singular} (given as a string). The \mbox{\texttt{type\_output}} is one of following: "def", "ideal", "int", "intmat", "intvec", "link",
"list", "map", "matrix", "module", "number", "poly", "proc", "qring",
"resolution", "ring", "string", "vector" (or the empty string "", if no output
is expected). If in doubt you can use "def". This function tries to pass the \textsf{GAP} objects to \textsf{Singular} and apply the function \mbox{\texttt{singcom}} to it. Finally it tries to convert the result back to \textsf{GAP}. 

 \mbox{\texttt{arguments}} may also be a string: in this case it is assumed that it contains one or more \textsf{Singular} identifiers, and it is passed to \textsf{Singular} without parsing or checking.

 As this is a rather general function, it is not guaranteed that it always
works. When passing polynomials (or vectors, matrices) to \textsf{Singular}, it is a good idea to first set the base ring with \texttt{SingularSetBaseRing} (\ref{SingularSetBaseRing}) in order to ensure that \textsf{Singular} knows about it. (This is not necessary if the input is a ring or an ideal.) 

 In the next example we compute the primary decomposition of an ideal. Note
that for that we need to load the \textsf{Singular} library \mbox{\texttt{primdec.lib}}. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> R:= PolynomialRing( Rationals, ["x","y","z"] );;
  gap> i:= IndeterminatesOfPolynomialRing(R);;
  gap> x:= i[1];; y:= i[2];; z:= i[3];;
  gap> f:= (x*y-z)*(x*y*z+y^2*z+x^2*z);;
  gap> g:= (x*y-z)*(x*y*z^2+x*y^2*z+x^2*y*z);;
  gap> I:= Ideal( R, [f,g] );;
  gap> SingularLibrary("primdec.lib");
  gap> SingularInterface("primdecGTZ", [ I ], "def" );
  #I  Singular type "list"
  [ [ <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (1 generators)>,
        <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (1 generators)> ]
      ,
    [ <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (1 generators)>,
        <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (1 generators)> ]
      ,
    [ <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (2 generators)>,
        <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (2 generators)> ]
      ,
    [ <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (3 generators)>,
        <two-sided ideal in PolynomialRing(..., [ x, y, z ]), (2 generators)>
       ] ]
\end{Verbatim}
 }

 }

 
\section{\textcolor{Chapter }{Troubleshooting}}\logpage{[ 1, 4, 0 ]}
{
  As every software, also this package may contain bugs. If you find a bug, or a
missing feature, or some other problems, or if you need some help, write an
e-mail to both the authors. Please use an e-mail subject that begins with ``\mbox{\texttt{singular package: }}''. Please include in the report the code that cause the problem, so that we
can replicate the problem. If appropriate, you may set \texttt{InfoSingular} (\ref{InfoSingular}) to \mbox{\texttt{3}}, to see what happens between \textsf{GAP} and \textsf{Singular} (but this may give a lot of output). 

 The probability that your problem will be fixed quickly increases if you read
the text ``How to Report Bugs Effectively'', \href{http://www.chiark.greenend.org.uk/~sgtatham/bugs.html}{\texttt{http://www.chiark.greenend.org.uk/\~{}sgtatham/bugs.html}} , and send a bug report according to this text. 

 The following performs a test of the package functionality (see the \textsf{GAP} documentation ``Test Files''). 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> fn := Filename( DirectoriesPackageLibrary( "singular", "tst" ), "test" );
  "/usr/local/gap_dev/4.0/pkg/singular/tst/test"
  gap> ReadTest( fn );
  true
\end{Verbatim}
 

\subsection{\textcolor{Chapter }{SingularReportInformations}}
\logpage{[ 1, 4, 1 ]}\nobreak
{\noindent\textcolor{FuncColor}{$\Diamond$\ \texttt{SingularReportInformations(  )\index{SingularReportInformations@\texttt{SingularReportInformations}}
\label{SingularReportInformations}
}\hfill{\scriptsize (function)}}\\


 The function \mbox{\texttt{SingularReportInformations()}} collects a description of the system, that should be included in any bug
report. 
\begin{Verbatim}[fontsize=\small,frame=single,label=Example]
  gap> SingularReportInformations();
  Gap_Version := "4.dev";
  Gap_Architecture := "i686-pc-linux-gnu-gcc";
  Gap_BytesPerVariable := 4;
  uname := "Linux 2.4.20 i686";
  Singular_Version: := 2004;
  Singular_Name: := "/usr/local/Singular/2-0-4/ix86-Linux/Singular";
  
  "Gap_Version := \"4.dev\";\nGap_Architecture := \"i686-pc-linux-gnu-gcc\";\nGa\
  p_BytesPerVariable := 4;\nuname := \"Linux 2.4.20 i686\";\nSingular_Version: :\
  = 2004;\nSingular_Name: := \"/usr/local/Singular/2-0-4/ix86-Linux/Singular\";\
  \n"
\end{Verbatim}
 }

 }

 }

 \def\indexname{Index\logpage{[ "Ind", 0, 0 ]}}


\printindex

\newpage
\immediate\write\pagenrlog{["End"], \arabic{page}];}
\immediate\closeout\pagenrlog
\end{document}
