Partial Evaluation of Maple

Home | Examples | Documentation | Download | Publications

Programmers wish to use high levels of abstraction and generality in order to create programs that are readable, modular, reusable, portable and maintainable. On the other hand it is often necessary to write programs that are efficient. These two goals are often in conflict; abstraction usually adds overhead and reduces the chances for optimization. Meanwhile the need for efficiency pulls the programmer away from abstraction and promotes the use of platform and type specific optimizations.

Partial evaluation (PE) is a program transformation technique that uses a subset of the inputs to a program to generate a specialized version of the program that will then accept the rest of the inputs. With PE it is possible to write algorithms in a highly general and abstracted form, and then automatically extract optimized versions of the algorithm specialized for certain inputs.

Partial evaluation performs aggressive optimizations by performing as much computation as possible based on the given inputs while generating code that will perform the deferred computations. Several specialized versions of a program section may be generated based upon different usages within the program. An optimized program generated by a partial evaluator may be larger in size than the original program, but will perform fewer computations at run-time.

Maple is a Computer Algebra System (CAS) and visualization environment. It uses a high-level language, which is also called Maple, to perform symbolic and numeric computations. Maple's core library contains a vast amount of mathematical knowledge and problem solving power.

MapleMIX is a partial evaluator for the Maple programming language. It is a program transformation and optimization tool for Maple programs. MapleMIX is a completely online partial evaluator written in Maple itself. It has the ability to produce highly specialized results from input programs and user provided static data. It was developed with two goals in mind. Firstly to produce optimized code by generating specialized versions of general algorithms. And secondly to exploit the vast amount of mathematical knowledge present in the Maple library by extracting precise answers to parametric problems written to produce generic solutions.

Home | Examples | Documentation | Download | Publications