KroneckerDelta is 0 or 1, thus any positive power returns itself.
Simplify Interval.as_relational().
Handle KroneckerDelta in summations and products.

Fixes issues 3481 and 3482.
tree traversals take functional inputs

These functions define how to manipulate terms

new(op, *args) -> make a new term
children(term) -> list of args
op(term) -> type of term (e.g. Add, Mul)
leaf(term) -> boolean if the term is a leaf
Add Sphinx coverage testing to the coverage_doctest.py tool

This checks if the function is imported into Sphinx. This works by checking
the source from the Sphinx viewcode extension.

This fixes issue 2896.

I still need to add verbose output, and I also need to add some error checking
if the Sphinx docs haven't been built.
Change --no-color to --no-colors

--no-color will still work because OptionParser parses substrings.
Use brown instead of white, in case people have black on white terminals
Add a summary for sphinx

Our current scores are

TOTAL DOCTEST SCORE for sympy: 34% (1984 of 5682)
TOTAL SPHINX SCORE for sympy: 22% (1293 of 5682)

which are not very good.
Tweak colors for coverage_doctest

Sphinx is now printed in gray, so it stands out less.  If the coverage is less
than 50%, the percent is printed in a brighter red.
Fix computation of how many functions are imported into Sphinx

It was computing the inverse.  The actual total is

TOTAL SPHINX SCORE for sympy: 84% (4806 of 5682)

which is not too bad.
Fix coverage_doctest calculations again

The Sphinx percentages should hopefully now be correct.  Assuming they are,
then the actual Sphinx score is 39% (2241 of 5682).

Also start to factor out the colors, so they can more easily be added in
verbose mode.
COLORS!

For coverage_doctest.py -v. If the colors are disabled, print
underlines. Otherwise, they are just too much clutter, because the colors
already delineate the headings just fine.
Use argparse in coverage_doctest

This requires Python 2.7 or higher (or 2.6 if you install it yourself), but
that's OK because this is just a development tool.

Also warn if the Sphinx docs aren't built.
Skip mpmath in coverage_doctest
Add sys.exit to coverage_doctest based on whether full coverage was achieved
Use solve only once on the system of equations.

Use solve only once on the system of equations, instead of calling
it for each equation.
Print theano symbols
print exprs and numbers - add mapping from

https://github.com/nouiz/theano_sympy
dtype testing
theano printing for matrix symbol and matmul