%
%
%
%          The protocol file on the interface between
%          "Bergman" and "Anick`s resolution" applications.
%
%          Designed under Standard Lisp environment.
%
% (c) 1996 by Joergen Backelin and Alexander Podoplelov.
%

% The prefix of the procedures and macros concerning
% "Anick's resolution" is "an".
% The following routines are introduced for providing chain records.
% 

    anLOOKFORLOWERCHAIN(chr) : the previous chain record
          This is intended for getting the left factor chain of
          length one less than the length of the source chain "chr".

    anLOOKFORLASTVERTEX(chr) : the last vertex of the chain
          Gives the last vertex in the graph for the given chain "chr",
          considered as a path.

    anPROLONGCHAIN(chr, augmon) : (chr1, augmon1)
          If the chain chr is an n-chain then using this stuff we
          get the n+1 -chain "chr1" and the augmented monomial
          "augmon1" so that 
          chr * augmon = chr1 * augmon1.
          It also returns an error if there is no n+1 -chain left
          factor of chr * augmon.

    anLOOKFORCALCULATEDCHAIN(chr) : semidistributed tensor polynom or NIL
          Returns the result of the differential for the given chain 
          "chr" if it is calculated or NIL otherwise.

    anLOOKFORCHAINLENGTH(chr) : integer
          Returns the length of the chain "chr" (the number of obstruction
          vertices in the graph for the corresponding path).

    anPRINTCHAIN(chr) : undefined
          Prints chain "chr". The vertices are printed as strings
          of variable names. Between these it prints the value of
          anEDGESTRING.

    anCONSTRUCTNEWCHAIN(chr, degdiff) : (chr1, chr2, ...)
          Constructing new chain records from an old one and a
          total degree different number. ch1, ch2 ... - is 
          a list of length 1+length[chr] with chr as a left factor.

    anCONSTRUCTZEROCHAINS(augredor)
          This routine should be called before the  calculation of
          Anick's resolution to construct initial data for
          defferential and integral recursive functions.

    anREDOR2CHAIN(augredor) : 1-chain record
          Converts data from one structure format to another -
          from augredor to 1-chain so that differential and
          integral functions could operate on this data.

    anLESSCHAINRECORD(chr1, chr2) : NIL/non-NIL
          Returns NIL ifchr1 doesn't preceed chr2 in "monomial deglex"
          order.

We have a global variable
    anEDGESTRING
          with initial value " " (space).

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    REDOR2CHAIN
          This procudure should be applied on the Mpt of
          each item of (CDR cGBasis) to get a new 1-chain record
          which will contain the differential (use anLESSCHAINRECORD
          to sort them in place). Go through the earlier "levels" of
          CHAINRECORDS and find new chains by means of CONSTRUCTNEWCHAINS.
          (sort).
          Calculate differentails for all new chains of length >=2 as
          above.
          Calculate new Betti numbers.

    REDANDMONMULT(augredactand, puremon)

    CFMONREDANDMULT(RedandCoeff, puremon, augredand)
          OrdinaryConcPolMonMult exists! (But wrong multiplication)
          In order to make larger lists use NCONC or RPLACD and
          LASTPAIR.
          Reduce Pol exists!
          REDANDCOEFF1 := 1;

    DestructRedandSimpLinComb(augredand1, augredund2, cf) : f=augredand or
                                                            NIL
          ( f := f1 + cf*f2 destructively)

    DestructChangeRedandSign(augredand) : augredand

    REDANDTERMPLUS(augredand, tm) : augredand or NIL

    ConcPol(polposition, purepol) :
          position should be of the last term of a (reductord or reductor)
          polynomial. purepol is concatinated to this polynomial.

    LatTmPos(pol) : polposition
          position is at the last term of a polynomial.
-----------------------------------------------------------------------------

