The PoSSo Library for Polynomial System Solving 1. The ... - CiteSeerX

6 downloads 1304 Views 134KB Size Report
As another example, the memory management of PoSSo can be customised to the ... sion 0 and multiplicitym means that there are exactly m roots, multiple roots.
cfWorld Scienti c Publishing Company

The PoSSo Library for Polynomial System Solving GIUSEPPE ATTARDI Dipartimento di Informatica, Universita di Pisa, corso Italia 40 I-56125 Pisa, Italy

and CARLO TRAVERSO Dipartimento di Matematica, Universtia di Pisa, via F. Buonarroti 2 I-56123 Pisa, Italy Received (27 February 1995) Revised (7 April 1995) The PoSSo library is a sophisticated library of tools for solving systems of polynomial equations. Each tool is supplied as a framework, rather than as a traditional program library or as a self-contained package, providing a unusual level of exibility. Each framework consists of a collection of C++ classes, which allows the customisation of each tool. Customisation can happen either at compile time with the addition of new derived classes, or at run time through the selection from tables among prede ned choices. Tools like the Customisable Memory Management, allow for instance memory management to be nely tuned to the requirements of the Buchberger algorithm. This algorithm in turn can be specialised to work on di erent polynomial rings. The library achieves high levels of eciency both by incorporating advanced algorithms and by allowing the user to select the most appropriate strategy for each particular problem.

1. The PoSSo project

Project PoSSo (Polynomial System Solving) has developed symbolic computation tools for eciently solving systems of polynomial equations. These tools are collected in a portable library which provides the latest algorithms for polynomial systems. The library is suitable for incorporation into applications programs, in areas such as: kinematics, control theory, geometric modelling, and biochemistry. Purely numerical solving of polynomial systems manifests some problems: numerical inaccuracy; failing to nd all solutions or to recognise under-determined systems; not providing an understanding of the structure of the solutions; and inability to handle over-determined systems. These problems are not purely theoretical: they have caused major practical problems in areas ranging from aerospace engineering to pharmacology. The solution to these problems is to perform symbolic computation on the set of polynomial equations (and inequalities) instead of, or as well as, numeric computation. Such computations require proper use of advanced mathematical concepts. While currently scienti c software in general and computer algebra in particular is delivered to users via all-purpose packages which provide a variety of services, the 1

2

PoSSo

Library

PoSSo Library is provided as a customisable collection of tools. Each tool is supplied as a framework, rather than as a traditional program library. A framework o ers the possibility of specialising its core mechanisms to suit speci c needs. For instance, the choice of coecients for polynomials can be determined by the user, allowing him to express for instance polynomials on matrices. As another example, the memory management of PoSSo can be customised to the speci c needs of an algorithm. Frameworks overcome the limitations of existing general purpose packages which often do not o er either the functionality or eciency required by the users, and therefore force them to build their own special-purpose systems. The PoSSo Library exploits a tool for con guring software systems (autoconf1) which allows the library to be con gured for a particular environment and the selection of a variety of options at compile time. This allows the user to produce a custom version of the library which ts his requirements of functionality and eciency. The main results from the PoSSo project include:  a high performance C++ library for Polynomial Solving and speci cally for computing Grobner bases;  a collection of applications based on the library, in particular the PoSSo Server;  the PoSSo Central Control, that allows the use of the high performance PoSSo library in heterogeneous environments.

2. Grobner Bases

Consider a system of polynomial equations in several indeterminates (x1; : : :; xn) = X, over a eld k. If the equations are linear, an elementary method to solve them is to reduce the system to echelon form, e.g. with the Gauss-Jordan method. If n = 1, i.e. if the polynomials are univariate, one has to compute the GCD of the polynomials, and solve it. In the multivariate, non-linear case the preferred algebraic tool for solving it is by computing its Grobner basis. A Grobner basis corresponds roughly to a basis in echelon form, and the Buchberger algorithm2, which computes a Grobner basis from a set of equations, generalizes both the Euclidean algorithm and Gauss-Jordan algorithm. By means of Grobner bases and related tools one can:   

