ArticleslgStudy

computer science

Reduce (computer algebra system)

Reduce (computer algebra system) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Reduce (computer algebra system) rather than just read about it. In short: 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.

Reduce (computer algebra system) — main illustration
Reduce (computer algebra system) — illustration

Key takeaways

  • Reduce (computer algebra system) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Reduce (computer algebra system) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Reduce (computer algebra system) from memory before moving on to harder problems.

Reference excerpt

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. REDUCE was 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 dialect called Standard Lisp, 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 (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 integer, rational, complex and floating-point arithmetic expressions and functions involving one or more variables algorithms for polynomials, rational and transcendental functions facilities for the solution of a variety of algebraic equations automatic and user-controlled simplification of expressions substitutions and pattern matching in a wide variety of forms symbolic differentiation, indefinite and definite integration solution of ordinary differential equations computations with a wide variety of special functions general matrix and non-commutative algebra plotting in 2 and 3 dimensions of graphs of functions arbitrary points, lines and curves Dirac matrix calculations of interest in 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 structured programming language based on ALGOL 60 (but with Standard Lisp semantics), although it does not support all ALGOL 60 syntax. It is similar to 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 (;) or a dollar sign ($). The difference is that if the input results in a useful (non-nil) value then it will be output if the separator is a semi-colon (;) but hidden if it is a dollar sign ($). The assignment operator is colon-equal (:=), 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 prompt, terminate it with semi-colon and press the Return or Enter key; REDUCE processes the input and displays the result. This is illustrated in the screenshot.

Identifiers and strings Programming languages use identifiers to name constructs such as variables and functions, and strings to store text. A REDUCE identifier must begin with a letter and can be followed by letters, digits and underscore characters (_). A REDUCE identifier can also include any character anywhere if it is input preceded by an exclamation mark (!). A REDUCE string is any sequence of characters delimited when input by double quote characters ("). 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 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-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 (!). Hence, it is conventional to use snake-case (e.g. long_name) rather than camel-case (e.g. longName) 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!

REDUCE displays the output

Another REDUCE "Hello, World!" program, which is slightly longer than the version above, uses an identifier as follows

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 nil 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 begin...end 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 return. The other uses the bracketing syntax <<...>>, 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 example below.

Structured programming REDUCE supports 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 x > 0 {\displaystyle x>0} . (The REDUCE user-level language does not explicitly support constants representing true or false although, as in C and related languages, 0 has the boolean value false, whereas 1 and many other non-zero values have the boolean value true.)

… excerpt ends here. Continue reading the full article.

Illustrations

Reduce (computer algebra system) illustration
Reduce (computer algebra system) illustration

Worked examples

Example 1 — a first encounter with Reduce (computer algebra system)

Start with the simplest possible case. Write down what Reduce (computer algebra system) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Reduce (computer algebra system) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Reduce (computer algebra system) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Reduce (computer algebra system)

In research
Reduce (computer algebra system) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Reduce (computer algebra system) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Reduce (computer algebra system) is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer algebra system software for Linux, Computer algebra systems, Formerly proprietary software, so understanding it makes those chapters shorter.
In everyday life
Look for Reduce (computer algebra system) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study Reduce (computer algebra system) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Reduce (computer algebra system) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Reduce (computer algebra system) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Reduce (computer algebra system) in simple terms?

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.

Why does Reduce (computer algebra system) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Reduce (computer algebra system)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Reduce (computer algebra system).

Tags

  • Computer algebra system software for Linux
  • Computer algebra systems
  • Formerly proprietary software
  • Free computer algebra systems
  • Free software programmed in Lisp
  • Software using the BSD license

Keep exploring