do not use foo < 0 if foo can be symbolic
Merge pull request #8119 from smichr/bound2

do not use < if arg might be symbolic
modify assumptions

It is currently possible to create a meaningless set of assumptions:

    neither
        Dummy(zero=True, finite=False) nor
        Dummy(zero=True, infinite=True)
    raise an error.

    If we assume finite == !infinite in assumptions, we
    create an alias: finite=False is the same as infinite=True
    and vice versa. We don't want to do that. What we want is
    behavior like integer and noninteger:

    Dummy(integer=0) is not the same thing as Dummy(noninteger=1).
    A noninteger is commutative, complex, hermitian, noninteger,
    nonzero, and real while integer=0 is only commutative -- nothing
    else is known about it (other than that it is not 0).

    /!\ In general, it is much easier to comprehend what one means
    by using only true attributes to desccribe it. If something is
    not zero but still complex, say nonzero=True instead of zero=False.

    So assumptions.py has been modified to make the following true:

    ```
    finite   : 0 < abs(x) < oo
    finite  : 0 <= abs(x) < oo
    infinite : abs(x) == oo
    ```

    The same is also true for zero and nonzero. If nonzero is True you
    are talking about a complex number that is not zero. But if zero is
    False you are only talking about a commutative object that is not
    zero.

    In addition, we now use is_infinite = True not is_finite = False
    in the few places where this is defined. The former is an affirmation
    of what the object *is* not an indication of what it is not.

In addition, nonzero is also made to be complex and algebraic,
transcendental and irrational numbers are now marked as finite.
remove redundant attributes of numbers
remove redundant clause testing for NaN after finite test
modify Mul._eval_is_* routines
modify use of assumptions with symbols
update tests for changed attributes on integer and nan
modify Add._eval_is_* routines
modify wester test
add tests and modify existing tests
let _unevaluated_Add collect numbers, too
do not call self.is_* from _eval_is_* routines

I am not sure about the ramifications but my hunch is that
if, when trying to resolve fact foo, an _eval_is routines
calls self.is_bah -- and bah is not actually a prerequisite
of foo -- that this might interrupt the resolution of fact
foo. At least, using the _eval method will result in a faster
resolution of the fact without running through prerequisites
of the fact. But again...I'm not even sure that's a good idea.
I'm not sure how much of the burden of knowing what to call
should be the responsibility of the _eval_is routines and how
much should be handled by the assumption machinery. (I know the
machinery will handle prerequisites, but it is not clear how
to effectively write the _eval_is routines so they are not
working too hard.
do not add tests that are not prereq

    It is important not to add prerequisites to a result that are
    not consistent with the assumption rules. This can lead to facts
    being missed, something that will be intermittent in nature depending
    on the order in which the assumptions are traversed to resolve the fact.

    for example:

    >>> from sympy.core.assumptions import _assume_rules as R
    >>> print filldedent(R.prereq['imaginary'])

    set(['real', 'prime', 'irrational', 'antihermitian', 'nonpositive',
    'composite', 'zero', 'integer', 'odd', 'even', 'commutative',
    'positive', 'noninteger', 'negative', 'nonnegative', 'complex',
    'rational'])

    Having an answer to nonzero is not a prerequisite of knowing the
    `imaginary` fact. The same is true for antihermitian.

    >>> print filldedent(R.prereq['antihermitian'])

    set(['imaginary'])
flatten Add at start of relevant _eval_is_* routines

also make sure Expr._eval_is routines don't use self.is_
or else you will get a recursion error with the added test
involving f(0).
8081 negative ints (all but -1) are composite
randomize traversal of facts

This may help to expose errors in _eval_is routines that apply
constraints to the solution that are not in the prerequisites for
a fact.
transcendental: irrational & !algebraic

This is in accordance with the definition at wolfram alpha
introduce and test finite_real assumption

TODO: rename real to extended_real (or similar)
and name finite_real to real.