%html

MPReduce Plugin Instructions

Reduce is a general-purpose computer algebra system that has been in development since the 1960s. MathPiperIDE includes an experimental version of the Java version of Reduce (called MPReduce) which is designed to act as an embedded CAS. The Reduce source code is under a modified BSD license and the Reduce project's website is at http://reduce-algebra.sourceforge.net.

The MPReduce plugin launches an MPReduce instance and then communicates with it using an input stream and an output stream.

Using %reduce Folds In A Worksheet To Interact With The CAS.

MathPiperIDE worksheets are simply text files which have an .mpws extension. In order to communicate with the CAS using a worksheet, create a new file, save it with a .mpws extension, and then add one or more %reduce folds to the worksheet. (Note: the file will not be recognized as a worksheet until after it has been named and given a .mpws file extension.)

You can enter a %reduce fold by typing in the MPReduce begin fold tag and end fold tag like this:

%mpreduce

2 + 2;

%/mpreduce


As an alternative to manually typing in the fold tags, you can place your cursor on the line you want to begin a fold on, press your right mouse button, and select the Insert Reduce Fold command to have an empty fold automatically inserted into the worksheet beginning at the cursor.

The code that is entered inside of a %reduce fold is executed by placing the cursor in the fold and then pressing <shift><enter>. There is an example MPReduce worksheet in the examples directory (which is present in the MathPiperIDE main directory) that contains some MPReduce folds that can be executed.

Using The MPReduce Console To Interact With The CAS

The MPReduce console provides a REPL interface to the CAS that can be used to interact with the CAS concurrently with the worksheet folds. When MathPiperIDE is first launched, the Console plugin is not docked to a side of the application and it must be launched by selecting Plugins -> Console -> Console. The Console plugin contains multiple consoles and the System console is the one that is shown by defult. To switch to the MPReduce console, select the word "System" in the upper left corner of the Console plugin and then select the MPReduce plugin.

If you want to dock the Console plugin window instead of having it float, select the small black inverted triangle which is in the upper left corner of the Console plugin window and the docking menu will be shown. This docking menu will allow you to dock the plugin on the top, bottom, left, or right sides of the application. Note: there is a small black inverted triangle which is present near the plugins which are docked on any side of the application, and selecting it will bring up the docking menu.

Code is sent to the CAS from the MPReduce console a line at a time by entering a line of code and then pressing <enter>.

Evaluation can be halted by pressing the stop button which is in the upper right corner of the console.

%/html %output,preserve="false" . %/output