New features that have been added to Maple for version 4.0



Changes that require modifications to old maple source codes



$: $ replaces maple's seq function as the repetition operator.

It can be used in the forms:

expr $ k=1..n replaces seq(expr, k=1..n)

expr $ n replaces seq(expr, n)

$ m..n replaces seq(m..n)

or

`$`(expr, k=1..n)

directly corresponds to the former seq function invocation, yielding

a "quick fix" for old code using seq: simply assign seq := `$`.

mod: mod is now an operator (it is a keyword like and, or, not) so function

calls of the form mod(expr,p) must all be changed to expr mod p

( or to `mod`(expr,p) ). The functions modp and mods remain as

before, and by default `mod` := modp. Note also that expr mod p

remains unevaluated if p is not a numerical constant.

union, intersect, minus:

The operators used with sets are now "union" (formerly +), "intersect"

(formerly *), and "minus" (formerly ). These three operator names

are keywords in the language. The symbols +, *,  are now reserved

for arithmetic expressions only.

underscorenames:

Previously, names beginning with @ were valid in Maple. Now, @ is

an operator (used in the operator algebra), and the special character

used for forming system names is the underscore _ . It is recommended

that users refrain from using names beginning with an underscore

since the system creates and uses such names globally.

internalformat files:

Internalformat (.m) files created by a previous version of maple

cannot be read by a newer version. Such `.m` files must be recreated

from source.



Subscripted (indexed) names become valid Maple names.

Previous versions of Maple allowed subscripts (table references)

to be used only in some places where Maple expects a variable name.

Now, subscripted names are fully valid names in Maple. Examples:

divide(a,b,q[1]); and member(a,b,q[1]);

irem(a,b,q[1]); and iquo(a,b,r[1]);

for t[1] do ... od; and seq(..., t[1] = 1..n);

taylor(..., x[1]); and diff(..., x[1]);

map(f[1],a);

save a[1], a[2], file;

The definition of type "name" has changed. What used to be type

"name" is now type "string". Type "name" is now defined to be

either "string" or "indexed". Thus

x, x1, x_y, t[1], and t[k] are all of type name.

Unevaluated functions.

Some functions return unevaluated. For example, if A is an array,

then the array reference A[k] does not issue an error if k does

not have a value. This allows, for example:

sum(A[k],k=1..6)

without having to quote the A[k] to prevent it from evaluating

prematurely. This feature applies for any subscript (except for

a sparse table). Also, it applies for the following functions:

coeff(p,x,k) ==> coeff(p,x,k)

op(k,p) ==> op(k,p)

substring(s,1..n) ==> substring(s,1..n)

a.(1..n) ==> a.(1..n)

a mod p ==> a mod p

Neutral Operators (&operators).

A neutral operator symbol is any string of two or more characters

that starts with ampersand (&) and may contain any character except

()[]{};:'`& or blank. They may be used as unary prefix operators,

or infix binary operators, or as function calls. They generate

function calls, with the name of the function the same as the name

of the neutral operator.

New evaluation rules for Locals.

The evaluation rules for local variables have changed to "onelevel"

evaluation instead of full evaluation. This means that evaluation

of local variables is the same as evaluation of formal parameters,

but different than that of global variables. For example, suppose

the input to a Maple session is

a := b;

b := 1;

a;

Then what does last statement yield? In previous versions of

Maple a; evaluated to 1 . In this version, if these statements

are entered in an interactive session (a and b are global variables)

then a; still evaluates to 1 . However, if a and b are local

variables and these statements appear inside a Maple procedure, then

a; evaluates to b . Users should not notice any differences in

normal usage of Maple. If, however, it is desired to have full

evaluation or onelevel evaluation explicitly, the eval function

(see below) provides this functionality.

Explicit remember without option remember.

Previously, when the remember option was specified in a procedure,

all computed values were automatically remembered. In addition,

it was possible to remember a particular result by an explicit

call of the form remember( f(x) = y ); but ONLY if the function

f had option remember. In this version of Maple, this can be done

if f does not have option remember. This is possible because unlike

earlier versions, every procedure now has its own remember table.

This feature allows one to remember some values but not others,

thus providing greater flexibility. For example, suppose we want

to write a procedure for sin(x) that automatically evaluates sin of

a float to a float but does not remember any of these calculations

because they would require too much space. On the other hand, we

also want to remember that sin(Pi) = 0 etc. One would do:

sin := proc(x)

if type(x,float) then RETURN(evalf('sin(x)')) fi;

'sin(x)'

end;

remember(sin(0)=0);

remember(sin(Pi)=0);

remember(sin(Pi/6)=1/2);

New evaluation function eval for onelevel or full evaluation.

The normal mode of evaluation is "full recursive evaluation". For

example, in

a := b;

b := 1;

a;

The variable "a" evaluates to 1. Sometimes one needs to obtain a's

"value", that is the object that a points to, namely "b". The eval

function via eval(a,1) provides this functionality. We call this

"onelevel evaluation". It was previously used by save when saving

in external format and for the evaluation of parameters, and is now

also used for local variables. The eval function works for names,

subscripted names, local variables, and formal parameters. Other

expressions are returned unevaluated.

In contrast, in some places one wants to evaluate locals and

parameters fully, in the same mode as global variables. The eval

function again provides the desired functionality via simply

eval(expr).

New global variable "status".

This variable returns an expression sequence of length seven, which

contains (words used, words allocated, time, words used increment,

gc increment, words collected at last gc, words available at last gc),

