If Max is given (as an integer or FD variable) then SetVariable is constrained to have such maximum. If Max is a free variable, then it is unified with the set's maximum as an FD variable or an integer (if it is already known).
maximum/2 can thus be used either to declare (or constrain) a maximum function or to retrieve it.
?- S`::..[1,2], maximum(S,M). ?- set(S,,[1,2],[maximum:2], maximum(S,M). M = 2 ?- S`::+[1,2], maximum(S,1). S =  ?- set(S,,[1,2],[maximum:1], maximum(S,M). S =  M = 1