The UA-Calculators, Guide and Tutorial

The UA-Calculators are designed to perform various operations on signatures and algebras that are of use in the application of universal algebra to the semantics of programming languages.   The UA-calculator can also serve other uses such as the evaluation of arithmetic expressions, trigonometric and logarithmic expressions, and JavaScript expressions.

General Description of, and directions for, UA-Calculators

UA-Calculators appear throughout the text, as in-text UA-calculators, and it is also an option to have an independent UA-calculator displayed on the left side of the main frame with the book text appearing on the right side of the frame.  You can toggle between having, and not having, a calculator in left side of the main frame by clicking on the UA-Calculator button in the upper frame.

The in-text UA-Calculators  and the independent UA-calculator  are almost the same.  The have in common that:

The differences are that: If  the  independent UA-Calculator is not on the left side of the left side of the main frame, you can make it appear by clicking on the UA-Calculator button in the top frame. If it is already there then you can make it disappear by clicking on the UA-calculator button in the top frame.

Here is an in-text UA-Calculator for you to experiment with:


Do not press the enter key!  Pressing the enter key rather than the perform button may cause everything in the INPUT and DISPLAY to be erased.


Avoid entering syntactically incorrect expressions!  The UA-calculators will only evaluate  expressions (perform computations ) which are syntactically correct as determined by the rules for arguments for the JavaScript eval function. Attempts to evaluate syntactically incorrect expressions  may result in JavaScript errors.  It may or may not be possible to recover from such an error.  There are at least three possibilities: It is possible to copy expressions from the book, or the DISPLAY, into the INPUT and then perform them.  However, multi-line expressions copied from the book text will contain extraneous, but invisible,  end-of-line formatting symbols that will  make the expression impossible to evaluate (will cause a JavaScript error).  These symbols can be edited out, once the expression is copied into the INPUT,  by using the Delete key at the end of each line.   Fortunately,  there is no problem copying most multi-line expressions from the DISPLAY  and this makes it possible to reuse earlier input and output expressions as new inputs.

Short Description ofSpecial UA-Calculator Operations for Signatures and Algebras

While signatures and algebras are represented within the computer as JavaScript Objects, the interface only displays part of the information and general operates on strings rather than on variables.  The reasons for this and the details of the programming are discussed elsewhere.

Other uses of the UA-Calculator

The UA-calculators can be used to evaluate many different forms of expressions in addition to the special universal algebra expressions for which it was designed.   For example, one can evaluate: To evaluate an expression  type it, or copy it, into the INPUT  area (after first clearing the INPUT by clicking on the CLEAR INPUT button), then press the PERFORM button.  The expression, preceded by ">>", will appear at the top of the DISPLAY area, followed by the result of the evaluation, preceded by "<<".
Ill formed expressions will cause error messages to appear in alert windows:

Note, to copy an expression  to the calculator (using a two-button mouse in Netscape):

  1. highlight the expression (using the left mouse button)
  2. click the right mouse button (a window should appear with a menu) select COPY from the menu.
  3. go to the calculator and click on the INPUT (or, if there is text in the INPUT, first click on the "CLEAR INPUT" button)
  4. click on the right mouse button and select PASTE from the menu.

  5. that should do it.
Here are the details for various kinds of expressions: