A Meta simplifier
Authors: C. Faure
Venue: Proceedings of the international symposium on Symbolic and algebraic computation (1990)

The simplification process is a key point in computer algebra systems. Two ideas have induced our model of simplifier : homogenizing the computation over numerical (see below) and formal expressions, and building a simplifier completely reachable by the user. In order to evaluate numerical expressions, the simplifier calls functions which compute the result or raise a runtime type error. Formal expressions are transformed modulo the properties of the operators. For homogenizing those two processes, three basic mechanisms come out : simplification by properties, type checking, evaluation. More over a fourth mechanism using rewriting rules is necessary to compute non-standard transformations needed by the user. The structure of this four-component simplifier must make it completely reachable by the user unlike the usual simplifiers that include a kernel that the user can't modify. For example the operator &ldquo;+&rdquo; is always considered as associative and commutative and there is no way to suppress those properties because they are implicitly used in the code. The only means of suppressing this kernel is to express explicitly all knowledge needed by the simplifier. The model that comes out consists of two parts : a knowledge-base that contains all information and an engine split into four components that consults this base, we call it a meta simplifier1. Each component of the engine takes the needed knowledge in the base to compute transformations on expressions. The algebraic properties allowed are all those used in other systems such as associativity, commutativity with some new ones such as to be an endomorphism, or a ring. The type-checker uses formal types to compute the type of all expressions. In any system, different types of objects are used, for example, integer, sparse-matrix, dense-matrix, list. We call them numerical types because they depend on representation, then a formal type is a set of numerical types which are equivalent modulo representation. For example the formal type matrix would contain sparse matrix and dense matrix. The conversions usually defined between numerical types, are extended to formal types. Every operator is given several formal signatures so the simplifier explicitly solves this overloading. Thus numerical and formal expressions are considered in the same way, and type errors are raised by the same mechanism. This process type checks the expression, solves the overloading and infers types over symbols. The third mechanism uses functions to convert (numerical conversions) and to evaluate numerical expressions (interpretations). The typing process has introduced formal conversions, and not overloaded operators, then the evaluator converts the numerical objects, and applies evaluating function over numerical arguments. The last component performs rewriting with types modulo associativity and commutativity. The information which are introduced above (operators properties, formal signatures, interpretations, conversions, formal types, rewriting rules) are stored in the knowledge base as objects built by the user through an interface, and are consulted but not modified by the engine. The main object in the base is the operator, it consists of a name, properties, formal signatures and interpretations. All the objects are completely modifiable by the user, for example a &ldquo;+&rdquo; can be defined just associative with a semantic of &ldquo;append&rdquo; over the lists and associative, commutative with a semantic of &ldquo;add&rdquo; over algebraic objects. The knowledge-base can be completely customized by the user to fit his precise needs, so the user has potentially several simplifiers at his disposal. The standard scheme of simplification involves those four components in the precise order they have been described above, but the user can choose an other scheme to change the simplifier behavior. Given an interface to build the base, an engine supplied with a mechanism of control, the user can build exactly the simplifier he requires.