Meta Mathematics

We want to write a program that implements Constraint Logic Programming. Before we write such a program we would like to describe its behaviour in the language of mathematics. This is mathematics about mathematics, or Meta-Mathematics.

To do this we need to be able to treat the target mathematics as data to be described by the rules in the meta mathematics. But for clarity we would like this mathematical data to look like mathematics. We want the data describing the target mathematics to be represented syntactically like mathemematics.

Data
We add a special operator $$\eta^{-1}\!$$ that takes a mathematical expression as a parameter. This construct means the data describing the mathematical expression. For example,


 * $$\eta^{-1}[ 5 * 6 ]\!$$

Is the data descibing the application of the operator * to the values 5 and 6. It is not the same as the value returned by the function. So it is distinct from,


 * $$\eta^{-1}[ 30 ]\!$$

$$\eta^{-1} \!$$ is a special operation because its' role is to change the meaning of text that appears for the parameter. The text within, although looking like mathematics, represents data structures describing the mathematics, not the results of the mathematical calculations.

Meta
We will be writing functions, in the meta mathematics that transform the data. In order to do this it helps to be able to use values from the meta mathematics within the data. This is achieved using the special operator $$\eta\!$$.

For example we may want to describe the evaluation of $$x * y\!$$ by an evaluation function,


 * $$\forall x, y \in \mathbb{R} : eval(\eta^{-1}[ \eta[x] * \eta[y] ] = x * y\!$$

Meta Types
In writing meta programs it helps to have some standard types;
 * expression - any mathematical expression.
 * call - a call to a function.
 * constant - A constant value, name of a function.
 * variable - A variable

Note that although the use of infix operators and other syntactic devices is usefull to the human reader, to the computer it is just noise. So,


 * $$5 + 6 = +(5, 6) \!$$

and more importantly,


 * $$f, x, y \in expression \and \eta^{-1}[ \eta[f](\eta[x], \eta[y] ] = \eta^{-1}[  5 + 6 ]\!$$

binds
 * $$f = \eta^{-1}[ + ] \!$$
 * $$x = \eta^{-1}[ 5 ] \!$$
 * $$y = \eta^{-1}[ 6 ] \!$$

Conclusion
Meta mathematics has a particular role to play describing algorithms for working with mathematics at a high level.

Links

 * Demand Driven Evaluation
 * Constraint Logic Programming Theory
 * Symbolic Logic Systems
 * Intelligence and Reasoning