Legend:
Library
Module
Module type
Parameter
Class
Class type
Polynomes of order 1, over several variables
.
A monome is a linear expression on several "variables".
We parametrize modules over some class of number (typically, Z or Q) that need to provide some operations. The 'a parameter is the type of numbers (Z.t or Q.t from the library Zarith).
Variables, in this module, are non-arithmetic terms, i.e. non-interpreted functions and predicates, that occur immediately under an arithmetic operator. For instance, in the term "f(X) + 1 + 3 × a", the variables are "f(X)" and "a", with coefficients "1" and "3".
Try to compare two monomes. They may not be comparable (ie on some points, or in some models, one will be bigger), but some pairs of monomes are: for instance, 2X + 1 < 2X + 4 is always true
dominates ~strict m1 m2 is true if m1 is always greater than m2, in any model or variable valuation. if dominates ~strict:false m1 m2 && dominates ~strict:false m2 m1, then m1 = m2. @argument strict if true, use "greater than", else "greater or equal".
Normalize the monome, which means that if some terms are rational or integer constants, they are moved to the constant part (e.g after apply X->3/4 in 2.X+1, one gets 2×3/4 +1. Normalization reduces this to 5/2).
Matching and unification aren't complete in the presence of variables occurring directly under the sum, for this would require the variable to be bound to sums (monomes) itself in the general case. Instead, such variables are only bound to atomic terms, excluding constants (ie X+1 = a+1 will bind X to a without problem, but will X+a=a+1 will fail to bind X to 1)