The function SEMIRING_NORMALIZERS_CONV should be given two theorems about
some binary operators that we write as infix `+', `*' and `^' and
ground terms `ZERO' and `ONE'. (The conventional symbols make the import of
the theorem easier to grasp, but they are essentially arbitrary.) The first
theorem is of the following form, essentially stating that the operators form a
semiring structure with `^' as the ``power'' operator:

The second theorem may just be TRUTH = |- T, in which case it will be assumed
that the structure is just a semiring. Otherwise, it may be of the following
form for ``negation'' (neg) and ``subtraction'' functions, plus a
ground term MINUS1 thought of as -1:

|- (!x. neg x = MINUS1 * x) /\
(!x y. x - y = x + MINUS1 * y)

If the second theorem is provided, the eventual normalizer will also handle the
negation and subtraction operations. Generally this is beneficial, but is
impossible on structures like :num with no negative numbers.
The remaining arguments are a tuple. The first is an ordering on terms, used to
determine the polynomial form. Normally, the default OCaml ordering is fine.
The rest are intended to be functions for operating on `constants' (e.g.
numerals), which should handle at least `ZERO', `ONE' and, in the case of a
ring, `MINUS1'. The functions are: (i) a test for membership in the set of
`constants', (ii) an addition conversion on constants, (iii) a multiplication
conversion on constants, and (iv) a conversion to raise a constant to a numeral
power. Note that no subtraction or negation operations are needed explicitly
because this is subsumed in the presence of -1 as a constant.
The function then returns conversions for putting terms of the structure into a
canonical form, essentially multiplied-out polynomials with a particular
ordering. The functions respectively negate, add, subtract, multiply,
exponentiate terms already in the canonical form, putting the result back in
canonical form. The final return value is an overall normalization function.

FAILURE CONDITIONS

Fails if the theorems are malformed.

EXAMPLE

There are already instantiations of the main normalizer for natural numbers
(NUM_NORMALIZE_CONV) and real numbers (REAL_POLY_CONV). Here is how the
latter is first constructed (it is later enhanced to handle some additional
functions more effectively, so use the inbuilt definition, not this one):