% from 22.5.96 hk
% user packages, real root counting, etc.

\section{Real root counting for multivariate polynomials} %----------

%-Hermite and Sylvester studied the connection between the number of 
%-real roots of univariate polynomials and signatures of matrices 
%-over certain residue class rings.
This package contains an implementation for 
counting real roots of zero dimensional multivariate polynomial 
ideals with side conditions due to \cite{PRS93} and \cite{BEWO91}. 
The implementation was done by \cite{Lippold93}. 
It uses Gr\"oebner Bases for computing in finitely generated 
residue class algebras. The method of \cite{BKR86} is adapted for 
computing the number of real roots in the case of several side conditions. 
\index{real root counting}
\index{counting, real roots}

We cite from the introduction by the author \cite{Lippold93} of the 
package: 

``Das Z\"ahlen reeller Nullstellen von Polynomen geh\"ort zu den
bekanntesten Problemen der Algebra und bildet die Grundlage f\"ur
eine Vielzahl von Anwendungen. Auf den Arbeiten von
Budan--Fourier und Sturm (...) aus dem 19. Jahrhundert
basieren z.B. Algorithmen zur Isolation reeller Nullstellen 
(siehe \cite{BCL82})
und zur Quantorenelimination in reell abgeschlossenen K\"orpern
(vgl.~\cite{Davenp88}). Aufgabenstellungen in mehreren Variablen
mu\"sten dabei bislang immer auf den univariaten Fall zur\"uckgef\"uhrt
werden.

Ein von \cite{PRS93} und \cite{BEWO91} vor kurzem unabh\"angig voneinander
entwickeltes Verfahren gestattet es nun, die gemeinsamen reellen Nullstellen
multivariater Polynommengen im nulldimensionalen Fall zu z\"ahlen.
Die Autoren verallgemeinern dabei Ausf\"uhrungen von Hermite und
Sylves\-ter \"uber den Zusammenhang zwischen der Anzahl der reellen
Nullstellen von Polynomen und der Signatur von speziellen Matrizen
(...) auf den multivariaten Fall.
Bei der Berechnung dieser Matrizen spielt die Theorie der
Gr\"obner Basen eine zentrale Rolle.
Eine St\"arke dieses neuen Ansatzes liegt in der M\"oglichkeit
zus\"atzlich noch eine Vorzeichenbedingung an ein Polynom
ber\"ucksichtigen zu k\"onnen. Mit dem von \cite{BKR86} entwickelten
kombinatorischen Argument lassen sich schlie\"slich reelle Nullstellen
unter Ber\"ucksichtigung endlich vieler Nebenbedingungen z\"ahlen.
\"Ubertragen auf die Anwendungsgebiete der Entscheidungsverfahren
bzw.~der Quantorenelimination in reell abgeschlossenen K\"orpern
ergeben sich damit interessante neue Perspektiven (siehe \cite{Wei93}).
%auf die ich sp\"ater noch eingehen werde.

Konkret gehen wir von folgender Situation aus:
Gegeben ist eine Menge $\emptyset\not= F=\{f_1,\ldots,f_m\}$ von
Polynomen in den Variablen $X_1,\ldots,X_n$ mit Koeffizienten aus $\bf Q$.
Die $f_i$ besitzen nur endlich viele gemeinsame Nullstellen in $\bf C$,
was \"aquivalent ist zu der Aussage, da\"s das von $F$ erzeugte Ideal
nulldimensional ist. Eventuell sind mit den Polynomen $h_1,\ldots,h_s$
noch eine Reihe von Nebenbedingungen zu ber\"ucksichtigen.
Die Frage ist nun wieviele $(x_1,\ldots,x_n)\in\bf R^n$
existieren mit $f_i(x_1,\ldots,x_n)=0$ f\"ur $1\le i\le m$ und
$h_j(x_1,\ldots,x_n)\varrho_j 0$ f\"ur $1\le j\le s$ bei
vorgegebenen $\varrho_j\in\{<,=,>\}$.''

