up previous next

Max, Min

Syntax

Max(E_1:OBJECT,...,E_n:OBJECT):OBJECT
Min(E_1:OBJECT,...,E_n:OBJECT):OBJECT

Max(L:LIST):OBJECT
Min(L:LIST):OBJECT
    

Summary

a maximum or minimum element of a sequence or list

Description

In the first form, these functions return a maximum and minimum, respectively, of E_1,...,E_n. In the second form, they return a maximum and minimum, respectively, of the objects in the list L.

example

    
Max([1,2,3]);
3
-------------------------------
Max(1,2,3);
3
-------------------------------
Min(1,2,3);
1
-------------------------------
Use R ::= Q[x,y,z];
Max(x^3z, x^2y^2); -- x^2y^2 > x^3z in the default ordering, DegRevLex
x^2y^2
-------------------------------
Min(x^3z, x^2y^2);
x^3z
-------------------------------
Use R ::= Q[x,y,z], DegLex;
Max(x^3z, x^2y^2); -- x^3z > x^2y^2 in DegLex
x^3z 
-------------------------------
Max(Ideal(x),Ideal(x^2),Ideal(x,y),Ideal(x-2,y-1));  -- ordered by inclusion
                        -- a maximal element in the list is returned
Ideal(x, y)
-------------------------------
        
    

See Also