code: def variables(s):
      
      result = set([])
      def walk(s):
          if is_variable(s):
              result.add(s)
          else:
              for arg in s.args:
                  walk(arg)
      walk(s)
      return result
docs: 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])