@dispatch.multimethod<EOL>def infer_type(expr, scope=None):
_ = expr, scope<EOL>raise NotImplementedError()<EOL>
Determine the return type of 'expr'.

    If 'expr' is evaluated with solve, what will be the type of the result?

    This employes two strategies to determine the types:
    1) Some expression types have a return signature that never changes. For
    example, intersection (AND) or unions (OR) always return a boolean.
    2) For types that are dependent on values (such as variables or user
    functions), IReflective.reflect is run on the 'scope' argument.

    Arguments:
        expr: The expression or query to infer return type of.
        scope (OPTIONAL): An instance of ScopeStack.

    Returns:
        A type, if known. On failure or in undecidable cases, returns AnyType.