\documentclass[11pt]{article}
\newcommand{\bg}{Gr\"obner basis }
\newcommand{\gb}{Gr\"obner basis }
\newcommand{\hs}{Hilbert series }
\newcommand{\ps}{Poincar\'{e} series }
\newtheorem{exm}{Example\\}
\title{Computer Algebra Package Bergman: Interface }
\date{}
\author{J\"{o}rgen Backelin,  Svetlana Cojocaru, Victor Ufnarovski}
\begin{document}
\maketitle

%\chapter{User interface}

 The communication  between user and {\bf bergman}
can be implemented in different ways. One that we have considered in the
 previous sections is by programming in LISP: 
choosing parameters and flags, and applying the corresponding setup procedures.
It is a good way for a user experienced in programming and desiring to
get maximum possibile of {\bf bergman}.

We take also into account different users that need more or 
less routine 
 calculations in the repeating environment performed 
 as easy as possible, preferable without any programming at all. 
A friendly interface  may be for such users one of main reasons to prefer
{\bf bergman} to any other system. In this chapter we describe how
looks the interface that {\bf bergman} suggests.

In the very beginning it is impossible to guess what the user wants exactly.
That is why he needs to describe his preferences in a dialog and this
is the only  part of a  boring work for him, when he should be patient.
But this should be done
only once and later the system will do exactly he wants without any
essential troubles for the user. According to his preferences, a personalized 
profile will be created. It establishes the preferable setup immediately after
starting  {\bf bergman} and user identification.  It is possible to have a 
number of profiles for each user, depending on the class of problems he is 
interested to solve. Moreover, it is possible to make some changes in a profile,
permanent or valid during the current session.

The user can skip some questions: then a standard {\bf bergman} default
setup values will be used as described in the previous chapters. 
Recall that {\bf bergman} calculates by default only
the commutative \gb{} in characteristics zero.

It is presumed that user is familiar with {\bf bergman} manual, but in fact
one can skip its preliminary reading and use instead the on-line help directly
from the interface in order to obtain some explanations.


\section{Main dialog}
{\bf Bergman} can be considered as a theater for one \gb{} calculation. A user 
can visit this theater and see the desired performance  being its
 main director.
 But  this theater has not so many different plays, and if he wants to 
visit the Bergman theater many times, it seems to be reasonable to describe
 from the very beginning which kind of play he want to see and which actors
 are more desirable for the main roles in this play.

 Of course, different users may have different preferences and that is
 why we have
in {\bf bergman} a possibility to create, change and use personalization  of
{\bf bergman's} users.  To explain it in an  example, suppose that your typical
calculation is Hilbert series for non-commutative algebras in zero 
 characteristics. You hardly like to start each your session from
 (noncommify). It would be much better if the system knows that you are a
 privileged customer and prefer to work in the non-commutative environment.
 Even more, because usually you work with generators a,b,c only and do not  
interested in the degrees larger than 12 you would like to skip writing 
vars a,b,c and (setmaxdeg 12) every time.
The only thing that is really changed in your session are relations. 
So, you would like to work from the very beginning with the relations and
 set all other parameters to your preferred default values. 

 How to create your own personalization?
The procedure to start it is called 
(personalize {\it name}) .

The {\it name} is an identifier, which will serves later for your identification.
You will be informed if this name is already stored. In the latter case, you shall see
a list of profiles and can select one of them or create a new profile. One can have a
number of profiles for different kind of problems he deals with.

If you are the first time user, the computer will create for you a profile called ``startup''. 
This unique global profile will be used to fill in default values later as you will create 
new profiles. It is not a restriction because there is a possibility to create new profile 
after: 
\begin{itemize}

\item the last used profile;
\item startup profile; 
\item another profile from your list; 

\end{itemize}

You can use a  profile sent by your colleague, for example, doing only the necessary 
modifications.
 

There is a procedure (manageprofiles) that do a lot of operation with your profiles, 
and the procedure (manageusers). In implementation, each user is presented by a directory, 
and each profile by a file in this directory. The restrictions for directory and file names 
imposed by the operating system are not applied to user and profile names because user and 
profile names are translated into directory and file names using a table.  


The computer starts the dialog and the first question will be

\vspace{0.5cm} {\it What kind of objects you plan to work with?}

\begin{enumerate}
\item Graded, commutative.
\item Non-graded, commutative.
\item Graded, non-commutative. 
\item Non-graded, non-commutative.
\end{enumerate}

If you decide to work with non-graded objects you never will be asked about 
the Hilbert series options or Anick resolution and rabbit will be your only 
procedure to work with non-commutative \gb. So, the  next question will be 
about the homogenizing variable.

On the other hand, selecting the graded variant
you skip the questions about  homogenizing variable. More important is
that your possibilities will be much wider in graded case and the calculation 
will be more efficient (comparing with non-graded options applied to the 
same object).


If you take  the non-commutative option you skip the command {\bf(noncommify)}
(which is  easy to forget), but if commutativity is your preference 
you will  be never asked about any module or homological option.

In the case you admitted graded non-commutative calculations  you will be 
asked about modules and homological preferences.

\vspace{0.5cm} {\it Do you plan to work with} 

\begin{enumerate}
\item Rings only
\item Modules
\item Bimodules.
\end{enumerate}
\vspace{0.5cm} {\it Do you plan to calculate}

\begin{enumerate}
\item \gb only
\item \gb and Anick resolution
\item \gb and Betti numbers
\item \gb, Anick resolution and Betti numbers.
\end{enumerate}
Note that the difference between two  last choices is that in the 3th variant 
Anick resolution is not saved (though calculated). 



Here is finished the main dialog, but depending on your selections  a more 
detailed one (about your objects) may be started. We consider possible 
questions in this dialog point by point.

\section{The \gb dialog:ordering }

The user can  choose some default values for the \gb calculations.


The first question will be:

\vspace{0.5cm} {\it Which ordering you plan to have by default?}

The prompt  depends on your previous answers related to commutativity 
(non-commutativity) and types of objects (graded or non-graded).

The possible variants (at the moment when this text was written)
 are presented in the following table:

\begin{verbatim}
-------------------------------------------------------
Prompt                            Previous selection
-------------------------------------------------------
Commutative DEG-REVLEX            Commutative;  graded, non-graded 

Commutative DEG-LEX               Commutative;  graded, non-graded 

Non-commutative DEG-LEX           Non-commutative; graded

Non-commutative ELIMLEFTLEX       Non-commutative; graded
  
Non-commutative INVELIMLEFTLEX    Non-commutative; graded

Non-commutative HOMOGELIMLEFTLEX   Non-commutative; graded or  non-graded

-------------------------------------------------------
\end{verbatim}

\section{The \gb dialog: variables}

You may want to fix some names for your variables.
Independently of the type of object you are working with, the first prompt 
will be:

\vspace{0.5cm} {\it Please, write the names  for ring variables separated by commas if you 
want
 them to be fixed  or press Enter if you do not want to fix the names.}


Note that the order in which you write variables determine how they are 
compared to each other depending on ordering. For example, the order a, b, c 
means that $a>b>c$ in  commutative REV-LEX, but $c>b>a$ for non-commutative 
DEG-LEX (see the corresponding chapter in the manual).

If you are working with modules the next prompt will be the same but 
related to the module variables.

\vspace{0.5cm} {\it Please, write the names  for right module variables separated by commas 
if you want them to be fixed  or press Enter if you do not want to fix the 
names.}


And at last in the case of two modules you will be asked about the left module:

\vspace{0.5cm} {\it Please, write the names  for left module variables separated by commas 
if you want them to be fixed  or press Enter if you do not want to fix the 
names.}


\section{The \gb dialog: weights}


If the user have fixed the variables names it will come the text question
related to variables weights. 

\vspace{0.5cm} {\it Do you want to assign weights?
If yes, write the weights separated by commas in the same order as the 
corresponding variables. 
If not, press Enter (all the weights will be equal to 1).}


Note, that in the current version it is possible to use weights in \gb 
computation only.

\section{The \gb dialog: maximal degree}


To give the possibility to stop the calculation in the desired degree
the next question will be about the maximal degree setup.

Input the maximal degree of calculation or press Enter if there is no 
restrictions.

%\section{The \gb dialog: strategy}


%The following question asks you to select the fundamental strategy of
% calculations:

%\vspace{0.5cm} {\it What strategy do you want by default?}


%\begin{enumerate} 
%\item Ordinary (Buchberger, Bergman) with immediate full autoreduction
%\item Ordinary (Buchberger, Bergman) without immediate full autoreduction
%\end{enumerate}


\section{Coefficients dialog}



To select the possible characteristic you will be asked about the following:

\vspace{0.5cm} {\it Input the characteristic you prefer to work with (zero or 
a prime number).}



In zero characteristic you have to select one of the four alternatives:

\vspace{0.5cm} {\it The coefficients you expect in the calculations are:}


\begin{enumerate} 
\item  Very short numbers only (one byte)
\item  Usual integers and rationals (one word)
\item  Probably long numbers.
\item   All type of numbers.
\end{enumerate}

The idea is to use more efficient procedures if it is possible
(saving both memory and time), but it is important to note that even with
a small input and output the intermediate coefficients may be huge. But in 
some cases (e.g., when all the relations are semigroup relations) we can 
predict even the size of the intermediate coefficients.




If the selected characteristic p is larger than 2, the last question 
will be the following:

\vspace{0.5cm} {\it Do you want to use a logarithm table for the  
characteristic p?}


Such a table makes  calculations faster but you need the corresponding table 
created before (see ``Manual''). 


\section{Non-graded objects dialog}


Possibilities for non-graded calculations  
are restricted by \gb only. Because in reality the input will be homogenized,
you will be asked about the possible name for the homogenizing variable.

\vspace{0.5cm} {\it Please, write the name for the homogenizing variable or press  Enter if 
you don't need it.}


For the non-commutative calculations the only procedure to use is
rabbit, so you will be asked if you want to have some default values for 
it parameters:

\vspace{0.5cm} {\it Please write the start value for jumps in rabbit (0 if you want to decide
 this during the session)}


\vspace{0.5cm} {\it Please write the step value for jumps in rabbit (0 if you want to decide
 this during the session)}


\vspace{0.5cm} {\it Please write the end value for jumps in rabbit (0 if you want to decide
 this during the session).}



\section{Graded objects dialog}


The common options  specific for graded objects are
Hilbert and  monomial Poincare-Betti series calculations. 
They are selected by answering the following question.

\vspace{0.5cm} {\it Do you plan to calculate Hilbert series?:}

\begin{enumerate}
\item Yes.
\item No.
\end{enumerate}



\section{Input mode}


There are two possibile formats for input relations. One can fix the preferable
format in the following dialog:

\vspace{0.5cm} {\it Select the input format for relations:}


\begin{enumerate}

 \item Lisp form.
\item Algebraic form.
\end{enumerate}


\section{Output mode}


One can select the preferable output format answering the following question:

\vspace{0.5cm} {\it Select the output format for \gb}


\begin{enumerate}

\item Lisp form.
\item Algebraic form.
\item McCaulay algebraic form.
%\item User customization.
\end{enumerate}


For Hilbert series output in the commutative mode you will be asked if you 
want the output as a rational function. In the non-commutative mode this 
mode is naturally absent (the Hilbert series is not always rational!).



 \section{Before and after calculations}

One thing that the user may want to predefine is the behavior of the 
system before or after the calculations.  The following questions help him.

\vspace{0.5cm} {\it What do you want before the calculations start?}


\begin{enumerate}

 \item Suggest to change some options.
\item  Ask about the missing options only.
\item  Never ask, take all default options and missing ones from the
selected previous session.
\end{enumerate}


The third variant can be convenient when the user have always the same input 
file and only change the relations in it.

\vspace{0.5cm} {\it What do you want after the calculations?}


\begin{enumerate} 
\item Exit from bergman.
%  Edit relations and restart the calculations (for graphical interface)
\item  Ask about new input and start new calculations.
\item  Suggest to change options before new calculations.
\item  Remain in Bergman  leaving dialog and waiting new LISP-command.
\end{enumerate}


 \section{Input dialog}


The user can predefine the source for input to skip the corresponding question
during the session. Possible choices are:

\vspace{0.5cm} {\it Please choose the source for the input:}


\begin{enumerate} \item Screen.
\item  File, including LISP-commands.
\item  File with the relations only.
\item  Batch file.
\end{enumerate}

The last one means that there will be a list of input files and their names
will be listed in some special batch file.

If the input will be not from the screen the name of the corresponding
file will be asked:

\vspace{0.5cm} {\it Write the name of the input  commands/relations/batch file if you
want to fix it or press the Enter if you prefer to decide this during 
the session.}



\section{Output dialog}


The user can also fix the name of the output files. Note that input 
in this case should be from the file too. The alternatives are the following.

\vspace{0.5cm} {\it Please choose the place for output:}


\begin{enumerate} 
\item On the screen only.
\item  In the files with the same name as input file with different extension.
\item  In the files with some fixed names.
\item  In the files with the names chosen during the session.
\end{enumerate}

Of course, you will be asked about the fixed names you want to use.

Beside that the following question is important:

\vspace{0.5cm} {\it What do you plan to do with the existing files:}


\begin{enumerate} 
\item  Overwrite them.
\item  Leave them unchanged and inform about it.
\item  Suggest to use another name or exit.
\item  Depends on the type of file.
\end{enumerate}

The last option means that the user starts the same dialog for every type
of output file (\gb file, Hilbert series file, Anick resolution etc.) 
separately.

\end{document}