Run-REDUCE-FX remembers user preferences and uses them the next
time it starts. It uses the standard Java
package java.util.prefs, which stores data persistently
in an implementation-dependent backing store. On Microsoft Windows
the preferences for this application are stored in the registry
under the key
"Computer\HKEY_CURRENT_USER\Software\JavaSoft\Prefs\fjwright\runreduce
"
and on Linux they are stored in the XML file
"~/.java/.userPrefs/fjwright/runreduce/prefs.xml
".
By default, Run-REDUCE-FX looks in the standard places for a
REDUCE installation. On Microsoft Windows it looks for the folder
"\Program Files\Reduce
" on all accessible drives. On
Linux it assumes that executable files are under
"/usr/lib/reduce
", package information is in
"/usr/share/reduce/packages
", and documentation is in
"/usr/share/doc/reduce
". But this information can all
be reconfigured.
The main window consists of one or more REDUCE panels that can each run an independent invocation of REDUCE. There are three options: a single REDUCE panel (the default); a split pane containing two REDUCE panels side-by-side that are both visible; a tabbed pane containing one or more REDUCE panels, of which only the selected panel is visible. The choice of display pane arrangement is controlled by options in the View menu. You can switch dynamically among the three options, in which case the currently selected REDUCE panel (only) and the REDUCE invocation running in it (if any) is preserved and carried to the new display pane arrangement, but any other REDUCE invocations are discarded. With a split or tabbed pane, the active REDUCE panel can be selected by clicking on the desired panel in a split pane or tab on a tabbed pane. The non-selected panel in a split pane is greyed out and the selected panel displays a green dot near the top right-hand corner, immediately to the left of the Hide Editor toggle button. All controls apply (primarily) to the currently selected REDUCE panel.
Tabs are initially labelled Tab 1, Tab 2, etc., and a new tab is labelled Tab n if it is the nth tab to be added. (Removing tabs does not affect the numbering.) However, when REDUCE is run in a tab, the tab label changes to the name of the REDUCE command being run, and remains so until a different REDUCE command is run in that tab.
A REDUCE panel normally consists of two panes one above the other. The top pane displays all the REDUCE input and output in the current session. It is read-only. The bottom pane is an input editor that supports all the standard keyboard and mouse-based editing facilities normally provided by your platform. It is disabled unless REDUCE is running in this panel. Both panes display vertical and horizontal scroll bars when necessary. Text does not wrap. The horizontal divider separating the two panes can be dragged up and down.
There is a toggle button in the top right-hand corner of each REDUCE panel, which when clicked hides the input editor. This is useful for viewing long runs of output. Clicking the button again shows the input editor.
The name of the currently running (or last run) REDUCE command is appended to the label of the REDUCE input/output display pane. (You can edit the command names in the REDUCE configuration dialogue.)
You type (or paste) REDUCE input into the input editor pane, edit it as necessary, and then click on the Send Input button, which sends the input to REDUCE and echos it in the top pane. This clears the input editor, but you can scroll through the previous input (entered via the input editor) using the Earlier Input and Later Input buttons. Scrolling to input later than the last previous input clears the input editor pane back to its state before you started scrolling.
When keyboard focus is in the input editor pane, the following keyboard shortcuts are active:
Keyboard Shortcut | Action |
---|---|
Control+Enter | Send Input (auto-terminated) |
Control+Shift+Enter | Send Input (not auto-terminated) |
Control+UpArrow | Earlier Input |
Control+DownArrow | Later Input |
where Enter is the Return or Enter key and UpArrow / DownArrow are the cursor up / down keys, respectively.
Sending input to REDUCE strips any trailing white space, normally auto-terminates it by adding a semicolon if there was no final terminator, and then adds a final newline. However, if Run-REDUCE-FX detects a question mark in the input prompt then it suppresses auto-termination (so if you really want a terminator you must enter it explicitly). As an additional precaution, holding the Shift key while clicking on the Send Input button or pressing Control+Enter always suppresses auto-termination.
You can edit previous input recalled into the input editor as necessary and then send it to REDUCE. Input can be multi-line, in which case Run-REDUCE-FX processes all the lines together. The Send Input action is disabled unless REDUCE is running, and the Earlier Input and Later Input actions are disabled unless there is earlier or later input, respectively.
The pop-up keyboard provides access to special symbols and Greek letters on the top half of the keyboard and elementary functions on the bottom half. It is available by clicking the primary mouse-button (normally the left if there is more than one) while holding down the Control key while the mouse pointer is over an input editor text area or any text field in a template or function dialogue. Note that clicking the secondary (normally the right) mouse-button on any text field pops up a generic editing context menu.
Clicking on a character button on the top half of the pop-up keyboard causes that character to overwrite the selected text if there is any or otherwise to insert at the text cursor (caret). Clicking on a function button on the bottom half of the pop-up keyboard causes that function to be applied to the selected text if there is any (i.e. wrapped around it using parentheses) or otherwise to be inserted followed by parentheses at the text cursor, which is left within the parentheses. The pop-up then closes. The pop-up also closes if you click anywhere outside it, or you can close it by clicking on the Close button in the bottom left corner or by pressing the Escape key on your main keyboard.
By default, the top half of the pop-up keyboard provides the REDUCE symbolic constants ∞ (infinity) and π (pi) in the left column and the lower-case Greek alphabet in the right block, and the bottom half of the pop-up keyboard provides common elementary functions in the left block and trigonometric and hyperbolic functions in the right block. The pop-up keyboard has two layers and the secondary layer is accessed by either clicking on the Shift button in the top left corner or holding down the Shift key on your main keyboard. Note that the physical Shift key does not act as a toggle but the virtual Shift button does. The top half of the secondary keyboard layer provides additional REDUCE symbolic constants and upper-case Greek letters; the bottom half provides common predicates and inverse trigonometric and hyperbolic functions.
All special symbols on the pop-up keyboard have their names spelt out appropriately using ASCII characters automatically before sending them to REDUCE. The symbolic constants in the top left column are given their REDUCE names and the Greek letters in the top right block use the TeX naming convention. Note that, by default, special symbols are translated to REDUCE identifiers only when they are sent to REDUCE, not when they are inserted into the input editor. The results should be accepted as identifiers and typeset appropriately by all versions of REDUCE.
If you hover your mouse pointer over a symbolic constant button then a tooltip pops up giving the REDUCE name of the constant and a brief description of it and/or its conventional name and approximate numerical value (if appropriate). If you hover your mouse pointer over a Greek letter button then a tooltip pops up giving its TeX-style name. If you click on the English button in the top right corner of the pop-up keyboard or hold down the Alt key whilst clicking on any button on the top half of the pop-up keyboard then its name spelt-out using ASCII characters is output instead of the single non-ASCII character.
If you hover your mouse pointer over a function key then a tooltip pops up giving its full name. If you click on the Radians button in the bottom right corner of the pop-up keyboard or hold down the Alt key whilst clicking on any trigonometric function button then the degree version of the function is used. The label on the Radians button changes to Degrees it you click on it or hold down the Alt key, and changes back to Radians if you click on it again or release the Alt key. This label shows the current trigonometric function mode. Note that degree mode only works if the TRIGD package has been loaded in REDUCE. At some later date I hope to be able to automate this, but for now you need to do it by hand.
Note that some characters are available as both symbolic constants and as Greek letters, but only π means the same in both cases. In order to preserve the two meanings, the symbolic constants maybe preceded by a Unicode zero-width non-joiner (ZWNJ) character, which is removed automatically when the symbolic constant is sent to REDUCE. The ZWNJ character is invisible but it is nevertheless there. If you move the text cursor past a symbolic constant you will also need to move it past the ZWNJ character, although you will not see the cursor move, and if you delete a symbolic constant you should also delete the ZWNJ character, although again you will not see the cursor move. (If you don't delete it then it could cause confusion.)
Run-REDUCE-FX supports the following keyboard shortcuts on Windows and Linux:
Select all in focused control or window | Ctrl+A |
---|---|
Cut the selection and store it in the clipboard | Ctrl+X |
Copy the selection into the clipboard | Ctrl+C |
Paste contents of clipboard at cursor | Ctrl+V |
Undo the last operation | Ctrl+Z |
However, REDUCE input/output display panes are read-only and so only support select and copy operations. All input areas also support an editing context menu, which is available by clicking the secondary (normally the right) mouse-button while the mouse pointer is over the input area.
Some items in this menu pop up a dialogue that allows you to select one or more items, such as filenames. This dialogue supports all the standard keyboard and mouse-based selection facilities normally provided by your platform. In particular, in dialogues that allow selection of multiple items, holding the Control key down while clicking on an item selects or deselects it without affecting any other selections, and holding a Shift key down while clicking on an item extends the selection to that item. Double-clicking on an item selects it and then immediately runs the action associated with the confirmation button.
Most of the menu items run a REDUCE command, which is echoed in the display pane but does not appear in the input editor. The file chooser dialogues all share the same default directory, which normally is initially your home directory, but the last directory you used will be the default directory the next time you use a file chooser dialogue. This default directory is generally independent of REDUCE's default directory, even if it is initially the same.
The File menu provides the following items:
Selecting this causes Run-REDUCE-FX to echo file input to the Input/Output Display pane. It is selectd by default.
This displays a file chooser that allows you to choose one or
more source code files to input into REDUCE (using the
REDUCE IN
command). By default, the file chooser
shows only *.red
and *.tst
files, but
you can reset it to show only *.txt
files or all
files. (Note that the recommended extension for REDUCE source code
file names is .red
and that a REDUCE source code file
should end with ;end;
to avoid an error message.)
This menu item is disabled unless REDUCE is running.
This works the same as the previous menu item except that the initial directory is always the REDUCE packages directory. It is primarily intended to provide easy access to the package test files.
This displays a file chooser that allows you to choose a file
to send output to instead of the GUI (using the
REDUCE OUT
command). By default, the file chooser
shows only *.log and *.rlg
files, but you can reset
it to show only *.txt
files or all files. (Note that
the extension used for REDUCE package test output log file names
is .rlg
.) Only one output file can be active at a
time and choosing a new output file redirects output to that file
without shutting the previous output file. The GUI remember all
the open output files (opened via this menu item) to facilitate
switching or shutting output files as described below. This menu
item is disabled unless REDUCE is running.
This displays a list of open output files and allows you to select one for output. This menu item is disabled unless there are open output files.
This redirects output to the GUI without shutting the current
output file (using the REDUCE OUT T
command). This
menu item is disabled unless there are open output files.
This displays a list of open output files and allows you to
select one or more to be shut (using the REDUCE SHUT
command). This menu item is disabled unless there are open output
files.
This shuts the last used open output file (using the
REDUCE SHUT
command). This menu item is disabled
unless there are open output files.
This prints the whole content of the Input/Output Display pane including all styling, after first displaying your platform's standard print dialogue. After you confirm the print dialogue, an alert pops up to either confirm that the session log has been sent to the printer or report failure. Whilst printing seems to work fine on Microsoft Windows it can be a bit awkward on Linux; see Printing on Linux.
This displays a file chooser that allows you to specify a file
to which to save the entire contents of the Input/Output
Display pane. By default, the file chooser shows
only *.log
and *.rlg
files, but you can
reset it to show only *.txt
files or all files. The
filename defaults to session.log
, but you can change
this. If the specified file already exists then the session log
overwrites its previous content. Typeset maths is output as the
TeX markup generated by the REDUCE fmprint package.
This works the same as the previous menu item except that if the specified file exists then the session log is appended to its previous content.
This terminates both REDUCE and the Run-REDUCE-FX GUI, as does the close widget that is normally at the top right-hand corner of the main window frame.
The REDUCE menu provides the following items:
This sub-menu provides an item for each configured REDUCE command (typically based on different versions of Lisp, by default CSL and PSL). Clicking on a REDUCE command runs it. This sub-menu is disabled when REDUCE is running.
This sub-menu allows you to select a REDUCE command that Run-REDUCE-FX will run automatically when it starts, or none. Run-REDUCE-FX remembers this selection and uses it the next time it starts. If REDUCE is not running then Run-REDUCE-FX also runs the selected REDUCE command immediately.
This displays a list of standard REDUCE packages and allows you
to select one or more to load (using the
REDUCE LOAD_PACKAGE
command). The list excludes
packages that are pre-loaded and is sorted alphabetically.
Run-REDUCE-FX determines the list of packages each time it starts
up by reading the package.map
file in the REDUCE
installation. This menu item is disabled unless REDUCE is
running.
This terminates REDUCE but not the
Run-REDUCE-FX GUI. It is the recommended way to stop
REDUCE because then Run-REDUCE-FX reliably knows that REDUCE is no
longer running. (Run-REDUCE-FX tries to detect input of
the BYE
and QUIT
commands via the input
editor, but this may be less reliable.) This menu item is disabled
unless REDUCE is running.
This completely erases the content of the Input/Output Display pane. If you want to keep the content, use the Save / Append Session Log... item on the File menu before clearing!
This does a full clean restart of the last-run REDUCE command, which is equivalent to Stop REDUCE followed by Clear I/O Display followed by running the last-run REDUCE command.
This displays a dialogue that allows you to configure the REDUCE directories and commands. The defaults should work for standard installations on Microsoft Windows and Linux. Run-REDUCE-FX currently assumes that if it is not running on Windows then the Linux default configuration is appropriate, so that is what you will see by default on (say) Apple MacOS. There is a button to reset the whole REDUCE configuration to the platform defaults.
Changes made using this dialogue are saved when you click on
the Save button, in which case the new configuration is
used within Run-REDUCE-FX and saved as preferences. Clicking on
the Cancel button causes all changes made since the
dialogue opened to be forgotten. However, Run-REDUCE-FX checks
that all fields that are directories or files exist and are
readable before it saves them. This includes any command
arguments that begin with $REDUCE
(see below).
Note that all field values are stripped of leading and trailing space before they are used or saved, and empty fields are not saved at all. Where appropriate, text fields have a button beside them labelled "...". This button displays a directory or file chooser that can be used to set the field (which can then be edited further). The initial directory used by the directory or file chooser is the platform default.
Clicking on the Delete Selected Command button deletes the configuration for the selected REDUCE command. If you delete all available commands then a new (empty) command is automatically created.
Clicking on the Duplicate Selected Command button duplicates the configuration for the selected REDUCE command immediately below it in the list. The label of the duplicate command is the label of the duplicated command with New appended, which you can edit as you wish. (But keep command labels fairly short!). Changes to the Command Label field are reflected in the list of REDUCE commands only when you press Enter (or click on the Save button). This provides a convenient way, for example, to add one or more REDUCE commands with non-standard options such as memory size.
Clicking on the Add New Command button adds a new REDUCE command, which is initially labelled New Command, with all other fields empty. You could, for example, add one or more commands running REDUCE on Common Lisp. (At some future date I may include CL REDUCE in the default configuration.)
A complete REDUCE command must be split into the pathname of an executable binary command and a sequence of up to 5 command arguments. (It would be easy to increase this limit, but I hope 5 arguments is enough!) The components of the command that would be separated by white space in a shell command must be entered into separate fields on this form. (Blank arguments are ignored.) Note that Run-REDUCE-FX does not currently use a shell to run REDUCE and the command specified is used directly to create a separate process to run REDUCE. So do not include any shell escapes or other shell syntax! (Think of Run-REDUCE-FX as replacing the shell script normally used to run REDUCE.)
You can use absolute pathnames if you want, but often (as with
the PSL REDUCE executable and image file names) command
components share a common root segment. This root segment can
be specified as $REDUCE
, which Run-REDUCE-FX will
replace with the value of the Command Root Directory
field if it is set, or with the value of the REDUCE Root
Directory field otherwise. (I have borrowed environment
variable syntax, but $REDUCE
here is not related to
any environment variable.)
The two default REDUCE commands, which assume standard installations of CSL and PSL REDUCE, share the same root directory, which is why the default configuration uses REDUCE Root Directory and leaves Command Root Directory empty. But a version of REDUCE running on Common Lisp would probably use a different root directory.
The Load Packages... facility in the File menu requires a standard REDUCE packages directory, which should be specified as the value of the REDUCE Packages Directory field. This directory should contain directories named alg, algint, arith, etc. This field is only used by Load Packages.... If this directory does not exist or is mis-configured then Load Packages... will pop up a warning and closing it will automatically pop up the Configure REDUCE... dialogue to allow you to correct the problem.
The Help menu items that display REDUCE documentation require directories containing the distributed documentation files to be specified as the values of the REDUCE Manual Directory and REDUCE Primers Directory fields. These fields are named after the directories in the REDUCE repository and the same split is used by the standard Windows installation folders although on a standard Linux installation the two directories are the same. The REDUCE Manual Directory should contain the files manual.html and manual.pdf and the REDUCE Primers Directory should contain the files insidereduce.pdf, primer.pdf and sl.pdf, where on Linux the filename extension is .pdf.gz instead of just .pdf.
The REDUCE Working Directory field allows you to configure the initial working directory used by REDUCE and the initial directory used by all the file choosers available from the File menu. (However, note that this is only the initial directory because you can change the directory when you use a file chooser and the file choosers remember and share the last directory used. But this does not change REDUCE's working directory!) By default, the REDUCE Working Directory is your home directory, but you can change it to anything you want. The button beside this field labelled "..." does not pop up a directory chooser directly, but instead pops up a context menu with items labelled Your Home Directory, Run-REDUCE-FX Directory and Choose Any Directory, which respectively set the REDUCE Working Directory field to your home directory, the directory containing Run-REDUCE-FX.jar, or any directory you choose using the directory chooser that pops up.
The directories described above relate to the portable REDUCE source code and are independent of particular REDUCE implementations, so they are fixed for all REDUCE commands.
This cab be used to kill REDUCE in an emergency, such as if it hangs or you put it into an infinite loop. Once REDUCE has been successfully killed, an information dialogue pops up. If the attempt to kill REDUCE may have failed then an error dialogue pops up. In this (unlikely) situation, it may be advisable to use operating system facilities to check that REDUCE has been killed and if necessary kill it, and then restart Run-REDUCE-FX.
Run-REDUCE-FX remembers the options you select using the View menu and uses them the next time you start Run-REDUCE-FX. The first four options (above the separator) apply to each REDUCE panel independently and Run-REDUCE-FX uses the last set values initially when you create a new REDUCE panel. The View menu provides the following items:
This displays a dialogue that allows you to change the font size used in the Input/Output Display and Input Editor panes.
Selecting this item causes Run-REDUCE-FX to embolden the display of all input prompts.
This sub-menu allows you to select an I/O colouring option: None, Modal or Redfront. Modal colouring depends on REDUCE's current input mode: algebraic-mode prompts and input are red, algebraic-mode output is blue, symbolic-mode prompts and input are brown, symbolic-mode output is purple. Redfront colouring is intended to provide a full emulation of the standard REDUCE redfront facility and it loads the redfront package (silently), which outputs additional markup that is interpreted by Run-REDUCE-FX in the same way that it is normally interpreted by the redfront executable running in a suitable terminal (emulator). With Redfront colouring, all prompts and interactive input are red, algebraic-mode output is blue, and echoed file input and symbolic-mode output are not coloured.
When I/O colouring is enabled, Run-REDUCE-FX highlights warnings and errors with appropriate background colours.
Note that turning I/O colouring on does not fully take effect until the next input prompt. Turning I/O colouring off (by selecting None) takes effect immediately and turning it back on mid-session turns any previous I/O colouring back on, but any I/O produced while I/O colouring was turned off will not be coloured. (This is because the required markup is only generated when I/O colouring is turned on to conserve resources.)
Selecting this item causes Run-REDUCE-FX to display algebraic-mode mathematical output more-or-less as it would be typeset and centred horizontally. WARNINGS: Typeset Maths is currently experimental. It interacts badly with redfront I/O colouring, so don't try to use the two together: one will effectively cancel the other. The display may be incorrect in some cases, e.g. with unusual switch settings such as on list. If any TeX markup appears (coloured red) in the output then please let me know! Save Session Log... outputs typeset maths using TeX markup.
Selecting this causes Run-REDUCE-FX to display the selected REDUCE panel only. This is the default.
Selecting this causes Run-REDUCE-FX to display two REDUCE panels side-by-side. The left-hand panel displays the previously selected REDUCE panel (if any) and is initially active. Clicking on a REDUCE panel makes it active for input via its input editor pane and the menus. The inactive REDUCE panel can continue to update its output display. Both panels are the same size initially, but you can change that by dragging the divider.
Selecting this causes Run-REDUCE-FX to display a tabbed pane
with the previously selected REDUCE panel (if any) displayed under
the first tab. Clicking on the ×
icon at the
right of the selected tab label removes that tab and the REDUCE
panel it contains. When there is only one tab, removing it
disables tabbed display but preserves the REDUCE panel that the
tab contained.
This adds a new tab to a tabbed display. This menu item is disabled unless tabbed pane display is selected.
The Templates menu facilitates construction of structured expressions and statements whose syntax might not be immediately obvious, especially to a novice. The template dialogues all provide hyperlinks to the key sections of the local HTML version of the REDUCE Manual, which open in your default web browser. The dialogues all provide two buttons that apply the filled-in template: the Edit button inserts the template output into the input editor at the current cursor position; the Evaluate button sends the template output directly to REDUCE for evaluation, adding a terminator if necessary, just as the Send Input button does. These buttons do not close the dialogue, which is non-modal (meaning it does not prevent access to other windows) and can be left open but moved out of the way. In fact, several template dialogues can be open at the same time. To close a template dialogue, click on the Close button.
If the template represents an operator with a primary operand then this defaults to ws, which is convenient for simple interactive calculations, but it can be changed to anything. The templates provide some minimal input validation: for example, if an element must be an explicit number (rather than a variable that must evaluate to a number), the template will check this and report an error immediately an inappropriate character is entered. When the Evaluate button is used, the template checks that all input has been provided that is required for valid REDUCE syntax; this is not done when the Edit button is used, assuming that further editing will take place. This makes it easy to combine the output from templates, for example, to construct a multiple for loop.
Some templates have a pair of radio buttons at the top labelled Symbolic and Numeric that allow you to switch between the two modes of evaluation; the default is Symbolic. The Numeric option causes the template output to turn rounded mode on before the main template result is output and off again afterwards; it may also load the numeric package and use specific numerical versions of functions. The text message towards the top of each template may vary depending on the Symbolic/Numeric option.
Some templates have one or more switches towards the bottom, which may vary depending on the Symbolic/Numeric option. The switches consist of check boxes that initially show default settings (not those currently in effect in REDUCE). Any switches that are changed from their defaults are set in the template output to reflect the change before the main template result is output and reset afterwards. (Beware that this will override any changes from the default switch settings that were in effect before the template was used.)
These templates are intended only for creating simple structures, but they can form the basis for arbitrarily complex structures if they are entered into the input editor for further editing. The fields of expression templates display minimal formatting intended to hint at how such an expression would normally be typeset.
This menu is disabled unless REDUCE is running. The Templates menu provides the following items:
This template supports (partial) differentiation involving up to three independent variables, each to arbitrary order. The orders must be explicit positive integers and the total order automatically updates to reflect the number of independent variables and their orders. If an order is omitted then it defaults to 1. The first independent variable is required but others are optional. The dependent variable defaults to ws and the first independent variable defaults to x, but both can be changed.
This template supports both indefinite and definite integration: if both limits are omitted then the integral is indefinite; if both limits are specified then the integral is definite. Note that only a definite integral can be evaluated numerically and the template checks this. The integrand defaults to ws and the integration variable defaults to x, but both can be changed.
By default, the template provides a single integral, but if you enter another integration variable in one of the boxes to the right of the primary integration variable then an additional integral appears wrapping the previous integral, thus supporting double and triple integrals. Matching ∫ and d symbol pairs have the same colour (blue, green or red) to facilitate adding limits to the right ∫ symbol.
This template supports limits of (mostly) continuous functions (as opposed to sequences). By default, it computes a two-sided limit, which is appropriate if the function is continuous at the limit point. By clicking successively on the superscript box to the right of the limit point field you cycle through the limit from the right/above, indicated by a superscript +, the limit from the left/below, indicated by a superscript -, and the default two-sided limit. All fields are required. The template includes an option to load the SPECFN package, which may improve some results (according to the SPECFN section of the REDUCE User's Manual).
This template supports finite repeated sums and products of sequences, i.e. functions of a discrete control variable that runs over a finite range of successive increasing integers. You select whether to construct a sum or product by clicking on the appropriate toggle button, which defaults to a sum. All fields are required.
This template supports the creation of matrices up to 4 by 4. The elements can be any expressions. The (1,1) element is always in the top left-hand corner of the template. The width of the matrix, i.e. the maximum column index, is determined by the right-most non-empty element and the depth of the matrix, i.e. the maximum row index, is determined by the lowest non-empty element. Within the matrix so determined, empty elements default to zero, which is very convenient for entering diagonal, triangular or other sparse matrices.
This template supports the creation of for statements and is modelled on the diagram at the start of the section of the REDUCE manual headed "FOR Statements". You choose between iterating over a numerical range and a list by clicking on the appropriate tab, which then displays the appropriate template. You choose the action and the for each ... in/on option via pop-up choice boxes, which default to the most common choices. (Note that the for each ... on option is only allowed in symbolic mode, but the template does not check this.) The field for the expression to be executed by the for statement is on a separate line to allow it more space.
The Functions menu facilitates access to some of the mathematical functions provided by REDUCE via dialogue boxes similar to those provided by the Templates menu. The functions provided include all the special functions listed in section 7.2 Mathematical Functions of the REDUCE User's Manual. They also include some functions listed only in the section on the SPECFN package and when necessary the template output loads the SPECFN package. The function dialogues all provide hyperlinks to the key sections of the local HTML version of the REDUCE Manual, which open in your default web browser.
Hover over a function name to pop up a tooltip that gives a hint at its definition, which often uses linearlized mathematical notation similar to LaTeX (but without any backslashes). Click on the name of a special function to go to its full definition in the online NIST Digital Library of Mathematical Functions (DLMF), which the notation used in the templates generally follows. (This occasionally differs slightly from the notation used in the REDUCE Manual.)
The function dialogue boxes provide a grid of function templates. Click on the radio button to the left of the function you want to use. All but the active template is disabled and greyed out. The templates display the conventional notation used for the functions but with editable text fields holding the function arguments. The default arguments are either ws, where this seems appropriate, or the conventional variable names, usually those used in the DLMF.
All Functions dialogue boxes have a pair of radio buttons at the top labelled Symbolic and Numeric that allow you to switch between the two modes of evaluation; the default is Symbolic. The Numeric option causes the template output to turn rounded mode on before the main template result is output and off again afterwards.
There are also some switches towards the bottom, depending on the Symbolic/Numeric option. The switches consist of check boxes that initially show default settings (not those currently in effect in REDUCE). Any switches that are changed from their defaults are set in the template output to reflect the change before the main template result is output and reset afterwards. (Beware that this will override any changes from the default switch settings that were in effect before the template was used.) All dialogues provide the switch complex, which in most cases is available only in numeric mode and turns on the use of complex arithmetic; it is off by default. All dialogues also provide the switch savesfs, which turns on caching of numerical values of special functions; it is on by default.
This menu is disabled unless REDUCE is running. The Templates menu provides the following items:
This provides the exponential function, various logarithms, power and roots (surds or radicals), factorial and binomial coefficients, and the hypot, atan2 and atan2d functions. The latter automatically loads the TRIGD package.
This provides the Gamma, Beta, digamma, polygamma, normalized incomplete Gamma and Beta, and dilogarithm functions, Pochhammer's symbols, binomial coefficients and the Riemann zeta function.
This provides exponential, logarithmic, sine, cosine, hyperbolic sine and hyperbolic cosine integral functions, the error function and complementary error function, and the Fresnel sine and cosine integral functions.
This provides Airy functions of the first (Ai) and second (Bi) kind and their derivatives (Ai' and Bi'), and the families of Bessel functions of the first (J) and second (Y) kind, modified Bessel functions of the first (I) and second (K) kind, and Hankel functions of the first and second kind.
This provides the families of Struve (H) and modified Struve (L) functions, Lommel functions of the first (s) and second (S) kind, Kummer M and U functions, Whittaker M and W functions, and spherical and solid harmonic (Y) functions.
This provides the families of Jacobi (P) and Ultraspherical or Gegenbauer (C) polynomials, Chebyshev polynomials of the first (T) and second (U) kind, Legendre (P) and associated Legendre polynomials, Laguerre (L) and generalized Legendre polynomials, and Hermite (H) polynomials.
All the documents accessed via the Help menu are local files. The Help menu provides the following items:
This opens the Run-REDUCE-FX User Guide in your default web browser. It is extracted from the Java JAR file at most once per run of Run-REDUCE-FX to your default temporary directory.
These menu items open the manuals and other guides that are distributed with REDUCE in your default web browser or PDF viewer, as appropriate. The files are assumed to be available in your REDUCE installation.
This opens the REDUCE Web Site in your default web browser. It provides a lot of background information about REDUCE.
This opens the SourceForge Project Site in your default web browser. It provides access to the repository containing full source code for REDUCE itself, PSL, CSL, and some very closely related projects, pre-built distributions of REDUCE for various platforms, mailing lists, bug reporting, etc.
This pops up brief information about Run-REDUCE-FX.
identifier_bar
as
\(\overline{\mathit{identifier}}\) (for
any identifier
), which can be followed by digits
or "_" as described above. See the examples in the table
below. Ignore fancy_lower_digits
.repart
and impart
as
\(\Re\) and \(\Im\).abs(x)
as \(|x|\) and matrix
assignments as assignments.Identifier | Displays as |
---|---|
my_id123 | \(\mathit{my\_id}_{123}\) |
alpha123 | \(\alpha_{123}\) |
beta_i | \(\beta_i\) |
gamma_delta | \(\gamma_\delta\) |
my_long_id | \(\mathit{my\_long\_id}\) |
z_bar | \(\bar{z}\) |
complex_variable_bar |
\(\overline{\mathit{complex\_variable}}\) |
z_bar123 | \(\bar{z}_{123}\) |
z_bar_k | \(\bar{z}_k\) |
The (shared) variable fancy_print_df
can be set to
one of the values partial
, total
or indexed
to control the display of derivatives.
The default value is partial
. Typeset maths also
supports the dfprint
switch, and if this switch is
on then fancy_print_df
is ignored. For example,
with the following settings, derivatives are displayed as
follows (assuming depend f,x,y
and operator
g
):
Setting |
df(f,x,2,y) |
df(g(x,y),x,2,y) |
---|---|---|
fancy_print_df := partial |
\(\frac{\partial^3 f}{\partial x^2 \partial y}\) | \(\frac{\partial^3 g(x,y)}{\partial x^2 \partial y}\) |
fancy_print_df := total |
\(\frac{d^3 f}{d x^2 d y}\) | \(\frac{d^3 g(x,y)}{d x^2 d y}\) |
fancy_print_df := indexed |
\(f_{x,x,y}\) | \(g(x,y)_{x,x,y}\) |
on dfprint |
\(f_{x,x,y}\) | \(g_{x,x,y}\) |
An operator declared print_indexed
has its
arguments displayed as indices, e.g. after print_indexed
a
the operator value a(i,2)
is displayed as
\(a_{i,2}\). You can declare several operators together to be
indexed, e.g.
print_indexed a, b, c;
It appears that on Linux, JavaFX is not aware of the default "Print to File" printer and only displays the print dialogue if there is at least one physical printer installed. If you cancel the print dialogue then Run-REDUCE-FX is left unresponsive for a long time. A workaround seems to be to select the "Print To File" option for a real printer, click Print and then cancel the resulting file selector, which cancels the whole print job immediately. (Nearly all of the code involved is in the standard JavaFX library and so out of my control, although in the longer term I might be able to improve the response by running printing in a separate thread.)