jscl-meditor - java symbolic computing library and mathematical editor

News

As of version 3.0, meditor adopts a pluggable engine architecture. Currently, beside the standard JSCL library, packages for JAS, Yacas (thanks to Axel Kramer who suggested it) and HartMath are provided. There is also an experimental, Scala-based one named ScAS (which is in fact just bare Scala as for now). There are others planned - ultimately every open source symbolic package ever written for Java (or one of its scripting languages) - in the spirit of the Sage project.

Project description

The goal of this project is to provide a java symbolic computing library with a mathematical editor front-end. There are several computer algebra systems available on the market, most of them developed in other languages, mainly C/C++ and Lisp. But the benefits of using java in symbolic computation are great. Aside from being widely used and to comply with various standards, this language has two features of concern : readability and portability.

Regarding readability, the goal is to produce a code as nice and short as the pseudo-code found in textbooks or research papers. As an illustration, here is what the Euclidean algorithm would look like:

        Polynomial gcd(Polynomial p, Polynomial q) {
while(q.signum()!=0) {
Polynomial r=p.remainder(q);
p=q;
q=r;
}
return p;
}

It entails a dedicated development effort. This choice of clear coding, enabled by java, may have consequences in terms of performance compared to other software. But it could be worth the commitment, in the respect that understanding an algorithm just by looking at the code is made possible. Object-orientation allows to hide ugly optimizations behind a clean, easy to use interface.

Some may doubt however that java will ever be as clear as C++ because it doesn't provide operator overloading, which means that a+b is written a.add(b), and will remain as such. The interested reader can look at the on-going discussion on the matter at Sun.

As for portability, it means that a lot of platforms are available at no cost, from powerful unix workstations or servers to handheld devices. To make it possible, the project is split in two parts : the engine (jscl) and the mathematical editor front-end (meditor). The engine is usable interactively or in batch mode from a java shell interpreter (like BeanShell for instance), or as a java library in any third-party application.

The front-end has currently two implementations (see below). Among others, it is intended for taking course notes. With it, a student can perform the calculations asked by their teacher fast and reliably. The plain text format should make the exchange of notes easy. The produced worksheets can be published on-line thanks to the MathML output feature, for instance on meditorworld (MathML capable browser needed, tested to work with Mozilla).

Implementations

The current implementations of the front-end are as follows:
Click here to launch the desktop application via java web start.

There was a special effort to make the palm front-end powerful enough for school use, by compiling the software into native code with Jump.

Symbolic capabilities

The symbolic capabilities are currently:

Download

Go to the Project summary page.

Installation

Desktop version

Extract the archive into any appropriate directory on your hard drive. It will create a "meditor" directory. Change dir to it.

To run meditor on 1.6:
  java -jar meditor.jar [file.txt]
  java -Duser.home=[docs] -jar meditor.jar

Once the application is up, you may open the docs/presentation.txt and try the examples contained there.

PalmOS version

Go to the "palm" subdirectory. Upload the editor.prc into the device.

To have the data persisted, create an entry in the memopad with the word "meditor" (+return) on the first line. The memo.csv that you can optionally install (via your desktop application import) has such an entry and several other memos containing the documentation.

Dependencies

jeuclid 3.0.3 patched (included)
fop 0.94 (included)
xerces 2.7.1 (included)
xsltml 2.1.2 (included)
beanshell 2.0b4 (included)

FAQ

Q1. When I want to do a calculation, the palm displays this error message : jscl/text/ParseException.

A1. The auto-select has been disabled in v0.11 and subsequents because expressions can contain newlines so there isn't any reliable means to guess the end of selections. Select the expression with the stylus.


Q2. Do I need MathLib ?

A2. No.


Q3. How do I run the bsh examples ?

A3. Add the meditor bin directory to the path, give bin/jscl execution privilege (unix), then type : jscl [example.bsh]


Q4. My limit input is returned unchanged. What am I doing wrong ?

A4. Nothing. The limit operation isn't implemented. It is kept because of its MathML rendering usefulness.


Q5. Factoring the expression [insert mildly complex expression] takes forever. Is there an endless loop ?

A5. The factorization algorithm is an attempt to re-invent polynomial factorization from scratch, with a non-modular approach. But it is inefficient. I need to implement a classical Berlekamp + Hensel lifting algorithm.


Q6. Is there a tutorial ?

A6. Yes, see presentation.txt (desktop version) or the presentation memo item (palm version).


Q7. What is the action of the buttons of the palm interface ?

A7. It is described in the buttons memo item.


Q8. Could we put the computed expression on a new line and preserve the original input line ? It's nice in CAS systems to see a progression of input lines and output lines so you can follow each math step that was taken.

A8. It was possible in former versions, by terminating the input expression with "=", and was removed when the parser was made to accept equations (which is now disabled, by the way). As the software is meant to be a typesetting system rather than a calculator, this is likely to remain, despite the overhead of copy/pasting.


Q9. When will there be v2.0 for palm ?

A9. There already is. It is included in the desktop plateform package. The other handheld versions however are discontinued.

Acknowledgements

Thanks to Klaus Hartlage, Yves Noyer, Jeffry Madura, Eric Smith, Sergio Melas, Andrea Boright, Ross Green, Nicolas Rosillo, Marten van Wezel, Toyin Akin, Philippe d'Oreye, Sione Palu, Michael Braginsky, Mike Thomas, David Schneider, Oleg Volkov, Markus Hohenwarter, Dimitri Pissarenko, Eckhard Hitzer, Daniel Fontijne, Alfredo Vianna, Oliver Pretzel, Axel Kramer, Bob Orchard.

Related projects

HartMath Java Computer Algebra Tool
Yacas Yet Another CAS
MTAC - More than a Calculator
JScience Java Tools and Libraries for the Advancement of Sciences
GeoGebra dynamic mathematics software that connects geometry, algebra and calculus
MathEclipse Small computer algebra server written in Java
MVT Mathematical Visualization Toolkit
MathDrag'n Symbolic Equation Manipulator
GCalc mathematical graphing system in Java
JAS Java Algebra System

Contact

You can send your reactions to raphael.jolly@free.fr. For bug reports and support requests, you've got tools on the Project summary page.

Copyright

The GNU General Public License

SourceForge.net Logo 
last updated on Thu May 15 2008