test whether a sytem has solutions or is incompatible test if a given equation is a combination of the initial equations (i.e. it is contained in the ideal generated by the initial system) compute the dimension and the multiplicity of the set of solutions | dimension 0 and multiplicity m means that there are exactly m roots, multiple roots being accounted according to their multiplicity

PoSSo

Library 3

perform operations on the ideals, like intersection and transporter, that at the level of solutions correspond to union and di erence. Moreover, if the set of solution is 0-dimensional (i.e. nite), with linear algebra tools one can:  nd one or more triangular systems, whose solutions together constitute the set of solutions of the original system | a triangular system being a system in which there is exactly one equation that contains the rst r variables, and is monic in the last variable; hence it can be solved numerically recursively using tools for univariate polynomials  nd the number of distinct roots, the number of real roots, the number of real roots in a region identi ed by polynomial inequalities (e.g. a disk, a rectangle, a quadrant...)  nd a set of \generalised companion matrices", mutually commuting, such that the vector of eigenvalues of the symultaneous eigenvectors are the solutions of the system; this is another possible tool for numerical solving. The theoretical complexity of the Buchberger algorithm is quite high (doubly exponential in the number of variables), but this bound is not attained in practice, since systems with \reasonable" geometric properties behave much better; for example, for zero-dimensional systems the expected complexity is polynomial in the number of roots (unless some wild phenomenon happens at in nity). In practice, the examples which are bad for Grobner basis are also bad numerically. Moreover in many cases pre-processing through a Grobner basis transforms a hard numerical problem into a simpler one. In many relevant cases for applications, Grobner bases have proved to be an invaluable tool even for numerical solving of polynomial systems. To quote just one important symbolic problem, the complete symbolic solution of Yang-Mills plane equations has only been possible through Grobner bases. Computing Grobner bases symbolically has the drawback that the coecients of polynomials generated may grow enormously. The use of numerical approximations in the Buchberger algorithm poses dicult problems, (of the kind that one nds with the Euclid algorithm for computing a polynomial GCD); these are probably solvable through a hybrid approach which is currently an active subject of research. 

2.1. Grobner strategies

The Buchberger algorithm relies on the choice of a total ordering on the set of monomials, and these orderings have in uence on the size of the computation and of the results; but the ordering is also partly determined by the kind of problem to be solved. Hence a xed ordering is not satisfactory. The algorithm is non-deterministic: the result is independent from the strategy, but execution time depends heavily on the choices, and this too has to be adjusted to the di erent problems.

4

PoSSo

Library

This poses a challenging problem for the construction of a library since the choice of strategies cannot be xed once and for all.

3. Customisation

We sketch the kind of customisations possible in two of the main components of the PoSSo library: memory management and the Buchberger algorithm.

3.1. Memory Management

Memory management is a critical aspect in symbolic computing and indeed specialised symbolic languages provide automatic garbage collection. For the PoSSo library C++ was chosen as implementation language to facilitate its inclusion in applications and therefore we had to develop a garbage collection facility for C++. The design requirements for our Customisable Memory Management (CMM) framework where to allow the coexistence with programs not aware of garbage collection, provisions for compacting memory, and compiler independence. The collector is therefore conservative, meaning that it traces all memory locations which may be interpreted as pointers. This ensures that pointers to collectable objects can be passed to external procedures without risk of being reclaimed. The CMM allows for the management of multiple heaps, each one implementing a di erent allocation discipline. This is achieved by specialisation of the basic class Heap in the CMM framework. The class DefaultHeap provides a heap which is managed though copy and compaction. In the Buchberger algorithm, we take advantage of customisation by de ning a special temporary heap which is used within the inner loop of the algorithm, and which can be freed in block after each cycle. Extensive benchmarking4 proved this solution to be quite bene cial, since the Buchberger algorithm is very memory intensive and traditional garbage collection techniques lead to thrashing where signi cant amounts of time are spent in garbage collection.

3.2. Buchberger Algorithm

