I have a program where users can enter mathematica commands that can evaluate to any of the standard numeric types (complex, real, int, etc.), or to boolean values. Moreover the users can enter functions that depend on variables. (For the sake of this post let's assume the variables are all of type complex.)
I want to know if there's a mathematica command that can type-check an arbitrary string. Specifically, I'd want something like
ReturnsComplex[string, assumptions]
that would return true for "1/x + 7x^2 + Sin[x]" but false for "E^x == 5", say. Does anyone know of such a command, or a way to implement one without a huge quantity of work? (Assume that I can identify all the variables in the string and substitute in if necessary.)