UserGuide.html 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276
  1. <!DOCTYPE html>
  2. <html lang="en-GB">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="author" content="Francis Wright" />
  6. <title>Run-REDUCE User Guide</title>
  7. <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css"
  8. integrity="sha384-AfEj0r4/OFrOo5t7NnNe46zW/tFgW6x/bCJG8FqQCEo3+Aro6EYUG4+cU+KJWu/X" crossorigin="anonymous" />
  9. <!-- The loading of KaTeX is deferred to speed up page rendering -->
  10. <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.js"
  11. integrity="sha384-g7c+Jr9ZivxKLnZTDUhnkOnsh30B4H0rpLUpJ4jAIKs4fnJI+sEnkvrMWph2EDg4" crossorigin="anonymous"></script>
  12. <!-- To automatically render math in text elements, include the auto-render extension: -->
  13. <script defer src="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/contrib/auto-render.min.js"
  14. integrity="sha384-mll67QQFJfxn0IYznZYonOWZ644AWYC+Pt2cHqMaRhXVrursRwvLnLaebdGIlYNa" crossorigin="anonymous"
  15. onload="renderMathInElement(document.body);"></script>
  16. <style>
  17. body {
  18. font-family: "Lucida Sans Unicode", "Lucida Grande", "Lucida Sans", Arial, sans-serif;
  19. font-size: 12pt;
  20. max-width: 640px;
  21. margin-right: auto;
  22. margin-left: auto;
  23. }
  24. code {
  25. font-family: "Lucida Console", "Lucida Sans Typewriter", monospace;
  26. }
  27. h1, h2, h3 {
  28. font-family: "Lucida Bright", Georgia, Times, "Times New Roman", serif;
  29. }
  30. table {
  31. margin-right: auto;
  32. margin-left: auto;
  33. }
  34. td, th {
  35. padding-right: 10px;
  36. padding-left: 10px;
  37. text-align: left;
  38. }
  39. table.small {
  40. font-size: small
  41. }
  42. table.nowrap td, table.nowrap th {
  43. white-space: pre
  44. }
  45. </style>
  46. </head>
  47. <body>
  48. <h1>Run-REDUCE User Guide</h1>
  49. <h3>&copy; 2020 Francis Wright</h3>
  50. <h2>Contents</h2>
  51. <ul>
  52. <li><a href="#GeneralInformation">General Information</a></li>
  53. <li><a href="#MainWindow">The Main Window</a></li>
  54. <li><a href="#PopupKeyboard">The Pop-up Keyboard</a></li>
  55. <li><a href="#Editing">Editing</a></li>
  56. <li><a href="#Configuration">REDUCE Configuration</a></li>
  57. <li><a href="#FileMenu">The File Menu</a></li>
  58. <li><a href="#REDUCEMenu">The REDUCE Menu</a></li>
  59. <li><a href="#ViewMenu">The View Menu</a></li>
  60. <li><a href="#TemplatesMenu">The Templates Menu</a></li>
  61. <li><a href="#FunctionsMenu">The Functions Menu</a></li>
  62. <li><a href="#HelpMenu">The Help Menu</a></li>
  63. <li><a href="#TypesetMaths">Typeset Maths Display</a></li>
  64. <li><a href="#Printing">Printing on Linux</a></li>
  65. <li><a href="#ConfigExamples">Configuring Run-REDUCE for Subversion Builds</a></li>
  66. </ul>
  67. <h2 id="GeneralInformation">General Information</h2>
  68. <p>Run-REDUCE remembers user preferences and uses them the next
  69. time it starts. It uses the standard Java
  70. package <em>java.util.prefs</em>, which stores data persistently
  71. in an implementation-dependent backing store. On Microsoft Windows
  72. the preferences for this application are stored in the registry
  73. under the key
  74. "<code>Computer\HKEY_CURRENT_USER\Software\JavaSoft\Prefs\fjwright\runreduce</code>"
  75. and on Linux they are stored in XML files under the directory
  76. "<code>~/.java/.userPrefs/fjwright/runreduce/</code>".
  77. </p>
  78. <p>By default, Run-REDUCE looks in the standard places for a
  79. REDUCE installation. On Microsoft Windows it looks for the folder
  80. "<code>\Program Files\Reduce</code>" on all accessible drives. On
  81. Linux it assumes that executable files are under
  82. "<code>/usr/lib/reduce</code>", package information is in
  83. "<code>/usr/share/reduce/packages</code>", and documentation is in
  84. "<code>/usr/share/doc/reduce</code>". But this information can all
  85. be <a href="#Configure">reconfigured</a>.
  86. </p>
  87. <p>Run-REDUCE supports the relevant
  88. default <a href="https://wiki.openjdk.java.net/display/OpenJFX/Keyboard+Navigation">JavaFX
  89. keyboard shortcuts</a>. Additional keyboard shortcuts are
  90. described below where appropriate, and the keyboard shortcuts
  91. relevant to text editing are described in the section
  92. on <a href="#Editing">Editing</a>.
  93. </p>
  94. <h2 id="MainWindow">The Main Window</h2>
  95. <p>The main window consists of one or more REDUCE panels that can
  96. each run an independent invocation of REDUCE. There are three
  97. options: a single REDUCE panel (the default); a split pane
  98. containing two REDUCE panels side-by-side that are both visible;
  99. a tabbed pane containing one or more REDUCE panels, of which
  100. only the selected panel is visible. The choice of display pane
  101. arrangement is controlled by options in
  102. the <a href="#ViewMenu">View menu</a>. You can switch
  103. dynamically among the three options, in which case the currently
  104. selected REDUCE panel (only) and the REDUCE invocation running
  105. in it (if any) is preserved and carried to the new display pane
  106. arrangement, but any other REDUCE invocations are discarded.
  107. </p>
  108. <p>With a split pane, you can select synchronised scrolling so
  109. that scrolling the selected REDUCE panel (in any way) also
  110. scrolls the other REDUCE panel to the same relative position.
  111. This facility is experimental and currently forces both REDUCE
  112. panels to display content at the same (relative) position; the
  113. other REDUCE panel cannot be scrolled from its current position
  114. but will jump to the same relative position as the selected
  115. REDUCE panel.
  116. </p>
  117. <p>With a split or tabbed pane, you can select the active REDUCE
  118. panel by clicking on the desired panel in a split pane or tab on
  119. a tabbed pane. You can also select the next REDUCE panel
  120. cyclically forwards by pressing <em>Control+Tab</em>
  121. or <em>Control+PageDown</em>, or backwards by
  122. pressing <em>Control+Shift+Tab</em> or <em>Control+PageUp</em>.
  123. The non-selected panel in a split pane is greyed out and the
  124. selected panel displays a green dot near the top right-hand
  125. corner, immediately to the left of the <em>Hide Editor</em>
  126. toggle button. All controls apply (primarily) to the currently
  127. selected REDUCE panel.
  128. </p>
  129. <p>Tabs are initially labelled <em>Tab 1</em>, <em>Tab 2</em>,
  130. etc., and a new tab is labelled <em>Tab n</em> if it is
  131. the <em>n<sup>th</sup></em> tab to be added. (Removing tabs does
  132. not affect the numbering.) However, when REDUCE is run in a tab,
  133. the tab label changes to the name of the REDUCE command being run,
  134. and remains so until a different REDUCE command is run in that
  135. tab.
  136. </p>
  137. <h3>REDUCE Panels</h3>
  138. <p>A REDUCE panel normally consists of two panes one above the
  139. other. The top pane displays all the REDUCE input and output in
  140. the current session. It is read-only. The bottom pane is an
  141. input editor that supports all the standard keyboard and
  142. mouse-based editing facilities normally provided by your platform.
  143. It is disabled unless REDUCE is running in this panel. Both panes
  144. display vertical and horizontal scroll bars when necessary. Text
  145. does not wrap. The horizontal divider separating the two panes
  146. can be dragged up and down.
  147. </p>
  148. <p>There is a toggle button in the top right-hand corner of each
  149. REDUCE panel, which when clicked hides the input editor. This is
  150. useful for viewing long runs of output. Clicking the button again
  151. shows the input editor.
  152. </p>
  153. <p>The name of the currently running (or last run) REDUCE command
  154. is appended to the label of the REDUCE input/output display pane.
  155. (You can edit the command names in the <a href="#Configure">REDUCE
  156. configuration dialogue</a>.)
  157. </p>
  158. <p>You type (or paste) REDUCE input into the input editor pane,
  159. edit it as necessary, and then click on the <em>Send Input</em>
  160. button, which sends the input to REDUCE and echos it in the top
  161. pane. This clears the input editor, but you can scroll through
  162. the previous input (entered via the input editor) using
  163. the <em>Earlier Input</em> and <em>Later Input</em> buttons.
  164. Scrolling to input later than the last previous input clears the
  165. input editor pane back to its state before you started scrolling.
  166. </p>
  167. <p>When keyboard focus is in the input editor pane, the following
  168. keyboard shortcuts are active:
  169. </p>
  170. <table>
  171. <thead>
  172. <tr>
  173. <th>Keyboard Shortcut</th>
  174. <th>Action</th>
  175. </tr>
  176. </thead>
  177. <tbody>
  178. <tr>
  179. <td><em>Control+Enter</em></td>
  180. <td>Send Input (auto-terminated)</td>
  181. </tr>
  182. <tr>
  183. <td><em>Control+Shift+Enter</em></td>
  184. <td>Send Input (not auto-terminated)</td>
  185. </tr>
  186. <tr>
  187. <td><em>Control+UpArrow</em></td>
  188. <td>Earlier Input</td>
  189. </tr>
  190. <tr>
  191. <td><em>Control+DownArrow</em></td>
  192. <td>Later Input</td>
  193. </tr>
  194. </tbody>
  195. </table>
  196. <p>where <em>Enter</em> is the <em>Return</em> or <em>Enter</em>
  197. key and <em>UpArrow</em> / <em>DownArrow</em> are the cursor up /
  198. down keys, respectively.
  199. </p>
  200. <p>Sending input to REDUCE strips any trailing white space,
  201. normally auto-terminates it by adding a semicolon if there was no
  202. final terminator, and then adds a final newline. However, if
  203. Run-REDUCE detects a question mark in the input prompt then it
  204. suppresses auto-termination (so if you really want a terminator
  205. you must enter it explicitly). As an additional precaution,
  206. holding the <em>Shift</em> key while clicking on the <em>Send
  207. Input</em> button or pressing <em>Control+Enter</em> always
  208. suppresses auto-termination.
  209. </p>
  210. <p>You can edit previous input recalled into the input editor as
  211. necessary and then send it to REDUCE. Input can be multi-line, in
  212. which case Run-REDUCE processes all the lines
  213. together. The <em>Send Input</em> action is disabled unless
  214. REDUCE is running, and the <em>Earlier Input</em>
  215. and <em>Later Input</em> actions are disabled unless there is
  216. earlier or later input, respectively.
  217. </p>
  218. <h2 id="PopupKeyboard">The Pop-up Keyboard</h2>
  219. <p>The pop-up keyboard provides access to special symbols and
  220. Greek letters on the top half of the keyboard and elementary
  221. functions on the bottom half. It is available by clicking the
  222. primary mouse-button (normally the left if there is more than one)
  223. while holding down the <em>Control</em> key while the mouse
  224. pointer is over an input editor text area or any text field in
  225. a <a href="#TemplatesMenu">template</a>
  226. or <a href="#FunctionsMenu">function</a> dialogue. Note that
  227. clicking the secondary (normally the right) mouse-button on any
  228. text field pops up a generic editing context menu.
  229. </p>
  230. <p>Clicking on a character button on the top half of the pop-up
  231. keyboard causes that character to overwrite the selected text if
  232. there is any or otherwise to insert at the text cursor (caret).
  233. Clicking on a function button on the bottom half of the pop-up
  234. keyboard causes that function to be applied to the selected text
  235. if there is any (i.e. wrapped around it using parentheses) or
  236. otherwise to be inserted followed by parentheses at the text
  237. cursor, which is left within the parentheses. The pop-up then
  238. closes. The pop-up also closes if you click anywhere outside it,
  239. or you can close it by clicking on the <em>Close</em> button in
  240. the bottom left corner or by pressing the <em>Escape</em> key on
  241. your main keyboard.
  242. </p>
  243. <p>By default, the top half of the pop-up keyboard provides the
  244. REDUCE symbolic constants &infin; (infinity) and &pi; (pi) in the
  245. left column and the lower-case Greek alphabet in the right block,
  246. and the bottom half of the pop-up keyboard provides common
  247. elementary functions in the left block and trigonometric and
  248. hyperbolic functions in the right block. The pop-up keyboard has
  249. two layers and the secondary layer is accessed by either clicking
  250. on the <em>Shift</em> button in the top left corner or holding
  251. down the <em>Shift</em> key on your main keyboard. Note that the
  252. physical <em>Shift</em> key does not act as a toggle but the
  253. virtual <em>Shift</em> button does. The top half of the secondary
  254. keyboard layer provides additional REDUCE symbolic constants and
  255. upper-case Greek letters; the bottom half provides common
  256. predicates and inverse trigonometric and hyperbolic functions.
  257. </p>
  258. <p>All special symbols on the pop-up keyboard have their names
  259. spelt out appropriately using ASCII characters automatically
  260. before sending them to REDUCE. The symbolic constants in the top
  261. left column are given their REDUCE names and the Greek letters in
  262. the top right block use the TeX naming convention. Note that, by
  263. default, special symbols are translated to REDUCE identifiers only
  264. when they are sent to REDUCE, not when they are inserted into the
  265. input editor. The results should be accepted as identifiers and
  266. typeset appropriately by all versions of REDUCE.
  267. </p>
  268. <p>If you hover your mouse pointer over a symbolic constant button
  269. then a tooltip pops up giving the REDUCE name of the constant and
  270. a brief description of it and/or its conventional name and
  271. approximate numerical value (if appropriate). If you hover your
  272. mouse pointer over a Greek letter button then a tooltip pops up
  273. giving its TeX-style name. If you click on the <em>English</em>
  274. button in the top right corner of the pop-up keyboard or hold down
  275. the <em>Alt</em> key whilst clicking on any button on the top half
  276. of the pop-up keyboard then its name spelt-out using ASCII
  277. characters is output instead of the single non-ASCII character.
  278. </p>
  279. <p>If you hover your mouse pointer over a function key then a
  280. tooltip pops up giving its full name. If you click on
  281. the <em>Radians</em> button in the bottom right corner of the
  282. pop-up keyboard or hold down the <em>Alt</em> key whilst clicking
  283. on any trigonometric function button then the degree version of
  284. the function is used. The label on the <em>Radians</em> button
  285. changes to <em>Degrees</em> it you click on it or hold down
  286. the <em>Alt</em> key, and changes back to <em>Radians</em> if you
  287. click on it again or release the <em>Alt</em> key. This label
  288. shows the <strong>current</strong> trigonometric function mode.
  289. Note that degree mode only works if the TRIGD package has been
  290. loaded in REDUCE. At some later date I hope to be able to
  291. automate this, but for now you need to do it by hand.
  292. </p>
  293. <p>Note that some characters are available as both symbolic
  294. constants and as Greek letters, but only &pi; means the same in
  295. both cases. In order to preserve the two meanings, the symbolic
  296. constants maybe preceded by a Unicode zero-width non-joiner (ZWNJ)
  297. character, which is removed automatically when the symbolic
  298. constant is sent to REDUCE. The ZWNJ character is invisible but
  299. it is nevertheless there. If you move the text cursor past a
  300. symbolic constant you will also need to move it past the ZWNJ
  301. character, although you will not see the cursor move, and if you
  302. delete a symbolic constant you should also delete the ZWNJ
  303. character, although again you will not see the cursor move. (If
  304. you don't delete it then it could cause confusion.)
  305. </p>
  306. <h2 id="Editing">Editing</h2>
  307. <p>Run-REDUCE supports the following keyboard shortcuts on
  308. Windows and Linux:
  309. </p>
  310. <table>
  311. <tr>
  312. <th>Select all in focused control or window</th>
  313. <td><kbd>Ctrl</kbd>+<kbd>A</kbd></td>
  314. </tr>
  315. <tr>
  316. <th>Cut the selection and store it in
  317. the <a href="https://en.wikipedia.org/wiki/Clipboard_(software)">clipboard</a></th>
  318. <td><a href="https://en.wikipedia.org/wiki/Ctrl-X"><kbd>Ctrl</kbd>+<kbd>X</kbd></a></td>
  319. </tr>
  320. <tr>
  321. <th>Copy the selection into
  322. the <a href="https://en.wikipedia.org/wiki/Clipboard_(software)">clipboard</a></th>
  323. <td><a href="https://en.wikipedia.org/wiki/Ctrl-C"><kbd>Ctrl</kbd>+<kbd>C</kbd></a></td>
  324. </tr>
  325. <tr>
  326. <th>Paste contents
  327. of <a href="https://en.wikipedia.org/wiki/Clipboard_(software)">clipboard</a>
  328. at <a href="https://en.wikipedia.org/wiki/Cursor_(computers)">cursor</a></th>
  329. <td><a href="https://en.wikipedia.org/wiki/Ctrl-V"><kbd>Ctrl</kbd>+<kbd>V</kbd></a></td>
  330. </tr>
  331. <tr>
  332. <th><a href="https://en.wikipedia.org/wiki/Undo">Undo</a>
  333. the last operation</th>
  334. <td><kbd>Ctrl</kbd>+<kbd>Z</kbd></td>
  335. </tr>
  336. </table>
  337. <p>However, REDUCE input/output display panes are read-only and so
  338. only support select and copy operations. All input areas also
  339. support an editing context menu, which is available by clicking
  340. the secondary (normally the right) mouse-button while the mouse
  341. pointer is over the input area.
  342. </p>
  343. <h2 id="Configuration">REDUCE Configuration</h2>
  344. <p>An item on the <em>REDUCE menu</em> displays a dialogue that
  345. allows you to configure the REDUCE directories and commands.
  346. The defaults should work for standard installations of snapshot
  347. releases on Microsoft Windows and Linux. Run-REDUCE currently
  348. assumes that if it is not running on Windows then the Linux
  349. default configuration is appropriate, so that is what you will
  350. see by default on (say) Apple MacOS. There is a button in the
  351. top left-hand corner to reset the whole REDUCE configuration to
  352. the platform defaults.
  353. </p>
  354. <p>When you click on the <em>Save</em> button, any changes made
  355. using this dialogue are saved as preferences and the new
  356. configuration is used within Run-REDUCE. If you click on
  357. the <em>Cancel</em> button then all changes made since this
  358. dialogue opened are forgotten. Run-REDUCE warns you if any
  359. fields that are directories or files do not exist or are
  360. unreadable and asks if you want to continue anyway. This
  361. includes command arguments that begin with <code>$REDUCE</code>
  362. or <code>~</code> followed immediately by <code>/</code>
  363. or <code>\</code> (see below).
  364. </p>
  365. <p>Note that all field values are stripped of leading and trailing
  366. space before they are used or saved, and empty command argument
  367. fields are not saved at all. Most fields have a button beside
  368. them labelled "...". Clicking on it displays a directory or
  369. file chooser that can be used to set the field (which can then
  370. be edited further).
  371. </p>
  372. <p>The dialogue is divided into three main sections, each of which
  373. is described separately below.
  374. </p>
  375. <h3>Generic Information</h3>
  376. <p>The box in the top right-hand corner covers directories that
  377. relate to the portable REDUCE code and are independent of
  378. particular REDUCE implementations or commands. The REDUCE Root
  379. Directory field provides the initial directory for the directory
  380. or file choosers for most of the other fields, which is useful
  381. on Windows or with local builds;
  382. see <a href="#ConfigExamples">Configuring Run-REDUCE for
  383. Subversion Builds</a>.
  384. <p>The <em>Load Packages...</em> facility in the <em>File</em>
  385. menu requires a standard REDUCE packages directory, which should
  386. be specified as the value of the <em>REDUCE Packages
  387. Directory</em> field. This directory should contain directories
  388. named <em>alg</em>, <em>algint</em>, <em>arith</em>, etc. It is
  389. only used by <em>Load Packages...</em>. If the directory
  390. specified does not exist or is mis-configured then <em>Load
  391. Packages...</em> will pop up a warning and closing it will
  392. automatically pop up the <em>Configure REDUCE...</em> dialogue
  393. to allow you to correct the problem.
  394. </p>
  395. <p>The <em>Help</em> menu items that display REDUCE documentation
  396. require the directories containing the distributed documentation
  397. files to be specified as the values of the <em>REDUCE Manual
  398. Directory</em> and <em>REDUCE Primers Directory</em> fields.
  399. These fields are named after the directories in the REDUCE
  400. Subversion repository and the same directory division is used
  401. for the standard Windows snapshot installation folders, although
  402. on a standard Linux snapshot installation the two directories
  403. are the same. The <em>REDUCE Manual Directory</em> should
  404. contain the files <em>manual.html</em> and <em>manual.pdf</em>
  405. and the <em>REDUCE Primers Directory</em> should contain the
  406. files <em>insidereduce.pdf</em>, <em>primer.pdf</em>
  407. and <em>sl.pdf</em>, where on Linux the filename extension
  408. is <em>.pdf.gz</em> instead of just <em>.pdf</em>.
  409. </p>
  410. <p>The <em>REDUCE Working Directory</em> field allows you to
  411. configure the initial working directory used by REDUCE and the
  412. initial directory used by all the file choosers available from
  413. the <em>File</em> menu. (However, note that this is only the
  414. initial directory because you can change the directory when you
  415. use a file chooser and the file choosers remember and share the
  416. last directory used. This does not change REDUCE's working
  417. directory!) By default, the <em>REDUCE Working Directory</em>
  418. is your home directory, but you can change it to anything you
  419. want. The button beside this field labelled "..." does not pop
  420. up a directory chooser directly, but instead pops up a context
  421. menu with items labelled <em>Your Home
  422. Directory</em>, <em>Run-REDUCE Directory</em> and <em>Choose Any
  423. Directory</em>, which respectively set the <em>REDUCE Working
  424. Directory</em> field to your home directory, the directory
  425. containing <em>Run-REDUCE.jar</em>, or any directory you choose
  426. using the directory chooser that pops up. The initial directory
  427. for this chooser is your home directory.
  428. </p>
  429. <h3>The REDUCE Command List</h3>
  430. <p>In the bottom left-hand corner of the dialogue is a list of
  431. REDUCE command labels and clicking on a command label selects it
  432. for editing in the box in the bottom right-hand corner.
  433. Clicking on the ▲ (up) or ▼ (down) button immediately below this
  434. list moves the selected command up or down the list cyclically,
  435. meaning that when a command moves above the top of the list is
  436. reappears at the bottom, and vice versa. Clicking on
  437. the <em>Save</em> button saves the order of the commands
  438. together with the other information in the dialogue, and
  439. re-starting Run-REDUCE restores it.
  440. </p>
  441. <p>Clicking on the <em>Reset Selected Command</em> button resets
  442. the selected command to its default configuration if this
  443. exists, otherwise nothing happens. The appropriate default
  444. configuration is found by matching the command label.
  445. </p>
  446. <p>Clicking on the <em>Delete Selected Command</em> button
  447. completely deletes the selected REDUCE command. If you delete
  448. all available commands then a new (empty) command is
  449. automatically created.
  450. </p>
  451. <p>Clicking on the <em>Duplicate Selected Command</em> button
  452. duplicates the configuration for the selected REDUCE command
  453. with a new label at the bottom of the list. The new label is
  454. the label of the duplicated command with <em>New</em> appended,
  455. which you can edit in the Command Label field as you wish. (But
  456. keep command labels fairly short!). This provides a convenient
  457. way, for example, to add one or more REDUCE commands with
  458. non-standard options such as memory size.
  459. </p>
  460. <p>Clicking on the <em>Add New Command</em> button adds a new
  461. REDUCE command at the bottom of the list, which is initially
  462. labelled <em>New Command</em>, with all other fields empty. You
  463. could, for example, add one or more commands running REDUCE on
  464. Common Lisp. (At some future date I may include CL REDUCE in
  465. the default configuration.)
  466. </p>
  467. <h3>Specific Information</h3>
  468. <p>The box in the bottom right-hand corner relates to the REDUCE
  469. command currently selected in the list on the left. You can
  470. change the label by editing the <em>Command Label</em> field.
  471. You should then press the <em>Return</em> key to confirm the
  472. edit, which will update the label in the list of REDUCE
  473. commands. Whether you confirm an edit or not, the new label
  474. will be saved if you click on the <em>Save</em> button. Command
  475. labels must be unique and an error alert will pop up that
  476. prevents you from saving a non-unique label.
  477. </p>
  478. <p>If the <em>Use Default Command Shell</em> check box is selected
  479. then the REDUCE command is run via the default system shell,
  480. which is found as the value of the appropriate environment
  481. variable: <code>ComSpec</code> on Windows; <code>SHELL</code> on
  482. other platforms. In this case the command can be any name that
  483. the shell can execute; it need not be a complete pathname.
  484. Otherwise, the command entry must be the pathname of an
  485. executable <strong>binary</strong> program. If <em>Use Default
  486. Command Shell</em> is selected then the <em>Check Command
  487. Pathname</em> check box will be visible. You can use it to
  488. select whether Run-REDUCE should check that the command is a
  489. pathname that exists and is readable, and the field label
  490. changes as appropriate. The default configuration uses the
  491. shell and on Linux also uses the search path and does not check
  492. the command pathname,
  493. </p>
  494. <p>A complete REDUCE command must be split into the command name
  495. as described above and a sequence of up to 5 command
  496. arguments. (It would be easy to increase this limit, but I hope
  497. 5 arguments is enough!) The components of the command that
  498. would be separated by white space in a normal shell command must
  499. be entered into separate fields in this dialogue. (Blank
  500. arguments are ignored.) Run-REDUCE handles the quoting required
  501. on Windows, so you should not normally include any quotes
  502. explicitly. If any field (other than Command Label) begins
  503. with <code>~</code> followed immediately by <code>/</code>
  504. or <code>\</code> then it is replaced by your home directory (on
  505. all platforms).
  506. </p>
  507. <p>You can use absolute pathnames if you want, but often (as with
  508. the PSL REDUCE executable and image file names) command
  509. components share a common root segment. This root segment can
  510. be specified as <code>$REDUCE</code>, which Run-REDUCE will
  511. replace with the value of the <em>Command Root Directory</em>
  512. field if it is set, or with the value of the <em>REDUCE Root
  513. Directory</em> field otherwise. (I have borrowed environment
  514. variable syntax, but <code>$REDUCE</code> here is not related to
  515. any environment variable.) The <em>Command Root Directory</em>
  516. chooser and file choosers use as initial directory the
  517. current <em>Command Root Directory</em> field value if defined,
  518. otherwise the <em>REDUCE Root Directory</em> field value if
  519. defined, otherwise the platform default REDUCE root directory.
  520. The file choosers replace the root segment of the returned path
  521. by $REDUCE if possible.
  522. </p>
  523. <p>The two default REDUCE commands, which assume standard
  524. installations of CSL and PSL REDUCE, share the same root
  525. directory, which is why the default configuration
  526. uses <em>REDUCE Root Directory</em> and leaves <em>Command Root
  527. Directory</em> empty. But a Subversion build or a version of
  528. REDUCE running on Common Lisp would probably use a different
  529. root directory.
  530. </p>
  531. <h2 id="FileMenu">The File Menu</h2>
  532. <p>Some items in this menu pop up a dialogue that allows you to
  533. select one or more items, such as filenames. This dialogue
  534. supports all the standard keyboard and mouse-based selection
  535. facilities normally provided by your platform. In particular, in
  536. dialogues that allow selection of multiple items, holding
  537. the <em>Control</em> key down while clicking on an item selects or
  538. deselects it without affecting any other selections, and holding
  539. a <em>Shift</em> key down while clicking on an item extends the
  540. selection to that item. Double-clicking on an item selects it and
  541. then immediately runs the action associated with the confirmation
  542. button.
  543. </p>
  544. <p>Most of the menu items run a REDUCE command, which is echoed in
  545. the display pane but does not appear in the input editor. The
  546. file chooser dialogues all share the same default directory, which
  547. normally is initially your home directory, but the last directory
  548. you used will be the default directory the next time you use a
  549. file chooser dialogue. This default directory is generally
  550. independent of REDUCE's default directory, even if it is initially
  551. the same.
  552. </p>
  553. <p>The <em>File</em> menu provides the following items:</p>
  554. <h3>Echo File Input</h3>
  555. <p>Selecting this causes Run-REDUCE to echo file input to
  556. the <em>Input/Output Display</em> pane. It is selected by
  557. default.</p>
  558. <h3>Input from Files...</h3>
  559. <p>This displays a file chooser that allows you to choose one or
  560. more source code files to input into REDUCE (using the
  561. REDUCE <code>IN</code> command). By default, the file chooser
  562. shows only <code>*.red</code> and <code>*.tst</code> files, but
  563. you can reset it to show only <code>*.txt</code> files or all
  564. files. (Note that the recommended extension for REDUCE source code
  565. file names is <code>.red</code> and that a REDUCE source code file
  566. should end with <code>;end;</code> to avoid an error message.)
  567. This menu item is disabled unless REDUCE is running.
  568. </p>
  569. <h3>Input Package Files...</h3>
  570. <p>This works the same as the previous menu item except that the
  571. initial directory is always the REDUCE packages directory. It is
  572. primarily intended to provide easy access to the package test
  573. files.
  574. </p>
  575. <h3>Output to New File...</h3>
  576. <p>This displays a file chooser that allows you to choose a file
  577. to send output to instead of the GUI (using the
  578. REDUCE <code>OUT</code> command). By default, the file chooser
  579. shows only <code>*.log and *.rlg</code> files, but you can reset
  580. it to show only <code>*.txt</code> files or all files. (Note that
  581. the extension used for REDUCE package test output log file names
  582. is <code>.rlg</code>.) Only one output file can be active at a
  583. time and choosing a new output file redirects output to that file
  584. without shutting the previous output file. The GUI remember all
  585. the open output files (opened via this menu item) to facilitate
  586. switching or shutting output files as described below. This menu
  587. item is disabled unless REDUCE is running.
  588. </p>
  589. <h3>Output to Open File...</h3>
  590. <p>This displays a list of open output files and allows you to
  591. select one for output. This menu item is disabled unless there are
  592. open output files.</p>
  593. <h3>Output Here</h3>
  594. <p>This redirects output to the GUI without shutting the current
  595. output file (using the REDUCE <code>OUT T</code> command). This
  596. menu item is disabled unless there are open output files.
  597. </p>
  598. <h3>Shut Output Files...</h3>
  599. <p>This displays a list of open output files and allows you to
  600. select one or more to be shut (using the REDUCE <code>SHUT</code>
  601. command). This menu item is disabled unless there are open output
  602. files.</p>
  603. <h3>Shut Last Output File</h3>
  604. <p>This shuts the last used open output file (using the
  605. REDUCE <code>SHUT</code> command). This menu item is disabled
  606. unless there are open output files.
  607. </p>
  608. <h3>Print Session Log...</h3>
  609. <p>This prints the whole content of the <em>Input/Output
  610. Display</em> pane including all styling, after first displaying
  611. your platform's standard print dialogue. After you confirm the
  612. print dialogue, an alert pops up to either confirm that the
  613. session log has been sent to the printer or report failure.
  614. Whilst printing seems to work fine on Microsoft Windows it can be
  615. a bit awkward on Linux; see <a href="#Printing">Printing on
  616. Linux</a>.
  617. </p>
  618. <h3>Save Session Log...</h3>
  619. <p>This displays a file chooser that allows you to specify a file
  620. to which to save the entire contents of the <em>Input/Output
  621. Display</em> pane. By default, the file chooser shows
  622. only <code>*.log</code> and <code>*.rlg</code> files, but you can
  623. reset it to show only <code>*.txt</code> files or all files. The
  624. filename defaults to <code>session.log</code>, but you can change
  625. this. If the specified file already exists then the session log
  626. overwrites its previous content. Typeset maths is output as LaTeX
  627. markup.
  628. </p>
  629. <h3>Append Session Log...</h3>
  630. <p>This works the same as the previous menu item except that if
  631. the specified file exists then the session log is appended to its
  632. previous content.</p>
  633. <h3>Exit</h3>
  634. <p>This terminates both REDUCE and the Run-REDUCE GUI, as does
  635. the close widget that is normally at the top right-hand corner of
  636. the main window frame.
  637. </p>
  638. <h2 id="REDUCEMenu">The REDUCE Menu</h2>
  639. <p>The <em>REDUCE</em> menu provides the following items:</p>
  640. <h3>Run REDUCE...</h3>
  641. <p>This sub-menu provides an item for each configured REDUCE
  642. command (typically based on different versions of Lisp, by default
  643. CSL and PSL). Clicking on a REDUCE command runs it. This sub-menu
  644. is disabled when REDUCE is running.
  645. </p>
  646. <h3>Auto-run REDUCE...</h3>
  647. <p>This sub-menu allows you to select a REDUCE command that
  648. Run-REDUCE will run automatically when it starts, or
  649. none. Run-REDUCE remembers this selection and uses it the next
  650. time it starts. If REDUCE is not running then Run-REDUCE also
  651. runs the selected REDUCE command immediately.
  652. </p>
  653. <h3>Load Packages...</h3>
  654. <p>This displays a list of standard REDUCE packages and allows you
  655. to select one or more to load (using the
  656. REDUCE <code>LOAD_PACKAGE</code> command). The list excludes
  657. packages that are pre-loaded and is sorted alphabetically.
  658. Run-REDUCE determines the list of packages each time it starts
  659. up by reading the <code>package.map</code> file in the REDUCE
  660. installation. This menu item is disabled unless REDUCE is
  661. running.
  662. </p>
  663. <h3>Stop REDUCE</h3>
  664. <p>This terminates REDUCE but <strong>not</strong> the
  665. Run-REDUCE GUI. <strong>It is the recommended way to stop
  666. REDUCE because then Run-REDUCE reliably knows that REDUCE is no
  667. longer running.</strong> (Run-REDUCE tries to detect input of
  668. the <code>BYE</code> and <code>QUIT</code> commands via the input
  669. editor, but this may be less reliable.) This menu item is disabled
  670. unless REDUCE is running.
  671. </p>
  672. <h3>Clear I/O Display</h3>
  673. <p>This completely erases the content of the <em>Input/Output
  674. Display</em> pane. If you want to keep the content, use
  675. the <em>Save / Append Session Log...</em> item on
  676. the <em>File</em> menu before clearing!
  677. </p>
  678. <h3>Restart REDUCE</h3>
  679. <p>This does a full clean restart of the last-run REDUCE command,
  680. which is equivalent to <em>Stop REDUCE</em> followed
  681. by <em>Clear I/O Display</em> followed by running the last-run
  682. REDUCE command.
  683. </p>
  684. <h3>Configure REDUCE...</h3>
  685. <p>This displays a dialogue that allows you to configure the
  686. REDUCE directories and commands;
  687. see <a href="#Configuration">REDUCE Configuration</a>.</p>
  688. <h3>Kill REDUCE</h3>
  689. <p>This cab be used to kill REDUCE in an emergency, such as if it
  690. hangs or you put it into an infinite loop. Once REDUCE has been
  691. successfully killed, an information dialogue pops up. If the
  692. attempt to kill REDUCE may have failed then an error dialogue
  693. pops up. In this (unlikely) situation, it may be advisable to
  694. use operating system facilities to check that REDUCE has been
  695. killed and if necessary kill it, and then restart Run-REDUCE.
  696. </p>
  697. <h2 id="ViewMenu">The View Menu</h2>
  698. <p>Run-REDUCE remembers the options you select using
  699. the <em>View</em> menu and uses them the next time you start
  700. Run-REDUCE. Run-REDUCE uses the last set values initially
  701. when you create a new REDUCE panel. The <em>View</em> menu
  702. provides the following items:</p>
  703. <h3>Font Size...</h3>
  704. <p>This displays a dialogue that allows you to change the font
  705. size used in the <em>Input/Output Display</em> and <em>Input
  706. Editor</em> panes. Font size applies to each REDUCE panel
  707. independently.
  708. </p>
  709. <h3>Font Colours...</h3>
  710. <p>This displays a dialogue that allows you to change the colours
  711. used in the <em>Input/Output Display</em> pane. Font colours
  712. apply to all REDUCE panels together.
  713. </p>
  714. <p>The colours that you can select are the foreground text colours
  715. for algebraic and symbolic mode input and output, and the
  716. background colours for warnings (preceded by <code>***</code>)
  717. and errors (preceded by <code>*****</code>). The labels on the
  718. left model the colours. Clicking on a button on the right drops
  719. down a simple colour grid from which you can pick a colour, and
  720. clicking on <em>Custom Color...</em> at the bottom of the grid
  721. opens a more advanced dialogue, which includes the option to
  722. change the opacity. This is primarily relevant to the
  723. background colours, which are 25% opaque by default.
  724. </p>
  725. <p>If you click on the <em>Cancel</em> button then the colours
  726. used do not change. If you click on the <em>Save</em> button
  727. then the currently selected colours are used for the selected
  728. REDUCE panel and saved as preferences. They will be used by
  729. default the next time you start Run-REDUCE. If you click on
  730. the <em>Reset Defaults</em> button then the built-in default
  731. colours are reinstated in the dialogue but not used or saved
  732. unless you click on the <em>Save</em> button.
  733. </p>
  734. <h3>Bold Prompts</h3>
  735. <p>Selecting this item causes Run-REDUCE to embolden the display
  736. of all input prompts. Bold prompts apply to each REDUCE panel
  737. independently.
  738. </p>
  739. <h3>I/O Colouring</h3>
  740. <p>Selecting this item causes Run-REDUCE to colour the text in
  741. the <em>Input/Output Display</em> pane. I/O colouring applies to
  742. each REDUCE panel independently (although the colour choices apply
  743. to all REDUCE panels together). The colouring depends on REDUCE's
  744. current input mode: by default, algebraic-mode prompts and input
  745. are red, algebraic-mode output is blue, symbolic-mode prompts and
  746. input are green, symbolic-mode output is brown. Echoed file input
  747. is not coloured. By default, Run-REDUCE highlights warnings and
  748. errors with quarter-opaque orange and red background colours.
  749. </p>
  750. <p>Note that turning I/O colouring on does not fully take effect
  751. until the next input prompt. Turning I/O colouring off takes
  752. effect immediately and turning it back on mid-session turns any
  753. previous I/O colouring back on, but any I/O produced while I/O
  754. colouring was turned off will not be coloured. (This is because
  755. the required markup is only generated when I/O colouring is turned
  756. on to conserve resources.) Output display will be slightly faster
  757. when I/O colouring if turned off.
  758. </p>
  759. <h3>Typeset Maths</h3>
  760. <p>Selecting this item causes Run-REDUCE to display algebraic-mode
  761. mathematical output more-or-less as it would be typeset, and
  762. centred horizontally. Typeset maths applies to each REDUCE
  763. panel independently. Output display will be significantly
  764. faster when Typeset Maths is turned
  765. off. <strong>WARNINGS:</strong> Typeset Maths is currently
  766. experimental and line breaking is somewhat arbitrary. The
  767. display may be incorrect in some cases, e.g. with unusual switch
  768. settings such as <em>on list</em>. If any LaTeX markup appears
  769. (coloured red) in the output then please let me know! <em>Save
  770. Session Log...</em> outputs typeset maths using LaTeX markup.
  771. </p>
  772. <h3>Single Pane Display</h3>
  773. <p>Selecting this causes Run-REDUCE to display the selected REDUCE
  774. panel only. This is the default.
  775. </p>
  776. <h3>Split Pane Display</h3>
  777. <p>Selecting this causes Run-REDUCE to display two REDUCE panels
  778. side-by-side. The left-hand panel displays the previously
  779. selected REDUCE panel (if any) and is initially active.
  780. Clicking on a REDUCE panel makes it active for input via its
  781. input editor pane and the menus. The inactive REDUCE panel can
  782. continue to update its output display. Both panels are the same
  783. size initially, but you can change that by dragging the divider.
  784. </p>
  785. <h3>Tabbed Pane Display</h3>
  786. <p>Selecting this causes Run-REDUCE to display a tabbed pane with
  787. the previously selected REDUCE panel (if any) displayed under
  788. the first tab. Clicking on the <code>&times;</code> icon at the
  789. right of the selected tab label removes that tab and the REDUCE
  790. panel it contains. When there is only one tab, removing it
  791. disables tabbed display but preserves the REDUCE panel that the
  792. tab contained.
  793. </p>
  794. <h3>Synchronise Scrolling</h3>
  795. <p>Selecting this synchronises the scrolling of the two REDUCE
  796. panels in a split pane display; see <a href="#MainWindow">The
  797. Main Window</a>. This menu item is disabled unless split pane
  798. display is selected.
  799. </p>
  800. <h3>Add Another Tab</h3>
  801. <p>This adds a new tab to a tabbed display. This menu item is
  802. disabled unless tabbed pane display is selected.
  803. </p>
  804. <h2 id="TemplatesMenu">The Templates Menu</h2>
  805. <p>The <em>Templates</em> menu facilitates construction of
  806. structured expressions and statements whose syntax might not be
  807. immediately obvious, especially to a novice. The template
  808. dialogues all provide hyperlinks to the key sections of the local
  809. HTML version of the REDUCE Manual, which open in your default web
  810. browser. The dialogues all provide two buttons that apply the
  811. filled-in template: the <em>Edit</em> button inserts the template
  812. output into the input editor at the current cursor position;
  813. the <em>Evaluate</em> button sends the template output directly to
  814. REDUCE for evaluation, adding a terminator if necessary, just as
  815. the <em>Send Input</em> button does. These buttons do not close
  816. the dialogue, which is non-modal (meaning it does not prevent
  817. access to other windows) and can be left open but moved out of the
  818. way. In fact, several template dialogues can be open at the same
  819. time. To close a template dialogue, click on the <em>Close</em>
  820. button.
  821. </p>
  822. <p>If the template represents an operator with a primary operand
  823. then this defaults to <em>ws</em>, which is convenient for simple
  824. interactive calculations, but it can be changed to anything. The
  825. templates provide some minimal input validation: for example, if
  826. an element must be an explicit number (rather than a variable that
  827. must evaluate to a number), the template will check this and
  828. report an error immediately an inappropriate character is entered.
  829. When the <em>Evaluate</em> button is used, the template checks
  830. that all input has been provided that is required for valid REDUCE
  831. syntax; this is not done when the <em>Edit</em> button is used,
  832. assuming that further editing will take place. This makes it easy
  833. to combine the output from templates, for example, to construct a
  834. multiple <em>for</em> loop.
  835. </p>
  836. <p>Some templates have a pair of radio buttons at the top
  837. labelled <em>Symbolic</em> and <em>Numeric</em> that allow you to
  838. switch between the two modes of evaluation; the default
  839. is <em>Symbolic</em>. The <em>Numeric</em> option causes the
  840. template output to turn <em>rounded</em> mode on before the main
  841. template result is output and off again afterwards; it may also
  842. load the <em>numeric</em> package and use specific numerical
  843. versions of functions. The text message towards the top of each
  844. template may vary depending on the <em>Symbolic/Numeric</em>
  845. option.
  846. </p>
  847. <p>Some templates have one or more switches towards the bottom,
  848. which may vary depending on the <em>Symbolic/Numeric</em> option.
  849. The switches consist of check boxes that initially show default
  850. settings (not those currently in effect in REDUCE). Any switches
  851. that are changed from their defaults are set in the template
  852. output to reflect the change before the main template result is
  853. output and reset afterwards. (Beware that this will override any
  854. changes from the default switch settings that were in effect
  855. before the template was used.)
  856. </p>
  857. <p>These templates are intended only for creating simple
  858. structures, but they can form the basis for arbitrarily complex
  859. structures if they are entered into the input editor for further
  860. editing. The fields of expression templates display minimal
  861. formatting intended to hint at how such an expression would
  862. normally be typeset.
  863. </p>
  864. <p>This menu is disabled unless REDUCE is running.
  865. The <em>Templates</em> menu provides the following items:</p>
  866. <h3>Derivative...</h3>
  867. <p>This template supports (partial) differentiation involving up
  868. to three independent variables, each to arbitrary order. The
  869. orders must be explicit positive integers and the total order
  870. automatically updates to reflect the number of independent
  871. variables and their orders. If an order is omitted then it
  872. defaults to 1. The first independent variable is required but
  873. others are optional. The dependent variable defaults
  874. to <em>ws</em> and the first independent variable defaults
  875. to <em>x</em>, but both can be changed.
  876. </p>
  877. <h3>Integral...</h3>
  878. <p>This template supports both indefinite and definite
  879. integration: if both limits are omitted then the integral is
  880. indefinite; if both limits are specified then the integral is
  881. definite. Note that only a definite integral can be evaluated
  882. numerically and the template checks this. The integrand defaults
  883. to <em>ws</em> and the integration variable defaults
  884. to <em>x</em>, but both can be changed.</p>
  885. <p>By default, the template provides a single integral, but if you
  886. enter another integration variable in one of the boxes to the
  887. right of the primary integration variable then an additional
  888. integral appears wrapping the previous integral, thus supporting
  889. double and triple integrals. Matching &int; and <em>d</em> symbol
  890. pairs have the same colour (blue, green or red) to facilitate
  891. adding limits to the right &int; symbol.
  892. </p>
  893. <h3>Limit...</h3>
  894. <p>This template supports limits of (mostly) continuous functions
  895. (as opposed to sequences). By default, it computes a two-sided
  896. limit, which is appropriate if the function is continuous at the
  897. limit point. By clicking successively on the superscript box to
  898. the right of the limit point field you cycle through the limit
  899. from the right/above, indicated by a superscript +, the limit from
  900. the left/below, indicated by a superscript -, and the default
  901. two-sided limit. All fields are required. The template includes
  902. an option to load the SPECFN package, which may improve some
  903. results (according to the SPECFN section of the REDUCE User's
  904. Manual).
  905. </p>
  906. <h3>Sum or Product...</h3>
  907. <p>This template supports finite repeated sums and products of
  908. sequences, i.e. functions of a discrete control variable that runs
  909. over a finite range of successive increasing integers. You select
  910. whether to construct a sum or product by clicking on the
  911. appropriate toggle button, which defaults to a sum. All fields
  912. are required.
  913. </p>
  914. <h3>Matrix...</h3>
  915. <p>This template supports the creation of matrices up to 4 by 4.
  916. The elements can be any expressions. The (1,1) element is always
  917. in the top left-hand corner of the template. The width of the
  918. matrix, i.e. the maximum column index, is determined by the
  919. right-most non-empty element and the depth of the matrix, i.e. the
  920. maximum row index, is determined by the lowest non-empty element.
  921. Within the matrix so determined, empty elements default to zero,
  922. which is very convenient for entering diagonal, triangular or
  923. other sparse matrices.
  924. </p>
  925. <h3>For Statement...</h3>
  926. <p>This template supports the creation of <em>for</em> statements
  927. and is modelled on the diagram at the start of the section of the
  928. REDUCE manual headed "FOR Statements". You choose between
  929. iterating over a numerical range and a list by clicking on the
  930. appropriate tab, which then displays the appropriate template.
  931. You choose the <em>action</em> and the <em>for each ... in/on</em>
  932. option via pop-up choice boxes, which default to the most common
  933. choices. (Note that the <em>for each ... on</em> option is only
  934. allowed in symbolic mode, but the template does not check this.)
  935. The field for the expression to be executed by the <em>for</em>
  936. statement is on a separate line to allow it more space.
  937. </p>
  938. <h2 id="FunctionsMenu">The Functions Menu</h2>
  939. <p>The <em>Functions</em> menu facilitates access to some of the
  940. mathematical functions provided by REDUCE via dialogue boxes
  941. similar to those provided by the <em>Templates</em> menu. The
  942. functions provided include all the special functions listed in
  943. section 7.2 <em>Mathematical Functions</em> of the REDUCE User's
  944. Manual. They also include some functions listed only in the
  945. section on the SPECFN package and when necessary the template
  946. output loads the SPECFN package. The function dialogues all
  947. provide hyperlinks to the key sections of the local HTML version
  948. of the REDUCE Manual, which open in your default web browser.
  949. </p>
  950. <p>Hover over a function name to pop up a tooltip that gives a
  951. hint at its definition, which often uses linearlized
  952. mathematical notation similar to LaTeX (but without any
  953. backslashes). Click on the name of a special function to go to
  954. its full definition in the online
  955. NIST <a href="https://dlmf.nist.gov/">Digital Library of
  956. Mathematical Functions</a> (DLMF), which the notation used in
  957. the templates generally follows. (This occasionally differs
  958. slightly from the notation used in the REDUCE Manual.)
  959. </p>
  960. <p>The function dialogue boxes provide a grid of function
  961. templates. Click on the radio button to the left of the
  962. function you want to use. All but the active template is
  963. disabled and greyed out. The templates display the conventional
  964. notation used for the functions but with editable text fields
  965. holding the function arguments. The default arguments are
  966. either <em>ws</em>, where this seems appropriate, or the
  967. conventional variable names, usually those used in the DLMF.
  968. </p>
  969. <p>All <em>Functions</em> dialogue boxes have a pair of radio
  970. buttons at the top labelled <em>Symbolic</em>
  971. and <em>Numeric</em> that allow you to switch between the two
  972. modes of evaluation; the default is <em>Symbolic</em>.
  973. The <em>Numeric</em> option causes the template output to
  974. turn <em>rounded</em> mode on before the main template result is
  975. output and off again afterwards.
  976. </p>
  977. <p>There are also some switches towards the bottom, depending on
  978. the <em>Symbolic/Numeric</em> option. The switches consist of
  979. check boxes that initially show default settings (not those
  980. currently in effect in REDUCE). Any switches that are changed
  981. from their defaults are set in the template output to reflect
  982. the change before the main template result is output and reset
  983. afterwards. (Beware that this will override any changes from
  984. the default switch settings that were in effect before the
  985. template was used.) All dialogues provide the
  986. switch <em>complex</em>, which in most cases is available only
  987. in <em>numeric</em> mode and turns on the use of complex
  988. arithmetic; it is off by default. All dialogues also provide
  989. the switch <em>savesfs</em>, which turns on caching of numerical
  990. values of special functions; it is on by default.
  991. </p>
  992. <p>This menu is disabled unless REDUCE is running.
  993. The <em>Templates</em> menu provides the following items:</p>
  994. <h3>Exp, Log, Power, etc...</h3>
  995. <p>This provides the exponential function, various logarithms,
  996. power and roots (surds or radicals), factorial and binomial
  997. coefficients, and the <em>hypot</em>, <em>atan<sub>2</sub></em>
  998. and <em>atan<sub>2</sub>d</em> functions. The latter
  999. automatically loads the TRIGD package.
  1000. </p>
  1001. <h3>Gamma & Beta Functions, etc...</h3>
  1002. <p>This provides the Gamma, Beta, digamma, polygamma, normalized
  1003. incomplete Gamma and Beta, and dilogarithm functions, Pochhammer's
  1004. symbols, binomial coefficients and the Riemann zeta function.
  1005. </p>
  1006. <h3>Integral Functions...</h3>
  1007. <p>This provides exponential, logarithmic, sine, cosine,
  1008. hyperbolic sine and hyperbolic cosine integral functions, the
  1009. error function and complementary error function, and the Fresnel
  1010. sine and cosine integral functions.
  1011. </p>
  1012. <h3>Airy & Bessel Functions, etc...</h3>
  1013. <p>This provides Airy functions of the first (Ai) and second (Bi)
  1014. kind and their derivatives (Ai' and Bi'), and the families of
  1015. Bessel functions of the first (<em>J</em>) and second (<em>Y</em>)
  1016. kind, modified Bessel functions of the first (<em>I</em>) and
  1017. second (<em>K</em>) kind, and Hankel functions of the first and
  1018. second kind.
  1019. </p>
  1020. <h3>Struve & Kummer Functions, etc...</h3>
  1021. <p>This provides the families of Struve (<b>H</b>) and modified
  1022. Struve (<b>L</b>) functions, Lommel functions of the first
  1023. (<em>s</em>) and second (<em>S</em>) kind, Kummer <em>M</em>
  1024. and <em>U</em> functions, Whittaker <em>M</em> and <em>W</em>
  1025. functions, and spherical and solid harmonic (<em>Y</em>)
  1026. functions.
  1027. </p>
  1028. <h3>Classical Orthogonal Polynomials...</h3>
  1029. <p>This provides the families of Jacobi (<em>P</em>) and
  1030. Ultraspherical or Gegenbauer (<em>C</em>) polynomials, Chebyshev
  1031. polynomials of the first (<em>T</em>) and second (<em>U</em>)
  1032. kind, Legendre (<em>P</em>) and associated Legendre polynomials,
  1033. Laguerre (<em>L</em>) and generalized Legendre polynomials, and
  1034. Hermite (<em>H</em>) polynomials.
  1035. </p>
  1036. <h2 id="HelpMenu">The Help Menu</h2>
  1037. <p>All the documents accessed via the <em>Help</em> menu are local
  1038. files. The <em>Help</em> menu provides the following items:</p>
  1039. <h3>Run-REDUCE User Guide</h3>
  1040. <p>This opens the Run-REDUCE User Guide in your default web
  1041. browser. It is extracted from the Java JAR file at most once per
  1042. run of Run-REDUCE to your default temporary directory.
  1043. </p>
  1044. <h3>REDUCE Manual etc.</h3>
  1045. <p>These menu items open the manuals and other guides that are
  1046. distributed with REDUCE in your default web browser or PDF viewer,
  1047. as appropriate. The files are assumed to be available in your
  1048. REDUCE installation.
  1049. </p>
  1050. <h3>REDUCE Web Site</h3>
  1051. <p>This opens the REDUCE Web Site in your default web browser. It
  1052. provides a lot of background information about REDUCE.
  1053. </p>
  1054. <h3>SourceForge Project Site</h3>
  1055. <p>This opens the SourceForge Project Site in your default web
  1056. browser. It provides access to the repository containing full
  1057. source code for REDUCE itself, PSL, CSL, and some very closely
  1058. related projects, pre-built distributions of REDUCE for various
  1059. platforms, mailing lists, bug reporting, etc.
  1060. </p>
  1061. <h3>About Run-REDUCE</h3>
  1062. <p>This pops up brief information about Run-REDUCE, including
  1063. the version number and month of the release. The version number
  1064. is also shown in the application title bar.</p>
  1065. <h2 id="TypesetMaths">Typeset Maths Display</h2>
  1066. <h3>Differences from the CSL REDUCE GUI, etc.</h3>
  1067. <ul>
  1068. <li>Display strings as text (using a normal font) and all
  1069. identifiers using italics.</li>
  1070. <li>Always display trailing digits in an identifier, optionally
  1071. preceded by "_", as a subscript. Treat the final "_" in an
  1072. identifier as introducing a subscript if it is followed by
  1073. (the name of) a single character. As a special case, display
  1074. <code>identifier_bar</code> as
  1075. \(\overline{\mathit{identifier}}\) (for
  1076. any <code>identifier</code>), which can be followed by digits
  1077. or "_" as described above. See the examples in the table
  1078. below. Ignore <code>fancy_lower_digits</code>.</li>
  1079. <li>Display <code>repart</code> and <code>impart</code> as
  1080. \(\Re\) and \(\Im\).</li>
  1081. <li>Display <code>abs(x)</code> as \(|x|\) and matrix
  1082. assignments as assignments.</li>
  1083. <li>Do not display superfluous space around commas in algebraic
  1084. lists and flat printed matrix rows.</li>
  1085. </ul>
  1086. <table>
  1087. <tr><th>Identifier</th><th>Displays as</th></tr>
  1088. <tr><td><code>my_id123</code></td><td>\(\mathit{my\_id}_{123}\)</td></tr>
  1089. <tr><td><code>alpha123</code></td><td>\(\alpha_{123}\)</td></tr>
  1090. <tr><td><code>beta_i</code></td><td>\(\beta_i\)</td></tr>
  1091. <tr><td><code>gamma_delta</code></td><td>\(\gamma_\delta\)</td></tr>
  1092. <tr><td><code>my_long_id</code></td><td>\(\mathit{my\_long\_id}\)</td></tr>
  1093. <tr><td><code>z_bar</code></td><td>\(\bar{z}\)</td></tr>
  1094. <tr><td><code>complex_variable_bar</code></td>
  1095. <td>\(\overline{\mathit{complex\_variable}}\)</td></tr>
  1096. <tr><td><code>z_bar123</code></td><td>\(\bar{z}_{123}\)</td></tr>
  1097. <tr><td><code>z_bar_k</code></td><td>\(\bar{z}_k\)</td></tr>
  1098. </table>
  1099. <h3>Derivatives</h3>
  1100. <p>
  1101. The (shared) variable <code>fancy_print_df</code> can be set to
  1102. one of the values <code>partial</code>, <code>total</code>
  1103. or <code>indexed</code> to control the display of derivatives.
  1104. The default value is <code>partial</code>. Typeset maths also
  1105. supports the <code>dfprint</code> switch, and if this switch is
  1106. on then <code>fancy_print_df</code> is ignored. For example,
  1107. with the following settings, derivatives are displayed as
  1108. follows (assuming <code>depend f,x,y</code> and <code>operator
  1109. g</code>):
  1110. </p>
  1111. <table>
  1112. <tr>
  1113. <th><code>Setting</code></th>
  1114. <th><code>df(f,x,2,y)</code></th>
  1115. <th><code>df(g(x,y),x,2,y)</code></th>
  1116. </tr>
  1117. <tr>
  1118. <td><code>fancy_print_df := partial</code></td>
  1119. <td>\(\frac{\partial^3 f}{\partial x^2 \partial y}\)</td>
  1120. <td>\(\frac{\partial^3 g(x,y)}{\partial x^2 \partial y}\)</td>
  1121. </tr>
  1122. <tr>
  1123. <td><code>fancy_print_df := total</code></td>
  1124. <td>\(\frac{d^3 f}{d x^2 d y}\)</td>
  1125. <td>\(\frac{d^3 g(x,y)}{d x^2 d y}\)</td>
  1126. </tr>
  1127. <tr>
  1128. <td><code>fancy_print_df := indexed</code></td>
  1129. <td>\(f_{x,x,y}\)</td>
  1130. <td>\(g(x,y)_{x,x,y}\)</td>
  1131. </tr>
  1132. <tr>
  1133. <td><code>on dfprint</code></td>
  1134. <td>\(f_{x,x,y}\)</td>
  1135. <td>\(g_{x,x,y}\)</td>
  1136. </tr>
  1137. </table>
  1138. <h3>Operators</h3>
  1139. <p>
  1140. An operator declared <code>print_indexed</code> has its
  1141. arguments displayed as indices, e.g. after <code>print_indexed
  1142. a</code> the operator value <code>a(i,2)</code> is displayed as
  1143. \(a_{i,2}\). You can declare several operators together to be
  1144. indexed, e.g.
  1145. <pre>print_indexed a, b, c;</pre>
  1146. </p>
  1147. <h2 id="Printing">Printing on Linux</h2>
  1148. <p>It appears that on Linux, JavaFX is not aware of the default
  1149. <em>Print to File</em> printer and only displays the print
  1150. dialogue if there is at least one printer explicitly installed.
  1151. However, it should be sufficient to install the CUPS PDF
  1152. printer, to which Run-REDUCE can print. (But beware that
  1153. Run-REDUCE may not recognise the new printer immediately!) If
  1154. you have problems printing to a real printer then a workaround
  1155. might be first to print to PDF and then to print the PDF to a
  1156. real printer.
  1157. </p>
  1158. <p>If you cancel the print dialogue then Run-REDUCE may be left
  1159. unresponsive for a long time, but switching focus away from and
  1160. then back to Run-REDUCE may make it responsive again.
  1161. Alternatively, you may be able to avoid this problem by
  1162. selecting the <em>Print To File</em> option instead of
  1163. cancelling the print dialogue, clicking on <em>Print</em> and
  1164. then cancelling the resulting file selector, which should cancel
  1165. the whole print job immediately. (Nearly all of the code
  1166. involved is in the standard JavaFX library and so out of my
  1167. control, although in the longer term I might be able to improve
  1168. the responsiveness by running printing in a separate thread.)
  1169. </p>
  1170. <h2 id="ConfigExamples">Configuring Run-REDUCE for Subversion Builds</h2>
  1171. <p>Here are some examples of REDUCE command configurations that
  1172. might be appropriate if you build REDUCE yourself and want to
  1173. run it from your Subversion repository. They assume that you
  1174. downloaded the repository to your home directory using
  1175. the <code>svn</code> command provided by SourceForge.
  1176. </p>
  1177. <h3>Microsoft Windows using the Shell</h3>
  1178. <h4>CSL REDUCE</h4>
  1179. <table class="small nowrap">
  1180. <tr><th>Command Label</th><td><code>CSL REDUCE Subversion</code></td></tr>
  1181. <tr><th>Command Root Directory</th><td><code>~\reduce-algebra-code</code></td></tr>
  1182. <tr><th>Command Pathname</th><td><code>$REDUCE\bin\redcsl.bat</code></td></tr>
  1183. <tr><th>Command Argument 1</th><td><code>--nogui</code></td></tr>
  1184. </table>
  1185. <h4>PSL REDUCE</h4>
  1186. <table class="small nowrap">
  1187. <tr><th>Command Label</th><td><code>PSL REDUCE Subversion</code></td></tr>
  1188. <tr><th>Command Root Directory</th><td><code>~\reduce-algebra-code</code></td></tr>
  1189. <tr><th>Command Pathname</th><td><code>$REDUCE\bin\redpsl.bat</code></td></tr>
  1190. </table>
  1191. <h3>Linux using the Shell</h3>
  1192. <h4>CSL REDUCE</h4>
  1193. <table class="small nowrap">
  1194. <tr><th>Command Label</th><td><code>CSL REDUCE Subversion</code></td></tr>
  1195. <tr><th>Command Root Directory</th><td><code>~/reduce-algebra-code</code></td></tr>
  1196. <tr><th>Command Pathname</th><td><code>$REDUCE/bin/redcsl</code></td></tr>
  1197. <tr><th>Command Argument 1</th><td><code>--nogui</code></td></tr>
  1198. </table>
  1199. <h4>PSL REDUCE</h4>
  1200. <table class="small nowrap">
  1201. <tr><th>Command Label</th><td><code>PSL REDUCE Subversion</code></td></tr>
  1202. <tr><th>Command Root Directory</th><td><code>~/reduce-algebra-code</code></td></tr>
  1203. <tr><th>Command Pathname</th><td><code>$REDUCE/psl/redpsl</code></td></tr>
  1204. </table>
  1205. <h3>Microsoft Windows not using the Shell</h3>
  1206. <h4>CSL REDUCE</h4>
  1207. <table class="small nowrap">
  1208. <tr><th>Command Label</th><td><code>CSL REDUCE Subversion</code></td></tr>
  1209. <tr><th>Command Root Directory</th><td><code>~\reduce-algebra-code\cslbuild\x86_64-pc-windows</code></td></tr>
  1210. <tr><th>Command Pathname</th><td><code>$REDUCE\csl\reduce.com</code></td></tr>
  1211. <tr><th>Command Argument 1</th><td><code>--nogui</code></td></tr>
  1212. </table>
  1213. <h4>PSL REDUCE</h4>
  1214. <table class="small nowrap">
  1215. <tr><th>Command Label</th><td><code>PSL REDUCE Subversion</code></td></tr>
  1216. <tr><th>Command Root Directory</th><td><code>~\reduce-algebra-code\pslbuild\x86_64-pc-windows</code></td></tr>
  1217. <tr><th>Command Pathname</th><td><code>$REDUCE\psl\bpsl.exe</code></td></tr>
  1218. <tr><th>Command Argument 1</th><td><code>-td</code></td></tr>
  1219. <tr><th>Command Argument 2</th><td><code>1000</code></td></tr>
  1220. <tr><th>Command Argument 3</th><td><code>-f</code></td></tr>
  1221. <tr><th>Command Argument 4</th><td><code>$REDUCE\red\reduce.img</code></td></tr>
  1222. </table>
  1223. <h3>Linux not using the Shell</h3>
  1224. <h4>CSL REDUCE</h4>
  1225. <table class="small nowrap">
  1226. <tr><th>Command Label</th><td><code>CSL REDUCE Subversion</code></td></tr>
  1227. <tr><th>Command Root Directory</th><td><code>~/reduce-algebra-code/cslbuild/x86_64-unknown-ubuntu20.04</code></td></tr>
  1228. <tr><th>Command Pathname</th><td><code>$REDUCE/csl/reduce</code></td></tr>
  1229. <tr><th>Command Argument 1</th><td><code>--nogui</code></td></tr>
  1230. </table>
  1231. <h4>PSL REDUCE</h4>
  1232. <table class="small nowrap">
  1233. <tr><th>Command Label</th><td><code>PSL REDUCE Subversion</code></td></tr>
  1234. <tr><th>Command Root Directory</th><td><code>~/reduce-algebra-code/pslbuild/x86_64-unknown-ubuntu20.04</code></td></tr>
  1235. <tr><th>Command Pathname</th><td><code>$REDUCE/psl/bpsl</code></td></tr>
  1236. <tr><th>Command Argument 1</th><td><code>-td</code></td></tr>
  1237. <tr><th>Command Argument 2</th><td><code>1000</code></td></tr>
  1238. <tr><th>Command Argument 3</th><td><code>-f</code></td></tr>
  1239. <tr><th>Command Argument 4</th><td><code>$REDUCE/red/reduce.img</code></td></tr>
  1240. </table>
  1241. </body>
  1242. </html>