The implementation of the Buchberger algorithm provided in the PoSSo library is open and customisable. The customisation can be done at compile time by extending the framework of classes. For instance new classes of coecients can be supplied, e.g. integers modulo p have been de ned with their own proper arithmetic. Performing computations modulo p can be useful for guring out the sequence of simpli cations that lead to the solution: the same sequence can then be applied to the original coecients with signi cant gains in performance. The implementation is open since all the critical choices in the algorithm can be overridden by the user, in particular:  choice of ordering among monomials

PoSSo

Library 5

insertion order in the basis  normalisation of polynomials  handling of critical pairs of polynomials Several alternatives for these options are available through tables and the user can select among these options even at run time. Needless to say, a user can extend these tables by providing his own procedures. 

3.3. Con guration

For a complex and sophisticated system tool like the PoSSo library, standard utilities for system construction like make are inadequate. Di erent versions of the library must be built from a single set of sources according to either con guration choices of the user or target architecture speci cs. Each con guration choice involves many dependencies which re ect at various level in the system which is made up of a hierarchy of directories corresponding to the structure of subsystems. Therefore a con guration choice must percolate through such hierarchy. The mechanism of con guration has to provide these capabilities and has to be itself portable, without relying on additional tools. We choose to use autoconf, a utility from the Free Software Foundation, which generates, from a le containing meta-speci cations for the system, a standard shell script to perform con guration. The con guration script is normally used to determine parameters and features of the environment where the system is being built, in order to facilitate its portability across platforms. In the PoSSo library, autoconf is used in cunjunction with templates for Makefile's which are automatically updated according to the con guration options supplied by the user. For instance, all the user needs to do to produce a version of the library which uses CMM for garbage collection and integers modulo p for coecients: configure --gc=cmm --coeff=zp

4. The PoSSo Library

The PoSSo Library (PL) consists of four parts: Basic tools: they include Error Handling, Memory Management (CMM), a very ecient implementation of multiple precision arithmetic and basic structures like lists, vectors and tables. Algebraic tools: they include basic arithmetic packages (e.g. a package for computing Hilbert functions) and basic algebraic elements like Coecients, Monomials, and Polynomials. The inheritance mechanism of C++ is exploited for selecting, at run-time, between alternative implementations of such mathematical structures. Suitable primitives are provided for converting between di erent representations.

6

PoSSo

Library

Grobner basis tools: the main tool is an implementation of Buchberger's algo-

rithm, with the provisions for customisation described earlier. Real Solving tools: they include a package for counting the real roots of a multivariate polynomial system with integer coecients. For univariate polynomials, an implementation of the Sturm-Habicht algorithm is available for counting the real roots using a customisable Euclidian division. The PL is written in C++ and has been ported to a number of platforms including SunOS, Solaris, Linux and AIX. The CMM has been also used separately in a number of projects including a few within US companies.

4.1. PL-based Applications

The PL has been used to implement the PoSSo Server. The server implements a protocol which allows distributed applications to access almost the entire functionality of the library. Client applications interact with the Server via socket connections. The applications developed with the PL have also been used to perform intensive benchmarks of the PL. Compared with similar commercial products, the PL exhibits greater exibility and signi cantly better performance.

4.2. The PoSSo Central Control

A specialised software architecture has been built around a component called the Central Control. The Central Control has been designed as the kernel of an environment which can o er common and concurrent access to several tools needed by scientists and engineers: general purpose and specialised computer algebra systems, visualisation tools, links with numerical libraries and tools to manipulate numerical programs.

Acknowledgements

This research was funded in part by the CEC under contract ESPRIT BRA 6846 POSSO, Polynomial System Solving.

References 1. D. MacKenzie, \Autoconf", Free Software Foundation, 1994. 2. B. Buchberger, \Grobner bases: an algorithmic method in polynomial ideal theory", Recent trends in multidimensional systems theory, N. K. Bose (Ed.), D. Reidel Publ. Comp., 1985, p. 184{232. 3. G. Attardi and T. Flagella, \A customisable memory management framework", Proceedings of USENIX C++ Conference 1994, (Usenix Association, Berkeley, 1994), p. 123. 4. G. Attardi and T. Flagella, \Memory Management in the PoSSo Solver", submitted for publication.

Suggest Documents