Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Reduce (computer algebra system)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|none}} {{Infobox software | name = REDUCE | logo = REDUCE.png | screenshot = REDUCE Screenshot 1.png | caption = CSL REDUCE on Microsoft Windows | developer = Anthony C. Hearn et al. | released = {{Start date and age|1968}} | latest release version = {{Latest stable software release/REDUCE}} | repo = {{URL|https://sourceforge.net/projects/reduce-algebra/}} | programming language = Standard Lisp | operating system = [[Cross-platform]] | genre = [[Computer algebra system]] | license = [[Modified BSD license]] | website = {{URL|https://reduce-algebra.sourceforge.io/}} }} '''REDUCE''' is a general-purpose [[computer algebra system]] originally geared towards applications in physics. The development of REDUCE was started in 1963 by [[Anthony C. Hearn]]; since then, many scientists from all over the world have contributed to its development.<ref name=":0">{{Cite book |last=Hearn |first=Anthony C. |url=https://www.researchgate.net/publication/260255562 |title=Algorithmic Algebra and Logic: Proceedings of the A3L 2005, April 3-6, Passau, Germany Conference in Honor of the 60th Birthday of Volker Weispfenning |date=2005 |publisher=Universitätsbibliothek Passau |chapter=REDUCE: The First Forty Years}}</ref> REDUCE was [[Open-source software|open-sourced]] in December 2008 and is available for free under a [[modified BSD license]] on [[SourceForge]]. Previously it had cost $695. REDUCE is written entirely in its own [[Lisp (programming language)|Lisp]] dialect called Standard Lisp,<ref>{{Cite journal |last1=Marti |first1=J. |last2=Hearn |first2=A. C. |last3=Griss |first3=M. L. |last4=Griss |first4=C. |date=1979-10-01 |title=Standard LISP report |url=https://dl.acm.org/doi/10.1145/953997.953999 |journal=SIGPLAN Not. |volume=14 |issue=10 |pages=48–68 |doi=10.1145/953997.953999 |issn=0362-1340}}</ref> expressed in an [[ALGOL]]-like syntax called RLISP that is also used as the basis for REDUCE's user-level language. Implementations of REDUCE are available on most variants of [[Unix]], [[Linux]], [[Microsoft Windows]], or [[Apple Macintosh]] systems by using an underlying [[Portable Standard Lisp|Portable Standard Lisp (PSL)]] or Codemist Standard Lisp (CSL) implementation. CSL REDUCE offers a [[graphical user interface]]. REDUCE can also be built on other Lisps, such as [[Common Lisp]]. == Features == * [[Arbitrary-precision arithmetic|arbitrary precision]] [[integer]], [[Rational number|rational]], [[Complex number|complex]] and [[Floating-point arithmetic|floating-point]] [[arithmetic]] * [[Expression (mathematics)|expressions]] and [[Function (mathematics)|functions]] involving one or more [[Variable (mathematics)|variables]] * [[Algorithm|algorithms]] for [[Polynomial|polynomials]], [[Rational function|rational]] and [[Transcendental function|transcendental]] functions * facilities for the [[Equation solving|solution]] of a variety of [[Algebraic equation|algebraic equations]] * automatic and user-controlled [[Computer algebra|simplification]] of expressions * [[Rewriting|substitutions]] and [[pattern matching]] in a wide variety of forms * [[Computer algebra|symbolic]] [[Derivative|differentiation]], [[Antiderivative|indefinite]] and [[Integral|definite integration]] * solution of [[Ordinary differential equation|ordinary differential equations]] * computations with a wide variety of [[special functions]] * general [[Matrix (mathematics)|matrix]] and [[Noncommutative ring|non-commutative algebra]] * plotting in 2 and 3 dimensions of ** [[Graph of a function|graphs of functions]] ** arbitrary [[Point (geometry)|points]], [[Line (geometry)|lines]] and [[Curve|curves]] * [[Gamma matrices|Dirac matrix]] calculations of interest in [[Particle physics|high energy physics]] * [[quantifier elimination]] and decision for interpreted [[first-order logic]] * powerful intuitive user-level [[programming language]]. == Syntax == The REDUCE language is a [[High-level programming language|high-level]] [[Structured programming|structured]] programming language based on [[ALGOL 60]] (but with Standard Lisp [[Semantics (computer science)|semantics]]), although it does not support all ALGOL 60 syntax. It is similar to [[Pascal (programming language)|Pascal]], which evolved from ALGOL 60, and [[Modula]], which evolved from Pascal. REDUCE is a [[free-form language]], meaning that spacing and line breaks are not significant, but consequently input statements must be separated from each other and all input must be terminated with either a semi-colon (<code>;</code>) or a dollar sign (<code>$</code>). The difference is that if the input results in a useful (non-<code>nil</code>) value then it will be output if the separator is a semi-colon (<code>;</code>) but hidden if it is a dollar sign (<code>$</code>). The assignment operator is colon-equal (<code>:=</code>), which in its simplest usage assigns to the variable on its left the value of the expression on its right. However, a REDUCE variable can have no value, in which case it is displayed as its name, in order to allow mathematical expressions involving indeterminates to be constructed and manipulated. The simplest way to use REDUCE is interactively: type input after the last input [[Command-line interface|prompt]], terminate it with semi-colon and press the ''[[Enter key|Return]]'' or ''[[Enter key|Enter]]'' key; REDUCE processes the input and displays the result. This is illustrated in the [[:File:REDUCE Screenshot 1.png|screenshot]]. === Identifiers and strings === Programming languages use [[Identifier (computer languages)|identifiers]] to name constructs such as variables and functions, and [[String (computer science)|strings]] to store text. A REDUCE identifier must begin with a letter and can be followed by letters, digits and underscore characters (<code>_</code>). A REDUCE identifier can also include any character anywhere if it is input preceded by an exclamation mark (<code>!</code>). A REDUCE string is any sequence of characters delimited when input by double quote characters (<code>"</code>). A double quote can be included in a string by entering two double quotes; no other escape mechanism is implemented within strings. An identifier can be used instead of a string in most situations in REDUCE, such as to represent a file name. REDUCE source code was originally written in all [[Letter case|upper-case]] letters, as were all programming languages in the 1960s. (Hence, the name REDUCE is normally written in all upper-case.) However, modern REDUCE is [[Case sensitivity|case-insensitive]] (by default), which means that it ignores the case of letters, and it is normally written in lower-case. (The REDUCE source code has been converted to lower case.) The exceptions to this rule are that case is preserved within strings and when letters in identifiers are preceded by an exclamation mark (<code>!</code>). Hence, it is conventional to use [[Snake case|snake-case]] (e.g. <code>long_name</code>) rather than [[Camel case|camel-case]] (e.g. <code>longName</code>) for REDUCE identifiers, because camel-case gets lost without also using exclamation marks. === Hello World programs === Below is a REDUCE [["Hello, World!" program]], which is almost as short as such a program could possibly be! <syntaxhighlight lang="octave" copy> "Hello, World!"; </syntaxhighlight> REDUCE displays the output <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"> Hello, World! </div> Another REDUCE "Hello, World!" program, which is slightly longer than the version above, uses an identifier as follows <syntaxhighlight lang="octave" copy> !Hello!,! !World!!; </syntaxhighlight> CSL REDUCE displays the same output as shown above. (Other REDUCE GUIs may italicise this output on the grounds that it is an identifier rather than a string.) === Statements and expressions === Because REDUCE inherits Lisp semantics, all programming constructs have values. Therefore, the only distinction between statements and expressions is that the value of an expression is used but the value of a statement is not. The terms ''statement'' and ''expression'' are interchangeable, although a few constructs always return the Lisp value <code>nil</code> and so are always used as statements. There are two ways to group several statements or expressions into a single unit that is syntactically equivalent to a single statement or expression, which is necessary to facilitate [[structured programming]]. One is the <code>begin</code>...<code>end</code> construct inherited from ALGOL 60, which is called a ''block'' or ''compound'' statement. Its value is the value of the expression following the (optional) keyword <code>return</code>. The other uses the bracketing syntax <code><<</code>...<code>>></code>, which is called a ''group'' statement. Its value is the value of the last (unterminated) expression in it. Both are illustrated below in the [[#Procedural programming|procedural programming example]] below. === Structured programming === REDUCE supports [[Conditional (computer programming)|conditional]] and repetition statements, some of which are controlled by a ''boolean expression'', which is any expression whose value can be either ''true'' or ''false'', such as <math>x>0</math>. (The REDUCE user-level language does not explicitly support constants representing ''true'' or ''false'' although, as in [[C (programming language)|C]] and related languages, 0 has the boolean value ''false'', whereas 1 and many other non-zero values have the boolean value ''true''.) ==== Conditional statements: if ... then ... else ==== The conditional statement has the form <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"> <code>if</code> ''boolean expression'' <code>then</code> ''statement'' </div> which can optionally be followed by <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"> <code>else</code> ''statement'' </div> For example, the following conditional statement ensures that the value of <math>n</math>, assumed to be numerical, is positive. (It effectively implements the [[Absolute value (algebra)|absolute value]] function.) <syntaxhighlight lang="octave"> if n < 0 then n := -n </syntaxhighlight> The following conditional statement, used as an expression, avoids an error that would be caused by dividing by 0. <syntaxhighlight lang="octave"> recip_x := if x = 0 then infinity else 1/x </syntaxhighlight> ==== Repetition statements: for ... ==== The <code>for</code> statement is a flexible loop construct that executes ''statement'' repeatedly a number of times that must be known in advance. One version has the form <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"> <code>for</code> ''variable'' := ''initial'' <code>step</code> ''increment'' <code>until</code> ''final'' <code>do</code> ''statement'' </div> where ''variable'' names a variable whose value can be used within ''statement'', and ''initial, increment'' and ''final'' are numbers (preferably integers). The value of ''variable'' is initialized to ''initial'' and ''statement'' is executed, then the value of ''variable'' is repeatedly increased by ''increment'' and the ''statement'' executed again, provided the value of ''variable'' is not greater than ''final''. The common special case "''initial'' <code>step 1 until</code> ''final''" can be abbreviated as "''initial'' : ''final''". The following <code>for</code> statement computes the value of <math>n!</math> as the value of the variable <code>fac</code>. <syntaxhighlight lang="octave" copy=""> n := 5; fac := 1$ for r := 2 : n do fac := fac*r; fac; </syntaxhighlight> Another version of the <code>for</code> statement iterates over a list, and the keyword <code>do</code> can be replaced by <code>product</code>, <code>sum</code>, <code>collect</code> or <code>join</code>, in which case the <code>for</code> statement becomes an expression and the controlled ''statement'' is treated as an expression. With <code>product</code>, the value is the product of the values of the controlled ''statement''; with <code>sum</code>, the value is the sum of the values of the controlled ''statement''; with <code>collect</code>, the value is the values of the controlled ''statement'' collected into a list; with <code>join</code>, the value is the values of the controlled ''statement'', which must be lists, joined into one list. The following <code>for</code> statement computes the value of <math>n!</math> much more succinctly and elegantly than the previous example. <syntaxhighlight lang="octave" copy=""> n := 5; for r := 2 : n product r; </syntaxhighlight> ==== Repetition statements: while ... do; repeat ... until ==== The two loop statements <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"> <code>while</code> ''boolean expression'' <code>do</code> ''statement''<br /><code>repeat</code> ''statement'' <code>until</code> ''boolean expression'' </div> are closely related to the conditional statement and execute ''statement'' repeatedly a number of times that need not be known in advance. Their difference is that <code>while</code> repetition stops when ''boolean expression'' becomes false whereas <code>repeat</code> repetition stops when ''boolean expression'' becomes true. Also, <code>repeat</code> always executes ''statement'' at least once and it can be used to initialize ''boolean expression'', whereas when using <code>while</code> ''boolean expression'' must be initialized before entering the loop. The following <code>while</code> statement computes the value of <math>n!</math> as the value of the variable <code>fac</code>. Note that this code treats the assignment <code>n := n - 1</code> as an expression and uses its value. <syntaxhighlight lang="octave" copy> n := 5; fac := n$ while n > 1 do fac := fac*(n := n - 1); fac; </syntaxhighlight> === Comments === REDUCE has three comment conventions. It inherits the ''comment statement'' from ALGOL 60, which looks like this: comment This is a multi-line comment that ends at the next separator, so it cannot contain separators; Comment statements mostly appear in older code. It inherits the <code>%</code>... comment from Standard Lisp, which looks like this: % This is a single-line comment that ends at the end of the line. % It can appear on a line after code and % can contain the separators ";" and "$". <code>%</code>... comments are analogous to [[C++]] <code>//</code>... comments and are the most commonly used form of comment. REDUCE also supports a [[C (programming language)|C]]-style <code>/*</code>...<code>*/</code> comment that looks like this: /* This is a multi-line comment that can appear anywhere a space could and can contain the separators ";" and "$". */ == Programming paradigms == REDUCE's user-level language supports several [[Programming paradigm|programming paradigms]], as illustrated in the [[#Algebraic programming examples|algebraic programming examples]] below. Since it is based on Lisp, which is a [[functional programming]] language, REDUCE supports functional programming and all statements have values (although they are not always useful). REDUCE also supports [[procedural programming]] by ignoring statement values. Algebraic computation usually proceeds by transforming a mathematical expression into an equivalent but different form. This is called ''simplification'', even though the result might be much longer. (The name ''REDUCE'' is a [[pun]] on this problem of ''intermediate expression swell''!) In REDUCE, simplification occurs automatically when an expression is entered or computed, controlled by ''simplification rules'' and ''switches''. In this way, REDUCE supports [[Rule-based system|rule-based programming]], which is the classic REDUCE programming paradigm. In early versions of REDUCE, rules and switches could only be set globally, but modern REDUCE also supports local setting of rules and switches, meaning that they control the simplification of only one expression. REDUCE programs often contain a mix of programming paradigms. == Algebraic programming examples == The [[:File:REDUCE Screenshot 1.png|screenshot]] shows simple interactive use. As a simple programming example, consider the problem of computing the <math>n</math><sup>th</sup> [[Taylor series|Taylor polynomial]] of the function <math>f(x)</math> about the point <math>x=a</math>, which is given by the formula <math>\sum_{r=0}^n \frac{f^{(r)}(a)}{r!} (x-a)^{r}</math>. Here, <math>f^{(r)}</math> denotes the <math>r</math><sup>th</sup> [[derivative]] of <math>f</math> evaluated at the point <math>a</math> and <math>r!</math> denotes the [[factorial]] of <math>r</math>. (However, note that REDUCE includes [https://reduce-algebra.sourceforge.io/manual-lookup.php?Series%20Expansion sophisticated facilities] for [[Power series|power-series]] expansion.) As an ''example of functional programming'' in REDUCE, here is an easy way to compute the 5th Taylor polynomial of <math>\sin x</math> about 0. In the following code, the control variable <code>r</code> takes values from 0 through 5 in steps of 1, <code>df</code> is the REDUCE [[Derivative|differentiation]] operator and the operator <code>sub</code> performs substitution of its first argument into its second. Note that this code is very similar to the mathematical formula above (with <math>n=5</math> and <math>a=0</math>). <!-- REDUCE syntax highlighting is not (yet) supported, but Octave has some similarities and supports %-comments. --> <syntaxhighlight lang="octave" copy> for r := 0:5 sum sub(x = 0, df(sin x, x, r))*x^r/factorial r; </syntaxhighlight> produces by default the output<ref>The typeset REDUCE output shown assumes the use of [https://reduce-algebra.sourceforge.io/versions.php#csl CSL REDUCE].</ref> <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"><math> \frac{x\left(x^4-20x^2+120\right)}{120} </math></div> This is correct, but it doesn't look much like a Taylor series. That can be fixed by changing a few output-control switches and then evaluating the special variable <code>ws</code>, which stands for <u>w</u>ork<u>s</u>pace and holds the last non-empty output expression: <syntaxhighlight lang="octave" copy> off allfac; on revpri, div; ws; </syntaxhighlight> <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"><math> x-\frac{1}{6}x^3+\frac{1}{120}x^5 </math></div> As an ''example of procedural programming'' in REDUCE, here is a procedure to compute the general Taylor polynomial, which works for functions that are well-behaved at the expansion point <math>a</math>. {{anchor|Procedural programming}} <syntaxhighlight lang="octave" copy> procedure my_taylor(f, x, x0, n); % Return the nth Taylor polynomial of f % as a function of x about x0. begin scalar result := sub(x = x0, f), mul := 1; for r := 1:n do << f := df(f, x); mul := mul*(x - x0)/r; result := result + sub(x = x0, f)*mul >>; return result end; </syntaxhighlight> The procedure is called <code>my_taylor</code> because REDUCE already includes an operator called <code>taylor</code>. All the text following a <code>%</code> sign up to the end of the line is a comment. The keyword <code>scalar</code> introduces and initializes two [[Local variable|local variables]], <code>result</code> and <code>mul</code>. The keywords <code>begin</code> and <code>end</code> delimit a block of code that may include local variables and may return a value, whereas the symbols <code><<</code> and <code>>></code> delimit a group of statements without introducing local variables. The procedure may be called as follows to compute the same Taylor polynomial as above. <syntaxhighlight lang="octave" copy> my_taylor(sin x, x, 0, 5); </syntaxhighlight> == File and package handling == REDUCE GUIs provide menu support for some or all of the file and package handling described below. === File handling === In order to develop non-trivial computations, it is convenient to store source code in a file and have REDUCE read it instead of interactive input. REDUCE input should be [[plain text]] (not [[Formatted text|rich text]] as produced by [[Word processor|word-processing]] applications). REDUCE filenames are arbitrary. The REDUCE source code uses the [[filename extension]] <code>.red</code> for the main source code and <code>.tst</code> for the test files, and for that reason REDUCE GUIs such as CSL REDUCE normally offer to input files with those extensions by default, but on platforms such as Microsoft Windows the extension <code>.txt</code> may be more convenient. It is recommended to end a REDUCE input file with the line ;end; as an end-of-file marker. This is something of a historical quirk but it avoids potential warning messages. Apart from that, an input file can contain whatever might be entered interactively into REDUCE. The command <code>in</code> ''file1''<code>,</code> ''file2''<code>,</code> ... inputs each of the named files in succession into REDUCE, essentially as if their contents had been entered interactively, after which REDUCE waits for further interactive input. If the separator used to terminate this command is a semi-colon (<code>;</code>) then the file content is [[Echo (computing)|echoed]] as output; if the separator is a dollar sign (<code>$</code>) then the file content is not echoed. REDUCE filenames can be either absolute or relative to the current directory; when using a REDUCE GUI absolute filenames are safer because it is not obvious what the current directory is! Filenames can be specified as either [[#Identifiers and strings|strings or identifiers]]; strings (in double quotes) are usually more convenient because otherwise filename elements such as directory separators and dots must be escaped with an exclamation mark (<code>!</code>). Note that the [[Microsoft Windows]] directory or folder separator, [[backslash]] (<code>\</code>), does not need to be doubled in REDUCE strings because backslash is not an escape character in REDUCE, but REDUCE on Microsoft Windows also accepts [[Slash (punctuation)|forward slash]] (<code>/</code>) as the directory separator. REDUCE output can be directed to a file instead of the interactive display by executing the command <code>out</code> ''file''<code>;</code> Output redirection can be terminated permanenty by executing the command <code>shut</code> ''file''<code>;</code> or temporarily by executing the command <code>out t;</code> There are similar mechanisms for directing a compiled version of the REDUCE input to a file and loading compiled code, which is the basis for building REDUCE and can be used to extend it. === Loading packages === REDUCE is composed of a number of packages; some are pre-loaded, some are auto-loaded when needed, and some must be explicitly loaded before they can be used. The command <code>load_package</code> ''package1''<code>,</code> ''package2''<code>,</code> ... loads each of the named packages in succession into REDUCE. Package names are ''not'' filenames; they are simple identifiers that do not need any exclamation marks, so they are normally input as identifiers, although they can be input as strings. A package consists of one or more files of compiled Lisp code, and the <code>load_package</code> command ensures that the right files are loaded in the right order. The precise filenames and locations depend on the version of Lisp on which REDUCE is built, but the package names are always the same. == Types and variable scope == REDUCE inherits [[Scope (computer science)|dynamic scoping]] from Lisp, which means that data have types but variables themselves do not: the type of a variable is the type of the data assigned to it. The simplest REDUCE data types are Standard Lisp [[Lisp (programming language)|atomic]] types such as identifiers, machine numbers (i.e. "small" integers and floating-point numbers supported directly by the computer hardware), and strings. Most other REDUCE data types are represented internally as Lisp lists whose first element (<code>car</code>) indicates the data type. For example, the REDUCE input <syntaxhighlight lang="octave" copy> mat((1, 2), (3, 4)); </syntaxhighlight> produces the display <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"><math> \left(\begin{matrix}1&2\\3&4\end{matrix}\right) </math></div> and the internal representation of this matrix is the Lisp list (mat (1 2) (3 4)) The main algebraic objects used in REDUCE are quotients of two possibly-multivariate polynomials, the indeterminates of which, called ''kernels'', may in fact be functions of one or more variables, e.g. the input <syntaxhighlight lang="octave" copy> z := (x + y^2)/f(x,y); </syntaxhighlight> produces the display <div class="center" style="width: auto; margin-left: auto; margin-right: auto;"><math> z\ \mathrm{:=}\ \frac{x+y^2}{f\left(x,y\right)} </math></div> REDUCE uses two representations for such algebraic objects. One is called ''prefix form'', which is just the Standard Lisp code for the expression and is convenient for operations such as input and output; e.g. for <math>z</math> it is (quotient (plus x (expt y 2)) (f x y)) The other is called ''standard quotient'' form, which is better for performing algebraic manipulations such as addition; e.g. for <math>z</math> it is (!*sq ((((x . 1) . 1) ((y . 2) . 1)) (((f x y) . 1) . 1)) t) REDUCE converts between these two representations as necessary, but tries to retain ''standard quotient'' form as much as possible to avoid the conversion overhead. Because variables have no types there are no variable type [[Declaration (computer programming)|declarations]] in REDUCE, but there are [[Variable (computer science)|variable scope]] declarations. The scope of a variable refers to the range of a program throughout which it has the same significance. By default, REDUCE variables are automatically [[Scope (computer science)|global]] in scope, meaning that they have the same significance everywhere, i.e. once a variable has been assigned a value, it will evaluate to that same value everywhere. Variables can be declared to have scope limited to a particular block of code by delimiting that block of code by the keywords <code>begin</code> and <code>end</code>, and declaring the variables <code>scalar</code> at the start of the block, using the following syntax (as illustrated in the [[#Algebraic programming examples|algebraic programming examples]] above): <code>begin</code> <code>scalar</code> ''variable1'', ''variable2'', ...; ''statements'' <code>end</code> Each variable so declared can optionally be followed by an assignment operator (<code>:=</code>) and an initial value. The keyword <code>scalar</code> should be read as meaning ''[[Local variable|local]]''. (The reason for the name ''[[Scalar (physics)|scalar]]'' is buried in the history of REDUCE, but it was probably chosen to distinguish local variables from the [[Four-vector|relativistic 4-vectors]] and [[Gamma matrices|Dirac gamma matrices]] defined in the [[Particle physics|high-energy physics]] package, which was the original core of REDUCE.<ref name=":0" />) The <code>scalar</code> keyword can be replaced by <code>integer</code> or <code>real</code>. The difference is that <code>integer</code> variables are initialized by default to 0, whereas <code>scalar</code> and <code>real</code> variables are initialized by default to the Lisp value <code>nil</code> (which has the algebraic value 0 anyway). This distinction is more significant in the REDUCE implementation language, RLISP, also known as ''symbolic'' or ''lisp mode''. Otherwise, it is useful as documentation of the intended use of local variables. There are two other variable declarations that are used only in the implementation of REDUCE, i.e. in symbolic mode. The REDUCE <code>begin</code>...<code>end</code> block described above is translated into a Standard Lisp <code>prog</code> form by the REDUCE [[Parsing|parser]], and all Standard Lisp variables should either be [[Free variables and bound variables|bound]] in <code>prog</code> forms, or declared <code>global</code> or <code>fluid</code>. In RLISP, these declarations look like this: <code>fluid '(</code>''variable1'' ''variable2'' ...<code>)</code> <code>global '(</code>''variable1'' ''variable2'' ...<code>)</code> A <code>global</code> variable cannot be rebound in a <code>prog</code> form, whereas a <code>fluid</code> variable can. This distinction is normally only significant to a Lisp compiler and is used to maximize efficiency; in interpreted code these declarations can be skipped and undeclared variables are effectively <code>fluid</code>. == Graphics == REDUCE supports graphical display via [[gnuplot]], which is an independent portable open-source graphics package that is included in all REDUCE binary distributions. The REDUCE GNUPLOT package supports the display of curves or surfaces defined by formulas and/or data sets via the command <code>plot(</code>...<code>)</code>. This command exposes some, but not all, of the capabilities of gnuplot. The REDUCE TURTLE and LOGOTURTLE packages are built on the REDUCE GNUPLOT package and support [[turtle graphics]] in two dimensions; the LOGOTURTLE package also exposes additional capabilities of gnuplot, such as control of colour and line thickness, filling and text annotations. == Available implementations and supported platforms == REDUCE is available from [[SourceForge]]. Binary distributions are released<ref name="REDUCE Files" /> a few times a year with no fixed schedule as snapshots of the [[Apache Subversion|Subversion]] repository, and also offer compressed archive snapshots of the full source code. SourceForge can be set up to notify users when a new release is available. In 2024, binary distributions were released for 64-bit versions of [[macOS]], [[Linux]] ([[Debian]] and [[Red Hat Linux|Red Hat]] based systems) and [[Microsoft Windows]]. The installers either include or are available for both CSL- and PSL-REDUCE, and may include the REDUCE source code. REDUCE can be built from the source code on a larger range of platforms and on other Lisp systems, such as [[Common Lisp]].<ref>{{Cite web |title=REDUCE Code |url=https://sourceforge.net/p/reduce-algebra/code/HEAD/tree/trunk/common-lisp/ |access-date=2025-01-07 |website=SourceForge}}</ref> <!-- REDUCE is also available as Web REDUCE to be run entirely within a web browser. It should run on all recent desktop web browsers and there is a mobile version that runs on some mobile web browsers; the appropriate version should be detected automatically. Web REDUCE is downloaded automatically from the REDUCE web server and then run locally in the browser; there may be a delay the first time it is downloaded (or after it has been updated), but subsequently is should run from the browser cache without any noticeable delay. Web REDUCE is a version of CSL REDUCE compiled to WebAssembly using Emscripten. It provides a graphical user interface (only) and supports plotting using a version of Gnuplot that is also compiled to WebAssembly using Emscripten. Web REDUCE is experimental and a little fragile, and does not behave exactly like desktop REDUCE, but it can usefully run all the code examples in this article by copying and pasting them into the Web REDUCE input window. --> == Other software that uses REDUCE == The following projects use REDUCE: * ALLTYPES<ref>{{Cite web |title=ALLTYPES - An ALgebraic Language and TYPE System |url=http://www.alltypes.de/ |url-status=dead |archive-url=https://web.archive.org/web/20240811161343/http://www.alltypes.de/ |archive-date=2024-08-11}}</ref> (ALgebraic Language and TYPe System) is a computer algebra type system with particular emphasis on differential algebra and differential equations; * DAISY<ref>{{Cite web |title=Differential Algebra for Identifiability of SYstems |url=https://daisy.dei.unipd.it/ |access-date=2025-01-19 |website=DAISY}}</ref> (Differential Algebra for Identifiability of SYstems) is a software tool to perform structural identifiability analysis for linear and nonlinear dynamic models described by polynomial or rational ODE equations; * MTT<ref>{{Cite web |title=Model Transformation Tools |url=https://sourceforge.net/projects/mtt/ |access-date=2025-01-19 |website=SourceForge|date=4 September 2014 }}</ref> (Model Transformation Tools) is a set of tools for modeling dynamic physical systems using the bond-graph methodology; * Reduce.jl<ref>{{Cite web |last=Reed |first=Michael |date=May 5, 2017 |title=Reduce.jl |url=https://github.com/chakravala/Reduce.jl |access-date=2025-01-25 |website=GitHub}}</ref> is a symbolic parser for [[Julia (programming language)|Julia]] language term rewriting using REDUCE algebra; * Redlog<ref>{{Cite web |title=Computing with Logic |url=https://www.redlog.eu/ |access-date=2025-01-19 |website=Redlog}}</ref> (REDUCE Logic System) provides more than 100 functions on first-order formulas and was originally independent but is now available as a REDUCE package; * [[Pure (programming language)|Pure]] is a programming language, which has bindings for REDUCE, providing a very interesting environment for doing computer-powered science. ==See also== {{Portal|Free and open-source software|Mathematics}} * [[List of computer algebra systems]] * [[ALTRAN]] * REDUCE Meets [[Cambridge Algebra System|CAMAL]] - J. P. Fitch [https://reduce-algebra.sourceforge.io/reduce38-docs/camal.pdf] ==References== {{Reflist}} ==External links== * {{sourceforge|reduce-algebra|REDUCE}} * Anthony C. Hearn at al., REDUCE User's Manual <small>[ [https://reduce-algebra.sourceforge.io/manual/manual.html HTML] | [https://reduce-algebra.sourceforge.io/manual/manual.pdf PDF] ].</small> * Anthony C. Hearn, [https://reduce-algebra.sourceforge.io/reduce40.pdf "REDUCE: The First Forty Years"]. Invited paper presented at the A3L Conference in Honor of the 60th Birthday of Volker Weispfenning, April 2005. * Andrey Grozin, [https://arxiv.org/abs/1204.3020 "TeXmacs-Reduce interface"], April 2012. {{Computer algebra systems}} {{Authority control}} {{DEFAULTSORT:Reduce (computer algebra system)}} [[Category:Computer algebra system software for Linux]] [[Category:Computer algebra systems]] [[Category:Formerly proprietary software]] [[Category:Free computer algebra systems]] [[Category:Free software programmed in Lisp]] [[Category:Software using the BSD license]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Anchor
(
edit
)
Template:Authority control
(
edit
)
Template:Cite book
(
edit
)
Template:Cite journal
(
edit
)
Template:Cite web
(
edit
)
Template:Computer algebra systems
(
edit
)
Template:Infobox
(
edit
)
Template:Infobox software
(
edit
)
Template:Main other
(
edit
)
Template:Portal
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Sourceforge
(
edit
)
Template:Template other
(
edit
)