%
%Abgesehen vom Buchberger Algorithmus zur Berechnung von Gr\"obner Basen,
%werden in den folgenden Kapiteln alle notwendigen Prozeduren vorgestellt,
%um diese Frage zu beantworten.
%Man beachte, da\"s wir dabei immer Punkte im geometrischen Sinn,
%d.h.~ohne Ber\"ucksichtigung algebraischer Vielfachheiten z\"ahlen.
%
%Leider ist der Beweis der Kernaussage in \cite{prs} sehr knapp gehalten
%und enth\"alt kleine Fehler; die in \cite{bewo} gew\"ahlte Darstellung wiederum
%ist schwerer zug\"anglich. Daher bildet mit Kapitel \ref{proof} der
%ausf\"uhrliche und --- so hoffe ich --- leicht verst\"andliche Beweis
%der Korrektheit des Verfahrens ein Schwerpunkt meiner Arbeit.
%In Kapitel \ref{alggru} werden dazu einige wichtige algebraische
%Zusammenh\"ange erl\"autert und zentrale Begriffe definiert.
%Breiten Raum nimmt mit Kapitel \ref{algos} auch die algorithmische
%Umsetzung des Verfahrens ein, da gro\"ser Wert auf den Nachweis der
%Korrektheit und die Analyse der Komplexit\"at der einzelnen Teilschritte
%gelegt wurde. 
%Anhand von Beispielen werden in Kapitel \ref{impl} die Effizienz der
%Algorithmen untersucht, auf Schwachpunkte hingewiesen und 
%Verbesserungsm\"oglichkeiten benannt. Das letzte Kapitel fa\"st kurz die
%Ergebnisse zusammen und bewertet die Perspektiven des Verfahrens.
%
%Als Basis dieser Arbeit diente die Darstellung der Ergebnisse von
%P. Pedersen, M-F. Roy und A. Szpirglas, da sie st\"arker den algorithmischen
%Aspekt betont und damit den Implementierungsfragen n\"ahersteht.
%Interessante Hinweise zur praktischen Realisierung des Verfahrens
%finden sich aber auch in der Ver\"offentlichung von E. Becker und T. W\"ormann.
%Eine sehr gute Einf\"uhrung in die kommutative Algebra, speziell in
%die Theorie der Gr\"obner Basen, ist in \cite{webe} nachzulesen;
%bei Fragen zur linearen Algebra verweise ich auf \cite{gant}.

\subsection{Examples} %------------------

{\footnotesize %-------------------------
\begin{verbatim} 
       V := LIST("x","y").  (* Variable list *)
       
       t := DIPTODEF(2).   (* Termorder: 2: invers lexicographic
                              4: total degree invers lexicographic *)
       
       (* Generating polynomials *)
       F := DIILRD(V).
       (
       (3 x**2 - 4 x y),
       (5 x - 5 y**2 - 2 y - 1)
       )
       
       (* Side conditions *)
       H := DIILRD(V).      
       (
       (x**2 + y**2 + 1)
       ) 
       
       G:= DIIPGB(F,0).     (* Groebner basis *)
       
       BEGIN 
       CLOUT("Generating polynomials:"); BLINES(0);
       DIILWR(F,V); BLINES(1);
       CLOUT("Side conditions:"); BLINES(0);
       DIILWR(H,V); BLINES(1);
       CLOUT("Groebner basis:"); BLINES(0);
       DIILWR(G,V); BLINES(1);
       IF RRZDIM(G) = 1 THEN ZNL := RRICOUNT(G,H,NIL,1) 
                        ELSE CLOUT("Not zero-dimensional.") END;
\end{verbatim}
}

{\footnotesize %-------------------------
\begin{verbatim} 
       Generating polynomials:
                 ( -4 x y +3 x**2 )
                 ( -5 y**2 -2 y +5 x -1 )
        
       Side conditions:
                 (  y**2 + x**2 +1 )
        
       Groebner basis:
                 ( 45 x**3 -56 x**2 +16 x )
                 ( 4 x y -3 x**2 )
                 ( 5 y**2 +2 y -5 x +1 )
                
       Condition No. 1
       Sign-Condition: (1)  Real Zeroes: 2
\end{verbatim}
}

