Function: variables
Section: conversions
C-Name: variables_vec
Prototype: DG
Help: variables({x}): all variables occurring in object x, sorted by
 decreasing priority. Returns the list of user variables if x is omitted.
Doc:
 returns the list of all variables occurring in object $x$ sorted by
 decreasing priority. If $x$ is omitted, return all polynomial variables
 known to the interpreter (this will include \kbd{x} and \kbd{y},
 which are always defined on startup); user variables which do
 not occur in \typ{POL} or \typ{SER} constructions are \emph{not} included.
 To see all user variables, use \b{uv}.
 \bprog
 ? variables([x^2 + y*z + O(t), a+x])
 %1 = [x, y, z, t, a]
 @eprog\noindent The construction
 \bprog
    if (!variables(x),...)
 @eprog\noindent can be used to test whether a variable is attached to $x$.

 If \kbd{varhigher} or \kbd{varlower} are used, it is quite possible to end up
 with different variables (having different priorities) printed in the same
 way. They will then appear multiple times in the output:
 \bprog
 ? y1 = varhigher("y"); y2 = varlower("y");
 ? variables(y*y1*y2)
 %2 = [y, y, y]
 @eprog
Variant:
 Also available is \fun{GEN}{variables_vecsmall}{GEN x} which returns
 the (sorted) variable numbers instead of the attached monomials of degree 1.
