def variables(s):
result = set([])<EOL>def walk(s):<EOL><INDENT>if is_variable(s):<EOL><INDENT>result.add(s)<EOL><DEDENT>else:<EOL><INDENT>for arg in s.args:<EOL><INDENT>walk(arg)<EOL><DEDENT><DEDENT><DEDENT>walk(s)<EOL>return result<EOL>
Return a set of the variables in expression s.
    >>> ppset(variables(F(x, A, y)))
    set([x, y])
    >>> ppset(variables(F(G(x), z)))
    set([x, z])
    >>> ppset(variables(expr('F(x, x) & G(x, y) & H(y, z) & R(A, z, z)')))
    set([x, y, z])