Partial Evaluation of Maple

Home | Examples | Documentation | Download | Publications

Partial Evaluation for Maple

Jacques Carette and Mike Kucera
Partial Evaluation and Program Manipulation (PEPM 2007)

Having been convinced of the potential benefits of partial evaluation, we wanted to apply these techniques to code written in Maple, our Computer Algebra System of choice. Maple is a very large language, with a number of non-standard features. When we tried to implement a partial evaluator for it, we ran into a number of difficulties for which we could find no solution in the literature. Undaunted, we persevered and ultimately implemented a working partial evaluator with which we were able to very successfully conduct our experiments, first on small codes, and now on actual routines taken from Maple’s own library. Here, we document the techniques we had to invent or adapt to achieve these results.

Download: Long Version PDF  Short Version PDF

Partial Evaluation and Residual Theorems in Computer Algebra

Mike Kucera and Jacques Carette
Calculemus 2006

We have implemented a partial evaluator for Maple. One of the applications of this partial evaluator is to find, in Maple, what is the difference between generic or symbolic evaluation, and complete evaluation. More precisely, when asked degree(a*x^2+3,x), Maple replies 2, which is generically true. However, we are interested in the residual formula ¬(a = 0) which, as a guard, makes the answer 2 correct. While special algorithms have been derived in the past for this particular situation, we show how we can derive many of these algorithms as special cases of partially evaluating Maple code.

Download: PDF

Partial Evaluation of Maple Programs

Mike Kucera's Master's Thesis
McMaster University, 2006

Download from PDF

Home | Examples | Documentation | Download | Publications