\section{SELECTING MODES} \label{modes}

\subsection{Variable names and the flag  RAISE. Ordering }

We start from the variables -- generators of our algebras (modules).
Their names  may be specified
to almost any valid LISP identifiers. (Some special signs, like $*$ and
$^,$ cannot be used unslashified in the identifier names.)
So, not only usual letters such as x,Y may be used, but also
x1,Y45 or even I\_ kiss\_ you\_ 1000\_ times can be used as a variable.
But do not try $x[1]$ or $Y(2)$ as names!
In any place you may have a look to your current list of variables:

{\bf (GETINVARS)}
\begin{exm}
\begin{verbatim}
6 lisp> (GETINVARS)
(!x !y !z)
\end{verbatim}  
\end{exm}  


One important question is if the names "y" and "Y" represent the same
variable. The answer depend on the current value of the flag
{\bf RAISE}. If it is in the state OFF, they are different, otherwise
(if it is in the state ON) "y"="Y".

The meaning of this flag is to translate all the letters to the
capitals. Important notes, concerning this flag:
 \begin{enumerate}
 \item From very beginning the value of this flag is ON. That is
 why you can write {\bf (simple)} instead of {\bf (SIMPLE)}
 \item Most the procedures, available to user have capital names.
 Nevertheless several procedures turn OFF the flag while they
 are working. If break loop (for example because of mistake)
 happens during their work the value of the flag will be OFF
 and, for example, you will be unable to quit from the program
 writing

 {\bf (quit)}

 because in this case the name should be capitalised:

{\bf (QUIT)}

 Another way to quit is

 {\bf (ON RAISE)}

  {\bf (quit)}

  \item Note, that turning ON this flag you loose access to all
  the procedures and variables with the names, containing small letter,
  such as   SecretProcedure. Idea is that they should be unavailable
  to the usual user, being absolutely internal and private. Nevertheless
  user can sometimes see their names, where small letter are printed after
  exclamations: S!e!c!r!e!tP!r!o!c!e!d!u!r!e. Even the multiplication
  is secret in this mode and looks as !*.
  But normally you need not care about this and turn OFF the
  RAISE flag.


 \end{enumerate}
 The last important thing we should say about variables is their ordering.
 It is important for Gr\"{o}bner basis calculations which of variables is highest
 (largest). The rule is determined by the order of the variables,
 written after {\bf vars } in one of the top-of-the-top
 procedures and is as follows:
  \begin{itemize}
  \item in the noncommutative mode the last variable is always highest.
  \item in the commutative mode first variable is highest
  from the very beginning or after the
  calling the procedure

  {\bf (DEGLEXIFY)}

  \item in the commutative mode  the last variable is  highest after the
  calling the procedure

  {\bf (REVLEXIFY)}


  \end{itemize}

 % \begin{exm} -------------To be rewritten---------------------
 %   
 %   Suppose that
 %\end{exm}   {\bf setinvars x, y, z }
 %   {\em was written. Then we have:}
 %   \begin{itemize} 
 %     \item \verb+ y*z*z >x*z*y > x*y*y + in the noncommutative mode
 %    \item \verb+ y*z*z >x*y*z (=x*z*y) > x*y*y + in the noncommutative mode
    
%\end{itemize}

   \subsection{INPUT--OUTPUT MODES\\ FOR THE POLYNOMIALS}
   \label{inputform}

There are three basic output formats, named LISP (default), ALG
(its synonym  is also MAPLE), and
MACAULAY, corresponding to the formats, used in those 3  languages.
The first two of these also are acceptable input formats.
In all input and output, the polynomials are distributed (written with
no parentheses). There is a difference between commutative and
noncommutative case.
 \begin{description}
  \item{{\bf Commutative case}}

 The (output) ALG  representation of the  polynomial is
$$c_1*v_1\wedge m_{11}*\ldots *v_n\wedge m_{1n}+ \ldots
+ c_r*v_1\wedge m_{r1}* \ldots *v_n\wedge m_{rn} .$$
Here $v_1, \ldots , v_n$ stand for the variable names, $m_{ij}$
for the exponents,
and $c_i$ for the coefficients. Highest terms will be printed first.

Occurrences of $*v_i\wedge 0$ and of $\wedge 1$ are omitted.
+ is omitted before $-$ .
The MACAULAY representation is similar, but without $*$ and $\wedge$; and the
polynomials then are not separated by commata.
In input, some slight variation is allowed in the ALG format:
 \begin{itemize}
  \item $**$ may be used instead of $\wedge$;
 \item Blank space may be inserted everywhere, except within identifiers
   or integers or between two successive $**$ .
 \item Exponents 0 and 1 may occur.
 \item The order of the variables in a monomial is arbitrary.