respectively. The words used message now prints the first three

status values after every 20000 words used.

The following previouslyexisting functions are now automatically loaded:



gcdex extended Euclidean algorithm for polynomials

isolve solve for integer solutions

mgcdex extended Euclidean algorithm for polynomials modulo p

msolve solve for solutions in the integers modulo p

resultant resultant of two polynomials

testeq randompolynomialtime equivalence tester

New functions (use "help(f);" in a maple session for information about f):



chebyshev compute the Chebyshev series of a function

compoly find a nontrivial composition of a polynomial

chrem Garner's Chinese remainder algorithm

define define characteristics of an operator

difforms differential forms package

dsolve differential equation solver

edit expression editor (for valid Maple expressions)

eqn generation of EQN output for typesetting equations

eval onelevel or full evaluation of an expression

`evalf/int` numerical integration for a definite integral

fixdiv compute the fixed divisor of a polynomial

fsolve floatingpoint equation solver

grobner package for Groebner basis computations

igcdex extended Euclidean algorithm for integers

interp polynomial interpolation

iroot the nth root of an integer

laplace Laplace transforms and inverse Laplace transforms

linalg[bezout] create Bezout matrix from polynomials a(x) and b(x)

[genmatrix] generate coefficient matrix from a linear system

[ismith] determine the Smith normal form for an integer matrix

[smith] determine the Smith normal form for a polynomial matrix

maxnorm the infinity norm of a polynomial (max abs of coeffs)

mfactor polynomial factorization over integers modulo p

minterp polynomial interpolation modulo p

mres modular resultant in Zp[x]

mtaylor multivariate Taylor series

optimize common subexpression optimization

powseries formal power series package

priqueue priority queue facility

proot the nth root of a polynomial

realroot isolating intervals for real roots of a polynomial

residue compute the algebraic residue of a function

round round a number to an integer

rsolve recurrence equation solver

signum sign of a real or complex number

simplex package for linear optimization, including functions

such as feasible, maximize, minimize, pivot

simplify general purpose simplifier

sinterp sparse polynomial interpolation

sort general purpose sorting routine (uses shellsort)

symmpoly test for symmetric polynomial

translate evaluate a polynomial p(x) at x = x+t

write primitive facility for file output

Modified functions (use "help(f);" in a maple session for information):



convert/confrac new case: convert ratpoly to confrac

convert/ratpoly new case: ChebyshevPade approximation

degree,ldegree new functionality allows for the total degree, both

lexicographic and homogeneous ordering

eulermac using a better algorithm

evalf maps onto parts of a general expression; when applied

to an unevaluated int, performs numerical integration

gc now prints the first three status values

has has(x,y) or has(x,z) becomes has(x,[y,z])

intbound deleted (new name is maxnorm)

length now computes the length or size of any object

limit improved functionality

minimize solve a system of linear inequalities, using the

simplex algorithm; improved algorithm

save now allows subscripted names and unassigned names

seq functionality seq(f(i),i=n..n+3) no longer allowed;

the range values must be constants; the syntax now

uses the $ operator: f(n+i) $ i=0..3

solve several syntax and functionality changes; new routine

`solve/float` for linear systems with floatingpoint

coefficients; substantial improvements all around

Psi1, Psi2, ... Psi.n becomes Psi(n,x)

tdegree deleted (see degree)

type/linear type(expr,linear,...) is defined to be

type(expr,polynom,...) and degree(expr,...) = 1

type/quadratic type(expr,quadratic,...) is defined to be

type(expr,polynom,...) and degree(expr,...) = 2

type/polynom type(expr,polynom,integer), type(expr,polynom,rational)

and type(expr,polynom,numeric) mean that expr is a

polynomial over the domain of integers, rationals, or

reals, respectively;

type(expr,polynom,a[1]) is now valid as is

type(expr,polynom,f(x));

type(expr,polynom,integer[x,y,z]) becomes

type(expr,polynom,[x,y,z],integer)

type/ratpoly is available with argument sequences as in polynom

Internal efficiency improvements:



coeff avoid unnecessary copying for products; avoid

unnecessary fragmentation for sums

diff special code for polynomials and series; avoid

unnecessary fragmentation for sums

divide trial division is now performed over the integers

rather than over the rationals; remember table

is used for successful polynomial divisions;

to divide out a polynomial by its icontent, do:

divide(p,icontent(p),'p'); not p := p/icontent(p);

expand special code for recognizing monomials; includes a

better algorithm for large univariate polynomials

forloops, $ improved for small ranges

frontend now includes a check for the common case where no

"freezing" is required, thus avoiding allocation of

linear space which is nongarbagecollectible; the

fourth argument option has been deleted

genpoly now encoded internally so as to use linear space;

doing one integer division has doubled the speed

maxnorm now encoded internally so as to use constant space;

extended functionality for series and products

member now internal for direct access to the elements

read the following maple expressions can now be read from

source format in linear space:

lists, sets, sequences, tables,

sums, products, functions

set union,intersect,minus

now using variations of merging rather than bubblesort

sets sorting using shellsort rather than bubblesort

simpl sort sums of length > 20 terms using shellsort during

the collection of like terms

table sorting for the indexing functions symmetric and

antisymmetric has been improved to use shellsort

taylor special code for converting a polynomial into a series;

improved code for sums; improved increment sequence

for shellsort (used to sort exponents); using

Horner's rule for evaluation of a dense univariate

series with integer coefficients at an integer

type/polynom now does one pass rather than n passes where there are

n indeterminates
