
Description


•

Domains is a tool for developing code for complicated algorithms. The computational facilities offered by Domains differ from Maple in that you can parametrize a domain, for example, a polynomial or matrix ring, by the coefficient ring. This means that the code is more general as it will work in principle for any coefficient ring.

•

When computing in Domains, you first construct a domain of computation. For example, if you want to compute univariate polynomials with rational coefficients, first create the ${Q}_{x}$ domain as follows

>

P := DenseUnivariatePolynomial(Q, x):


The value assigned to $P$ is a Maple table of the operations, available for computing with polynomials in ${Q}_{x}$. For example, you can compute the remainder of two polynomials $a$ and $b$ by doing

•

To use Domains interactively, you must first load it into Maple using with(Domains);


This also assigns the variables Z and Q to the domain of integers and rationals respectively, effectively by executing $Z\u2254\mathrm{Integers}\left(\right)$ and $Q\u2254\mathrm{Rationals}\left(\right)$, and defines many standard abbreviations for the domains known to Domains. For more information, see Domains/domain. Having defined the integers Z, you can compute the remainder of two integers m and n by doing

•

The principle advantage Domains offers over Maple is in allowing you to parametrize domains (for example, polynomial, series, and matrix rings) by a coefficient ring $R$. If you know how to compute in a coefficient ring $R$, and you write code for polynomials, then that code should work for any ring $R$. You should not have to rewrite the polynomial code for a new $R$.


Consider another example. Suppose you have implemented Gaussian elimination to solve a linear system of equations over a field $F$. Domains allows you to parametrize your subroutine by $F$ so that your routine works for all fields, not just the field of rational numbers that you may have envisioned when writing the routine. This is accomplished by grouping all operations in a ring or a field into a datastructure called a domain. In Domains, a domain is a Maple table of operations. For more details on domains and a list of known domains, see Domains/domain.



Coding


•

Coding with the Domains tool is quite straightforward, although you must packagecall every operation. (See examples/Domains.) For an example of how to code a simple function that computes with values of a domain, see Domains/coding.


Coding domains is somewhat more difficult and also cumbersome because nested lexical scopes and closures are not supported in Maple and must be simulated. It is recommended that you study the code of existing domains.

•

Before using Domains, read the example worksheet examples/Domains to see a Domains sample session.



Acknowledgements


•

Some of the main ideas behind Domains come from the AXIOM system, which was formerly called Scratchpad II. AXIOM also has the notion of parametrized types which it calls domains. The author of Domains would like to acknowledge the use of the primary idea behind AXIOM, namely that of passing as a parameter a collection of functions as a single unit, which the authors of AXIOM have termed a domain.



