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 = [1] ?- set(S,[],[1,2],[maximum:1], maximum(S,M). S = [1] M = 1