We will discuss the functionalities, implementation and use of a converter translating Maple worksheets as automatically as possible into an equivalent (from a computational point of view) Mathematica notebook.
Most of the functionalities of the latest release of the Maple computer algebra system are also available in Mathematica, and several Maple users would be pleased to switch to Mathematica if they were able to convert their former work almost automatically. In France we especially identified the lack of portability of teaching materials as a barrier for several academics interested in testing Mathematica.
State of the Art
The only known attempt toward such a converter is a suspended project of Chris Willett and Lars Hohmuth (April 1998) working with old versions of both systems. The prototype developed was devoted to conversion of expressions only.
Applications of XML Capabilities
With recent releases of Maple, one of the native formats for worksheets is an XML dialect. The level of XML processing capabilities provided by Mathematica makes it very easy to import such a worksheet and to produce a structured representation of it, which is approximatively a SymbolicXML encoding of its Document Object Model.
Three Layer Conversion
Using this model as starting point, the conversion is then performed through three connected layers:
Detailed examples will show how those layers are working and how they are connected together.
- a document structure layer
- a content syntax layer
- a content semantic layer
More precisely we will describe the Maple wrapper produced by the syntax layer and how we translate it into the equivalent Mathematica expressions with the help of semantic dictionaries.
Even if the natural programming paradigm in Mathematica is not procedural, some translation functionalities are available for Maple definitions of procedures and functions.
Representation of graphics objects is also very different in Mathematica and Maple, but conversion is performed.
Format conversion layered on semantic and syntactic levels and based on content dictionaries has been widely tested in the OpenMath initiative (www.openmath.org). With a small effort, this converter could be made more generic and accept several other formats conforming to the OpenMath Standard.
We want to thank Jon McLoone (Wolfram Research Europe Ltd.) for his advice and pieces of code and Stéphane Dalmas for his valuable discussions.