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
polys: Don't consider sequences in Domain.convert()
polys: Added CantSympify trait to sympify()

Mix in this trait into a class to force sympify() raise
SympifyError when sympifying its instances.
polys: Fixed Poly({}, x, y, z)
polys: Fixed trivial corner cases in factortools.py
polys: Added preliminary support for lpoly2

This is based on Mario Pernici's lpoly2 branch. Only general structure
and arithmetics of sparse polynomials were ported for now. Everything
was (at least partially) adjusted to reuse SymPy's functionality (e.g.
domains). Also naming conventions were changed (lgens == ring, ring ==
domain). Remaining code and tests will be added in later commits.
polys: Rewrote most tests/doctests using human readable syntax
polys: Rewrote densearith and densetools doctests
polys: Copied imported stuff to distributedmodules.py
polys: Moved matrix_fglm() to its own module
polys: Added context manager to configuration module
polys: Use new sparse polys in groebner module

Everything besides FGLM was rewritten. Tests were updated
and now are human readable. F5B's implementation seems
fragile and more tests are needed to verify that all branches
of this algorithm are working properly.
polys: Rewrote FGLM using new sparse polynomials
polys: Removed old sparse polynomials
polys: Removed monomial_divides() from groebnertools.py

Previously SymPy had two monomial_divides() functions with
arguments swapped. Now there is only one in monomialtools.py.
polys: Use optimized rem() method in new spare polys
polys: Ported Groebner-based LCM/GCD algorithms to new sparse polys