The Mathematica Journal
Current Issue
Tricks of the Trade
In and Out
Riemann Surfaces IIc
The Mathematica Programmer
New Products
New Publications
News Bulletins
Editor's Pick
Write Us
About the Journal
Staff and Contributors
Back Issues
Download This Issue

What is Leibniz?

Leibniz is a stand-alone text and equation editor for Windows and MacOS computers implemented in C++. Leibniz communicates with the Mathematica kernel via MathLink, sending requests for calculations to the kernel and formatting and displaying the results. In addition to the application itself, the system also includes LZCompute.m, a Mathematica package that mediates the communication between the Leibniz front end and the kernel.

Leibniz implements a powerful and easy-to-use mouse-driven calculation system. Users perform calculations by selecting a portion of an expression to evaluate and pressing enter, or rearrange the expression by dragging a selection from one part of an expression to a new location. For example, to compute an integral the user would type the integral, select it, and press enter. To move a term from one side of an equation to the other by, say, subtracting the term from both sides, the user selects the term and drags it to the other side of the equation. This system is particularly powerful and easy to use because Leibniz takes advantage of Mathematica's powerful pattern matching capabilities to match the form of an expression to manipulations that could be performed on it.

When the user selects a portion of an equation, the application parses the equation and translates it into an internal data structure that reflects the structure of the equation. At the same time, the application calls a function contained in the LZCompute package. The purpose of this function is to examine the structure of the expression the user has selected and to return a list of possible mathematical manipulations that could be performed on the expression. These possible manipulations come back ranked in order of likelihood, with the most likely option displayed to the user in a message panel located in the lower left corner of the document window. The user can then press enter to have that calculation carried out, or hold down the command key and click on the selection to pop up a menu containing the other calculation options contained in the list.

Dragging operations are implemented in a similar fashion. As soon as the user clicks in the selected portion of an expression and starts to move the mouse, Leibniz queries the kernel to see if any manipulations are possible. As the user drags the mouse into each new part of an expression, the Leibniz front end calls a function in the LZCompute package to determine whether or not that portion of the expression is a valid target for a drag-and-drop manipulation. As soon as Leibniz has found a valid target, the application displays a box around the target portion of the expression and displays a message in the message panel indicating what manipulation the system thinks the user is trying to accomplish.

As soon as the user releases the mouse button, Leibniz sends the expression to the kernel along with a request to perform the desired manipulation. When the result comes back, Leibniz formats and displays the result. If multiple manipulations are possible, the most likely manipulation gets displayed in the message panel followed by the ellipsis character (...) to indicate that more options are possible. To access alternative options during a drag-and-drop operation, the user holds the mouse pointer stationary for a brief period to pop-up a menu of alternative options.

Copyright © 2002 Wolfram Media, Inc. All rights reserved.

[Article Index][Next Page]