Computing time for Gr\"obner Basis 340 ms and for 
real root counting 420 ms.


\section{Real quantifier elimination} %-----------------------
%--using parametric real root counting} %---

In the modules RQEPRRC and TFORM is an algorithm for real quantifier 
elimination implemented. The theoretical background is presented in 
Weispfenning {\em A New Approach to Quantifier Elimination for Real Algebra}
\cite{Wei93}, see also \cite{Dolzmann94}. 
The programs were implemented by \cite{Dolzmann94}.
\index{RQEPRRC}\index{TFORM}
\index{quantifier elimination}
\index{elimination, quantifier}
\index{real root counting}
\index{counting, real roots}
\index{parametric real root counting}

In this section the usage of this program is described. 
We demand that the user is familiar with the MAS system. 

The program uses distributive polynomials for representing terms.
So the global variables VALIS, EVORD, and DOMAIN must be set before 
formulas can be manipulated. 
For more informations cf. Subsection \ref{sec:Syntax}.

The following procedures are available in the interpreter.

\begin{deflist}{psi:=RQEQE(phi)}
\item[psi:=RQEQE(phi)] 
  This is the main procedure for the quantifier elimination. The
  variables phi and psi are formulas. The returned
  formula psi is equivalent to phi. After the expansion of the extended
  boolean operators the following must hold: Each variable is either
  free or is quantified by one quantifier. Name conflicts are not
  resolved. Note that the formula ((psi \verb/<=>/ (E x (phi)) does not
  suffices this condition. The elimination procedure uses the cgb package for
  computations of Groebner systems. The behavior of this computations is
  controlled by options of the cgb package. The term orders for the
  polynomials used in the cgb package and used for the representation of
  terms in the polynomial equation package must be identical. The
  computation of psi and the printing of verbose output during the
  computation is controlled by some options. You can set these options
  with the procedure RQEOPTSET.
  \index{RQEQE}

\item[OldOpt:=RQEOPTSET(NewOpt)]
  This procedure sets the options for the quantifier elimination. The
  variables OldOpt and NewOpt are lists with maximal two elements. These
  lists have the form (Trace Level,Partial Quantifier Elimination). 
  The pseudo value $-1$ is used in order to leave an option unchanged. 
  The trace level controls the verbose output of the quantifier elimination.
  Following trace levels are supported:

      \begin{description}
      \item[0] No verbose output.
      \item[1] Very short output. (For insiders only)
      \item[2] Long output without long intermediate results.
      \item[3] Long output with intermediate results.
      \end{description}

  The second element of the option list controls the quantifier elimination 
  itself. Following values are supported:

      \begin{description}
      \item[0] The complete quantifier elimination is done. 
               The result formula contains no quantifier.
      \item[1] Only partial quantifier elimination of the 
               zero dimensional cases is done. 
      \end{description}
  \index{RQEOPTSET}

\item[RQEOPTWRITE()]
  This procedure print the current values of the options.
  \index{RQEOPTWRITE}

\item[TfUseDb()]
  This procedure activates the type formula data base. Type formulas are stored
  in files with the name "TF.d.db", where d is the degree of the type formula. 
  If a required type formula is not stored in the data base, the formula is 
  computed and stored.
  \index{TfUseDb}

\item[TfComputeTf()]
  This procedure deactivates the type formula data base. Required type formulas
  are computed unconditionally. 
  \index{TfComputeTf}
\end{deflist}

Examples will be given after the next subsection. 


\subsection{The Syntax of Formulas} %-------------------------

\label{sec:Syntax}
The terms of the formulas of the pq-systems are represented as
distributive polynomials. So the corresponding polynomial ring must be
fixed. The procedure PQPRING defines the polynomial ring for the
pq-system. Argument of this procedure is a list with upto three
elements.

\begin{enumerate}
\item The domain descriptor for the coefficient of the polynomials used
      as terms for the pq-system. Only the domain INT is admissible for the
      quantifier elimination. 

\item The list of all variables occuring in all terms of the formula.

\item The term order for the polynomials. The term order used in the
      cgb package and used for the terms of the pq-system should be equal.
      Important term orders are 
      \begin{description}
      \item[2] inverse lexicographical term descending order
      \item[4] total degree order
      \item[8] total degree Buchberger lexicographical term order
                descending order
      \end{description}
\end{enumerate}

One example for the usage of PQPRING:
\begin{verbatim}
       d:=ADDDREAD(). INT 
       PQPRING(LIST(d,LIST("x","a","b"),4)).
\end{verbatim}

A value $-1$ on one position of the list means "Do not change the
corresponding value."

An alternative way of the declaration of the underlying polynomial
ring is its specification at the beginning of the input of one formula.

The procedure PQIREAD reads a formula from the input stream.
The syntax in EBNF notation is contained in table \ref{tabSyF}, 
the syntax of polynomials is given in table \ref{tabSyPo} 
(see also table \ref{poly.ebnf}). 

\begin{table}[thbp]
\small
\begin{center}
\begin{verbatim}
   Input           = [ PRing ] Formula "." 
   PRing           = `{' PRingParam {`,' PRingParam} `}'
   PRingParam      = `VALIS='VarList | `EVORD='TermOrd | `DOMAIN='Ring  
   VarList         = `(' Ident {`,' Ident} `)'
   TermOrd         = Atom 
   Ring            = SymbolicDomainDescriptor 
   
   Formula         = `(' Formula `)' | AtomicFormula | UnaryOp Formula | 
                      Formula BinaryOp Formula | QuantifiedFormula | TruthVal |
                      `#'MasVar 
   QuantifiedFormula = Quantifier BoundVars `(' Formula `)' | 
                       Quantifier BoundVars `:' Formula
   BoundVars       = Ident {[`,'] Ident } 
   TruthVal        = TrueSym | FalseSym 
   UnaryOp         = NotSym 
   BinaryOp        = AndSym | OrSym | ImplSym | ReplSym | EquivSym | XorSym 
   Quantifier      = ForallSym | ExistsSym   
   AtomicFormula   = `[' DipPolynomial Relation DipPolynomial `]'
   Relation        = LessSym | LessOrEqualSym | EqualSym | NotEqualSym | 
                     GreaterOrEqualSym | GreaterSym  
   
   TrueSym         = `t' | `true' | `verum' 
   FalseSym        = `f' | `false' | `falsum' 
   NotSym          = `--' | `~' | `not' | `non' 
   AndSym          = `/\' | `and' | `et' 
   OrSym           = `\/' | `or' | `vel' 
   ImplSym         = `=>' | `==>' | `impl' 
   ReplSym         = `<=' | `<==' | `repl' 
   EquivSym        = `<=>' | `equiv' 
   XorSym          = `<#>' | `xor' 
   ForallSym       = `a' | `all' | `fa' |  `forall' 
   ExistsSym       = `e' | `ex' | `exists' 
   LessSym         = `<' | `les' 
   LessOrEqualSym  = `<=' | `leq' | `lsq' 
   EqualSym        = `=' | `equ' 
   NotEqualSym     = `<>' | `#' | `!=' | `neq'   
   GreaterOrEqualSym = `>=' | `geq' | `grq' 
   GreaterSym      = `>' | `gre' 
\end{verbatim}
\end{center}
\caption{Syntax of Formulas}
\label{tabSyF}\index{formulas! syntax}\index{syntax! diagram}
\index{syntax! formulas}
\end{table}

\begin{table}[thbp]
\small
\begin{center}
\begin{verbatim}
     DipPolynomial   = 0 | `(' Term {(`+'|`-') Term} 
     Term            = Power { Power } 
     Power           = Factor [ `**' Atom ] 
     Factor          = Ident | Atom 
   
     Ident = A|...|Z|a...z|{A|...|Z|a...z|0...9} 
             (* Names of variables like "hugo")
     Atom  = 1|...|9{0...9}
             (* integers like 4711 *)
\end{verbatim}
\end{center}
\caption{Syntax of Polynomials}
\label{tabSyPo}\index{polynomials! syntax}\index{syntax! diagram}
\index{syntax! polynomials}
\end{table}

Some remarks on the syntax of formulas: 

The input of the symbols like AND, OR, etc. is not case sensitive, but
the keywords VALIS, EVORD, DOMAIN must be written with upper case
letters. The names of variables of the polynomial ring are case
sensitive.

The special formula symbol \verb/#/ is a prefix to mark variables of the
interpreter. With this feature a recycling of formulas is possible. 

SymbolicDomainDescriptos is a symbolic name for a domain of the
arbitrary domain system. For quantifier elimination with RQEQE only
INT is admissible.

Here an example for the usage of PQIREAD:
\begin{verbatim}
       phi:=PQIREAD().
       {VALIS=(a,b,c,d),EVORD=4,DOMAIN=INT}
       (  ex c: all b,a : (( 
          ([(a) = (d) ] /\ [ (b) = (c)]) \/
          ([(a) = (c) ] /\ [ (b) = (1)]))
          => 
          [ (a**2) = (b)] )
       ) . 
\end{verbatim}

In the last example the polynomial ring is described in the formula
input. This description of the underlying polynomial ring is
superflous if it was already specified.

An other example:
\begin{verbatim}
       phi:=PQIREAD().
       ( [(a**2 + 3 a b ) > ( c ) ]).
       psi :=PQIREAD().
       (#phi or TRUE).
       PQPPRT(psi).
\end{verbatim}

The result is the formula "\verb.([(a**2 + 3 a b - c ) > 0 ] \/ TRUE).".
Notice that all variables must be declared in the variable list of the
underlying polynomial ring.

The operators have different priorities against themselves:

\begin{itemize}
\item[1] negation
\item[2] conjunctions
\item[3] disjunctions
\item[4] implication and Replication
\item[5] equivalent and exclusive or
\item[6] quantifiers
\end{itemize}


The following procedures are available in the interpreter.

\begin{deflist}{PQMKDNF}
\item[PQMKDNF(phi:LIST):LIST]
      Polynomial equation make disjunctive normal form. phi is a formula;
      PQMKDNF returns a formula in strict disjunctive normal form which is
      equivalent to phi. 
      \index{PQMKDNF}

\item[PQMKCNF(phi:LIST):LIST]
      Polynomial equation make disjunctive normal form. phi is a formula;
      a formula in strict conjunctive normal form which is
      equivalent to phi is returned. 
      \index{PQMKCNF}

\item[PQSIMPLIFY(phi:LIST):LIST]
      Polynomial equation simplify. phi is a formula. A simplification of 
      phi is returned. 
      \index{PQSIMPLIFY}

\item[PQMKPOS(phi: LIST): LIST]
      Polynomial equation make positive. phi is a formula; a equivalent 
      positive formula is returned i.e. the operator does not occur in 
      the formula. 
      \index{PQMKPOS}

\item[PQPPRT(phi:LIST)]
      Polynomial equation pretty print. phi is a formula; this 
      writes the formula phi formatted in the output stream. 
      \index{PQPPRT}

\item[PQTEXW(phi: LIST)]
      Polynomial equation tex write. The formula phi is printed in tex format 
      in the output stream. (Polynomials are written in the normal mas syntax.) 
      \index{PQTEXW}

\item[PQIREAD():LIST]
      Polynomial equation infix read. A formula is read from the input stream. 
      \index{PQIREAD}

\item[PQELIMXOPS(phi: LIST): LIST]
      Polynomial equation eliminate extended operation symbols. phi is a
      formula PQELIMXOPS returns a formula phi1 equivalent to phi. This
      function replaces all subterms of phi with the operators IMP, REP,
      EQUIV or XOR with terms with the operators VEL, ET and NON. 
      \index{PQELIMXOPS}

\item[PQMKPRENEX(phi,pref:LIST): LIST] 
      Polynomial equation make prenex. phi is a formula; pref is an
      element of \{FOREX, FORALL\}; a formula psi in prenex normal form is
      returned. phi must be a relative positive formula without additional
      operation symbols like IMP, REP, etc. All bound variables in phi must
      have different specifications (i.e. different names or different
      types). The only transformation which is used to calculate psi is the
      interchange of a junctor with a quantifier. The formula psi has the
      minimal number of blocks of quantifiers under all prenex formulas
      which are built using only the interchange of a junctor with a
      quantifier. The argument pref is only respected, if there are two
      equivalent formulas with the same optimal number of blocks of
      quantifiers. In this case the formula is returned which has a
      ``pref''-quantifier as the outermost operation symbol.
      \index{PQMKPRENEX}

\item[PQMKVD(phi:LIST): LIST]
      Polynomial equation make variable names disjoint. 
      \index{PQMKVD}

\item[PQPRING(R: LIST): LIST]
      Polynomial equation polynomial ring. The global variables that 
      describe the polynomial ring are set. The list R is of the 
      following format: The first entry is the domain descriptor of 
      the field, the second entry is the list of the variables, and the 
      third entry is the term order. Using a -1 one can omit entries. 
      Not all entries must specified. The old parameters are returned. 
      \index{PQPRING}

\item[PQPRINGWR()]
      Polynomial equation polynomial ring write. The description of 
      the polynomial ring is written in the output stream. 
      \index{PQPRINGWR}
\end{deflist}


\subsection{Examples} %-------------------------

We include 2 short examples:

{\footnotesize %-------------------------
\begin{verbatim} 
       PRAGMA(TIME).
       ev:=4. 
       CGBOPT(LIST(0,1,0,2,0,ev,ev)). 
       d:=ADDDREAD(). INT 
       V:=LIST("a","b","x").
       PQPRING(LIST(d,V,ev)).
       RQEOPTSET(LIST(9,0)).
       phi:=PQIREAD().
       ( E x ( [ ( a x + b ) = 0 ] ) ). 
       ws:=RQEQE(phi).
       PQPPRT(ws).
       FORCOUNTAF(ws).
\end{verbatim}
}

{\footnotesize %-------------------------
\begin{verbatim} 
       ANS: 4
        
       ANS: ()
        
       ANS: (2 0)
        
       ANS: ((10) (12) (56))
        
       ANS: ((8 0 -1) () 2)
        
       ANS: (3 0)
        
       ANS: FOREX(LVAR(FORVAR(3, 2)), EQU(((1 0 1) (2 1) (0 1 0) (2 1)))). 
        
       Input in prenex normal form
       (EX x:[(  a x + b ) = 0])
       [Number of quantifier blocks: 1
       Elimination of an FOREX quantifier
       bound Variables(x)
       Number of arguments of the disjunction:1
       Eliminating one conjunction.
       ([(  a x + b ) = 0])
       Computing a reduced Groebner system ...
        finished.
       SysInfo: Time: 67 ms.
       Number of cases in the Groebner system: 3
       Handle one case of the Groebner system.
       Condition: 
         a = 0
         b = 0
        
       Dimension of the ideal = 1
       Input in prenex normal form
       (EX x:([  a  = 0] /\ [  b  = 0]))
       [Number of quantifier blocks: 1
       Elimination of an FOREX quantifier
       bound Variables(x)
       Number of arguments of the disjunction:1
       Eliminating one conjunction.
       ([  a  = 0] /\ [  b  = 0])
       Result of the elimination:
       ([  a  = 0] /\ [  b  = 0])
       SysInfo: Time: 34 ms.
       ]
       Handle one case of the Groebner system.
       Condition: 
         a = 0
         b <> 0
        
       Dimension of the ideal = -1
       Handle one case of the Groebner system.
       Condition: 
         a <> 0
        
       Dimension of the ideal = 0
       Groebner Basis:
       (   a  x +  b  )
        
       Side conditions '>':
       Side conditions '<>':
       Time for computation of characteristic polynomial: 
       SysInfo: Time: 0 ms.
       Type formula to compute: T1(c), where
       c0 =   - 1 
       c1 =    1 
       Time for computing type formula: 
       SysInfo: Time: 0 ms.
       Time for real root count: 
       SysInfo: Time: 50 ms.
       Result of the elimination:
       ([  a  <> 0] \/ ([  a  = 0] /\ [  b  = 0]))
       SysInfo: Time: 250 ms.
       ]
       ANS: FOROR(NEQ(((0 0 1) (2 1))), FORAND(EQU(((0 0 1) (2 1))), 
            EQU(((0 1 0) (2 1))))). 
        
       Time: read = 0, eval = 267, print = 16, gc = 0.
       
       MAS: ([  a  <> 0] \/ ([  a  = 0] /\ [  b  = 0]))
       ANS: ()
        
       ANS: 3 
\end{verbatim}
}


The second example:

{\footnotesize %-------------------------
\begin{verbatim} 
       PRAGMA(TIME).
       ev:=4. 
       CGBOPT(LIST(0,1,0,2,0,ev,ev)). 
       RQEOPTSET(LIST(0,0)).
       phi:=PQIREAD().
       {DOMAIN=INT,VALIS=(d,c,a,b)}
       ex c:all a:all b:
       (((([(a - d) <> 0] \/ [(b - c) <> 0]) /\ 
       ([(a - c) <> 0] \/ [(b - 1) <> 0]))
       \/ [(a**2 - b) = 0])).
       ws:=RQEQE(phi).
       PQPPRT(ws).
       FORCOUNTAF(ws).
\end{verbatim}
}

{\footnotesize %-------------------------
\begin{verbatim} 
       ANS: 4
        
       ANS: ()
        
       ANS: (3 0)
        
       DOMAIN: INT (* Integer *) 
       VALIS:  (d,c,a,b)
       EVORD:  2
        
       ANS: FOREX(LVAR(FORVAR(3, 2)), FORALL(LVAR(FORVAR(4, 2)), 
            FORALL(LVAR(FORVAR(5, 2)), FOROR(FORAND(FOROR(NEQ(((0 1 0 0) 
            (2 1) (0 0 0 1) (2 -1))), NEQ(((1 0 0 0) (2 1) (0 0 1 0) 
            (2 -1)))), FOROR(NEQ(((0 1 0 0) (2 1) (0 0 1 0) (2 -1))), NEQ
            (((1 0 0 0) (2 1) (0 0 0 0) (2 -1))))), EQU(((1 0 0 0) 
            (2 -1) (0 2 0 0) (2 1))))))). 
        
       ANS: FOROR(FORAND(NEQ(((0 0 0 1) (2 1))), NEQ(((0 0 0 1) (2 1) 
            (0 0 0 0) (2 1))), NEQ(((0 0 0 1) (2 1) (0 0 0 0) (2 -1))), 
            EQU(((0 0 0 2) (2 1) (0 0 0 0) (2 1))), NEQ(((0 0 0 4) 
            (2 1) (0 0 0 0) (2 1)))), FORAND(EQU(((0 0 0 1) (2 1) 
            (0 0 0 0) (2 -1))), NEQ(((0 0 0 4) (2 1) (0 0 0 0) (2 1)))), 
            FORAND(EQU(((0 0 0 1) (2 1) (0 0 0 0) (2 1))), 
            NEQ(((0 0 0 4) (2 1) (0 0 0 0) (2 1))))). 
        
       Time: read = 17, eval = 1666, print = 50, gc = 0.
       
       MAS: (([  d  <> 0] /\ [(  d +1 ) <> 0] /\ [(  d -1 ) <> 0] /\ 
            [(  d**2 +1 ) = 0] /\ [(  d**4 +1 ) <> 0]) \/ 
            ([(  d -1 ) = 0] /\ [(  d**4 +1 ) <> 0]) \/ ([(  d +1 ) = 0] 
            /\ [(  d**4 +1 ) <> 0]))
        
       Time: read = 17, eval = 50, print = 0, gc = 0.
       ANS: 9
\end{verbatim}
}

This completes the section on parametric real root counting. 


%\section{} %----------
%\index{}
%{\footnotesize %-------------------------
%\begin{verbatim} 
%\end{verbatim}
%}
%{\footnotesize %-------------------------
%\begin{verbatim} 
%\end{verbatim}
%}
