7.2 Wrapping

class Wrap( wrapInterface, poly)
Specifies wrapping to organize the criteria application
wrapInterface:
defines the wrapping interface (see 6.1)

poly:
polynomial (see 6.2)

The class Wrap contains the following methods:

lm( )
returns the leading monomial of a polynomial.

ancestor( )
returns the ancestor of a given polynomial, i.e. the last if a polynomial with the lowest leading monomial such that the given polynomial has been obtained from that polynomial by a (sequence of) head irreducible non-multiplicative prolongations.

poly( )
returns the polynomial.

multi( )
returns the number of multiplicative variables.

degProlong( )
returns the degree of variable whose was contributed to obtain the given polynomial as a prolongation of another polynomial.

isProlong( )
returns True if a polynomial is prolongation of another polynomial, and False, otherwise.

buildProlong( )
returns the list of degrees of variables which were used for prolongation of a given polynomial.

A small program illustrates the work with wrapping of polynomials after the Gröbner basis construction:

import ginv

st = ginv.SystemType("Polynomial")
im = ginv.MonomInterface("DegRevLex", st, ['x', 'y', 'z'])
ic = ginv.CoeffInterface("GmpZ", st)
ip = ginv.PolyInterface("PolyList", st, im, ic)
iw = ginv.WrapInterface("CritPartially", ip)
iD = ginv.DivisionInterface("Janet", iw)

def printWrap(w):
  print "          lm =", w.lm()
  print "    ancestor =", w.ancestor()
  print "        poly =", w.poly()
  print "       multi =", w.multi()
  print "  degProlong =", w.degProlong()
  print "   isProlong =", w.isProlong()
  print "buildProlong =", w.buildProlong()

basis = ginv.basisBuild("TQBlockLow", iD, \
  ['x^3 - y^2 + z - 1',\
   'y^3 - z^2 + x - 1',\
   'z^3 - x^2 + y - 1'])

for i in [0, 6, 12]:
  printWrap(basis[i])
As a result the following will be printed out:
          lm = x^2*y^2*z^3
    ancestor = z^3
        poly = x^2*y^2*z^3 + (-1)*x^2*y^2 + x*y^2*z + x^2*z^2 +
(-1)*x*y*z^2 + x^2*y + (-1)*x*y^2 + x^2 + (-1)*x*y + (-1)*y^2 + z + (-1)
       multi = 1
  degProlong = 0
   isProlong = True
buildProlong = [1, 1, 0]
          lm = x^2*y^3
    ancestor = y^3
        poly = x^2*y^3 + (-1)*x^2*z^2 + (-1)*x^2 + y^2 + (-1)*z + 1
       multi = 2
  degProlong = 0
   isProlong = True
buildProlong = [1, 0, 0]
          lm = z^3
    ancestor = z^3
        poly = z^3 + (-1)*x^2 + y + (-1)
       multi = 1
  degProlong = 0
   isProlong = False
buildProlong = [1, 1, 0]