

    \section{WHAT IS THIS CHAPTER ABOUT}
    There are four main top-level procedures for
calculating Gr\"{o}bner basis in the
different situations. They are

 \begin{itemize} {\bf
 \item SIMPLE
 \item STAGSIMPLE
 \item NCPBHGROEBNER
 \item MODULEHSERIES }
 \end{itemize}

 In every of them you have some choices. You can switch between
 \begin{itemize}
 \item commutative and noncommutative case
 \item zero or prime characteristic
 \item  screen or file input (output)
 \end{itemize}

 Besides that you may select
 \begin{itemize}
 \item type of information about series,
 \item form of input (output),
 \item ordering,
 \item  strategy of calculations.
 \end{itemize}


 There are three different mechanisms to do your choices:
 either you call appropriate procedure, or you assign
 some value to appropriate global variable or switch
 a corresponding flag.
  \begin{exm} For example \end{exm}
  \begin{itemize}
  \item call the procedure

  {\bf (NONCOMMIFY)}

  select noncommutativity

  \item  assignment

  {\bf (SETQ ALGOUTMODE 'MAPLE)}

  select "Maple" form as output

  \item switching the flag

  {\bf (ON MODLOGARITHMS)}

  selects a strategy of the calculations in the prime characteristic
  using "logarithms tables."
  \end{itemize}
 

The following chapters should explain user how to use main procedures,
variables and flags. First we explain main part of them by the examples
 on the conceptual level, and then give a complete list in the
 alphabetical order.
 
     \section      { SIMPLE TOP-LEVEL PROCEDURES}
\subsection {Procedures  SIMPLE and STAGSIMPLE }
Procedure {\bf SIMPLE}  is already familiar to reader.
It can be applied both in the commutative and noncommutative
case. By default BERGMAN works in the commutative mode. To
turn off commutativity one need to call

{\bf (NONCOMMIFY)}

To return to the commutative case  it is sufficient to call

{\bf (COMMIFY)}

SIMPLE is called as a procedure with 0, 1, or 2 file names as
arguments (file names be given
in explicit form.) If you give no argument, the procedure assumes
that you want to give input in "maple form" (see below subsection
\ref{inputform}) and prompts
you for this. If you give arguments, and the first argument is the
name of an existing file, this is read, and it is assumed that it
(inter alia) contains the input (in one or another form).  If file
does not exists, procedure works as if there were 0 names. Note,
that if input file contains (NONCOMMIFY) or (COMMIFY), the procedure
will work in the corresponding mode (and save it after returning).

 If there
is a second argument, the output is put there. However, if there is
an existing file with this name, it is NOT overwritten and the
procedure inform you about its existence and finish its work
without doing something else.

{\bf STAGSIMPLE} works similarly, but calls on the Staggered linear basis
Algorithm With Substance (SAWS). It thus may only be used in the
commutative case. It takes 0, 1, 2, or 3 arguments; the last two
are for output of the s.a.w.s. deduced Gr\"{o}bner basis and for the
reduced Gr\"{o}bner basis, respectively. In some cases it works
more efficient than {\bf SIMPLE} (see Chapter \ref{SAWS} about
more details).

\subsection{Procedure NCPBHGROEBNER}
NCPBHGROEBNER always takes 4 arguments, which should evaluate to file names.
 The first file is the input file (which must exist).
 The second file will be the Gr\"{o}bner basis output file. It must {\bf not
exist} before the call to NCPBHGROEBNER.
 On the third and fourth files the double Poincar\'{e}-Betti series and
the Hilbert series of the associated monomial ring will be output.
Existing files are overwritten. The output will be done degree by
degree, whence you may read partial results while the calculations
continue (and interrupt the calculations without losing the lower
degree results). Note that the ring and its associated monomial
ring have the same Hilbert series, while the double Poincar\'{e}-Betti
series only fulfill a termwise inequality; due to the existence of
a certain spectral sequence, the coefficients in the P.-B. series
of the associated ring can never be less than the corresponding
coefficients for the `true' ring  (read more in the Chapter
\ref{MATH-APP} about mathematical details).

Note that default output mode is LISP-mode, so do not forget to
change it if you don't like it using for example

{\bf (SETQ ALGOUTMODE 'MAPLE)}



 \subsection {CLEARALL and other procedures}
 All the procedures above are mainly written (interpretatively) in terms
of some other top level procedures:

{\bf DEGREEOUTPREPARE, GROEBNERINIT,
GROEBNERKERNEL, GROEBNERFINISH, STAGTYPECHECKER, AUTOREDUCEINPUT,
STAGGERINIT, STAGGERKERNEL, STAGGERFINISH, DEGREEENDDISPLAY, 
NCPBHDED.}

You may also call these directly, or make your own simple top
level procedures based on them. They are described more carefully after
the input/output format description section (subsection
\ref{functions} ).

But there is one more important top-level function -- {\bf CLEARALL.}
Despite of this name it does not clear all that was done before, but
only clear memory from the results of the previous calculations.

You always SHOULD call this function before starting the new cycle of
the calculations. The only exclusion is when you want to add some
new elements to the already calculated Gr\"{o}bner basis , but for doing this kind of
staff you should be a professional. So, once again, in this chapter:
{\em before the calling second time one of the top-of-the-top procedures, such
as} {\bf SIMPLE, NCPBHSERIES} {\em always call}

{\bf (CLEARALL)}

You need not do it from the very beginning, but you need to know
what it really clears. {\em It clears:}
 \begin{itemize}
 \item initial relations,
 \item calculated Gr\"{o}bner basis,
 \item all the memory, used for the calculations.
 \end{itemize}

{\em  It saves:}
  \begin{itemize}
  \item the variables in its number - embedding dimensions.
  \item all selected modes (see subsection \ref{modes}), including
   commutativity status.
  \end{itemize}

You can use this: {\em Do not introduce the same set of the generators,
skipping } {\bf setinvars}

 \begin{exm}  HERE EXAMPLE
 \end{exm}

