24.2 Ag Word Comparisons

g < h
g <= h
g = h
g h

The operators <, , <= and = return true if g is strictly less, strictly greater, not greater, not less, respectively, than h. Otherwise they return false.

If g and h have a common parent group they are compared with respect to the AG series of this group. If two ag words have different depths, the one with the higher depth is less than the other one. If two ag words have the same depth but different leading exponents, the one with the smaller leading exponent is less than the other one. Otherwise the leading generator is removed in both ag words and the remaining ag words are compared.

If g and h do not have a common parent group, then the composition lengths of the parent groups are compared.

You can compare ag words with objects of other types. Field elements, unkowns, permutations and abstract words are smaller than ag words. Objects of other types, i.e., functions, lists and records are larger.

    gap> 123/47 < a;
    true
    gap> (1,2,3,4) < a;
    true
    gap> [1,2,3,4] < a;
    false
    gap> true < a;
    false
    gap> rec() < a;
    false
    gap> c < a;
    true
    gap> a*b < a*b^2;
    true 

Previous Up Top Next
Index

GAP 3.4.4
April 1997