\end{itemize}


The LISP representation of the same commutative polynomial in n variables is a
lisp list of length n+1 lists of integers:
$$((c_1\ m_{11}\ \ldots m_{1n}) \ldots (c_r\ m_{r1}\ \ldots m_{rn}))$$
where the CAR of the i:th list is the coefficient of the i:th monomial,
and the other n integers (which should be non-negative) are the
exponents.  Highest terms will be printed first in the output.

%\begin{exm} ------------------To be written--------------------
%\end{exm}  

\item{{\bf Non--commutative case}}

 LISP form (homogeneous) polynomial of
degree $d$ is a list of lists of integers of length $d+1:$
$$((c_1\ m_{11}\ \ldots  m_{1d}) \ldots (c_r\ m_{r1}\ \ldots m_{rd}))                 $$
where the CAR of the i:th list is the coefficient of the i:th monomial,
and the other n integers (which should be positive) are the "indices"
of the variables, i. e., their position if they are ordered by increasing
significance. The corresponding ALG format is
$$c_1*v_{m_{11}}*...*v_{m_{1d}}+ ... +c_r*v_{m_{r1}}*...*v_{m_{rd}} .$$
In input, identical factors may be collected to exponents. E. g., if
the variables are $x,y,$ and $z$ (in this order), then the LISP form
polynomial $((5\ 1\ 1\ 1\  3\  2\  2))$ will be ALG form output as
$5*x*x*x*z*y*y,$
but it may optionally be input as $5*x**3*z*y\wedge 2.$
Highest terms will be printed first in the output.


\end{description}

If you want to have output in ALG or MACAULAY form, you in one way or
another must define the variable names, and you must set the global
variable ALGOUTMODE to ALG or MACAULAY. The variable names are most
easily given by setinvars within a ALGFORMINPUT, as explained below.

 You may add your own algebraic output mode options by means
of\\ ADDALGOUTMODE, as explained below.

In order to perform LISP mode input, write

{\bf (LISPFORMINPUT) }

pol1 pol2 ..... pols

{\bf (LISPFORMINPUTEND)}

where pol1, ..., pols are polynomials on LISP form. If you must specify
the number of variables to a number $n$ (as in the non-commutative case,
if you want to know the Hilbert series), then set EMBDIM to $n$. (EMBDIM
is short for "the embedding dimension".)

In order to perform ALG mode input, write


{\bf (ALGFORMINPUT)  }

{\bf vars v1, ...,vn;}

{\bf pol1, ... , pols;}

where v1, ..., vn are the variable names and pol1, ..., pols are
polynomials on ALG form.

COMMENTS:

\begin{enumerate}
 \item Both ALGFORMINPUT parts, i. e., the input variable setting and the
   polynomial listing, are optional. You may thus give LISP form input,
   but perform (ALGFORMINPUT) vars v1,...,vn; ; (NOTE the double ;),
   in order to enable ALG or MACAULAY output. Of course, if you try
   to ALGFORMINPUT polynomials when the variables are not set, you are in
   trouble.
 \item New successful (and non-empty) polynomial inputs replace old ones.
   Likewise, new successful input variable settings replace old ones.
   Running GROEBNERKERNEL (successfully) or CLEARIDEAL kills the input
   polynomials, but not the variable settings.
 \item The implementation of ALGFORMINPUT depends on specific PSL features,
   since the pure Standard Lisp has poor alternative scanning abilities.
   If ALGFORMINPUT should be disabled in some other implementation, and
   you still wish to use algebraic output modes, then you must define
   the variable names in another way, using the internal
   representations. In BERGMAN 0.9*, the output variable settings
   performed  by

        vars x,y,z;

   in the commutative case corresponds to

        (SETQ O!u!tV!a!r!s (QUOTE (!x !y !z)))

   and in the non-commutative case corresponds to

        (SETQ O!u!tV!a!r!s (QUOTE ((1 . !x) (2 . !y) (3 . !z))))  .

        \end{enumerate}
 

\subsection {STRATEGIES}
The last important mode choice that should be mentioned is selecting
the strategy of the calculations. Besides selecting of the
algorithm (commutative or noncommutative, Buchberger or staggered)
that you are doing selecting by appropriate procedure, you have
some influence on the intermediate calculation. Choosing

{\bf (ON IMMEDIATEFULLREDUCTION) }

(and this is default) you demand immediate reduction of all the terms
of your Gr\"{o}bner basis  and obtain it in the reduced form.
Sometimes it might be
more efficient to switch OFF this flag. The obtained Gr\"{o}bner basis  may be
not reduced, but calculations might be slightly faster. There is no
clear receipts when it happens - try yourself!

%\subsection{series} \label{series}
%----------------To be Written---------
