QMath symbols overview

QMath is a richly extensible language. It allows anyone to declare new mathematical symbols. Defining their interpretation by the parser (function, operator with its precedence) is a strength that makes it possible to have great readability while keeping about most of your expressivity power.

This page describes the various types of QMath mathematical symbols in precedence order.

SYMBOL

An element of type SYMBOL is simply an atom. It will be translated as an OMS OpenMath element and is supposed to be declared as:

     Symbol: Z  SYMBOL  "setname1:Z"

APPLICATION and BINDING

The two fundamental building blocks of OpenMath, as opposed to the elementary symbols, are the OMA and OMBIND elements which both apply to a list of children OpenMath objects.

OMA is the simple expression of the application of a function (the first child) to its arguments (the others).

OMBIND allows the introduction of a variable which is bound by the formula expressed in the children. One expects quantifiers here.

Both of these can be declared as, for example:

      Symbol: argument APPLICATION "complex1:argument"

Binary Operators

  OP_IMPL
  OP_OR
  OP_AND
  OP_EQ
  OP_PLUS
  OP_PROD
  OP_EXP
  OP_BIND

These are, hopefully in the right order, all the binary operator types. Each of them has lower precedence than the next in the list so that you can avoid most of the brackets in a natural way. For example $a+b*c^2$ will always be properly parsed by QMath as $a+(b*(c^2))$.

You define such operator types with the same syntax as applications, they also end-up be an application in OpenMath.

Please note that the idea that a symbol is an operator only applies to QMath. OpenMath, with its tree representation, has no idea of operators.

Unary operators OP_FACT

Unary operators are similar to binary operators. They apply, however, only to one argument.

As prefix notation, unary operators are the same thing as applications. For example the unary minus is an application.

As postfix, however, like for the factorial, one needs the OP_FACT symbol type.