Repository: sympy/sympy

Issue:
BooleanTrue and Boolean False should have simplify method
If the simplify method is used on Relationals it might encounter an already-evaluated Boolean result...which will raise an error because the simplify method has not been defined for them:

```
>>> Eq(cos(x)**2+sin(x)**2, 1).simplify()
True
>>> Eq(1, 1).simplify()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'BooleanTrue' object has no attribute 'simplify'
```

Discussion:

Patch:
diff --git a/release/fabfile.py b/release/fabfile.py
index 61d3f1ceaf..07ced6eba5 100644
--- a/release/fabfile.py
+++ b/release/fabfile.py
@@ -17,7 +17,7 @@
 Even those functions that do not use vagrant must be run this way, because of
 the vagrant configuration at the bottom of this file.
 
-Any function that should be made available from the command line needs to have
+Any function that should be made avaiable from the command line needs to have
 the @task decorator.
 
 Save any files that should be reset between runs somewhere in the repos
diff --git a/sympy/core/expr.py b/sympy/core/expr.py
index d6400c1199..0daf2adb5d 100644
--- a/sympy/core/expr.py
+++ b/sympy/core/expr.py
@@ -255,9 +255,6 @@ def __ge__(self, other):
                 raise TypeError("Invalid comparison of complex %s" % me)
             if me is S.NaN:
                 raise TypeError("Invalid NaN comparison")
-        n2 = _n2(self, other)
-        if n2 is not None:
-            return _sympify(n2 >= 0)
         if self.is_real or other.is_real:
             dif = self - other
             if dif.is_nonnegative is not None and \
@@ -277,9 +274,6 @@ def __le__(self, other):
                 raise TypeError("Invalid comparison of complex %s" % me)
             if me is S.NaN:
                 raise TypeError("Invalid NaN comparison")
-        n2 = _n2(self, other)
-        if n2 is not None:
-            return _sympify(n2 <= 0)
         if self.is_real or other.is_real:
             dif = self - other
             if dif.is_nonpositive is not None and \
@@ -299,9 +293,6 @@ def __gt__(self, other):
                 raise TypeError("Invalid comparison of complex %s" % me)
             if me is S.NaN:
                 raise TypeError("Invalid NaN comparison")
-        n2 = _n2(self, other)
-        if n2 is not None:
-            return _sympify(n2 > 0)
         if self.is_real or other.is_real:
             dif = self - other
             if dif.is_positive is not None and \
@@ -321,9 +312,6 @@ def __lt__(self, other):
                 raise TypeError("Invalid comparison of complex %s" % me)
             if me is S.NaN:
                 raise TypeError("Invalid NaN comparison")
-        n2 = _n2(self, other)
-        if n2 is not None:
-            return _sympify(n2 < 0)
         if self.is_real or other.is_real:
             dif = self - other
             if dif.is_negative is not None and \
@@ -3347,20 +3335,6 @@ def doit(self, *args, **kwargs):
             return self.args[0]
 
 
-def _n2(a, b):
-    """Return (a - b).evalf(2) if it, a and b are comparable, else None.
-    This should only be used when a and b are already sympified.
-    """
-    if not all(i.is_number for i in (a, b)):
-        return
-    # /!\ if is very important (see issue 8245) not to
-    # use a re-evaluated number in the calculation of dif
-    if a.is_comparable and b.is_comparable:
-        dif = (a - b).evalf(2)
-        if dif.is_comparable:
-            return dif
-
-
 from .mul import Mul
 from .add import Add
 from .power import Pow
diff --git a/sympy/core/relational.py b/sympy/core/relational.py
index 83a1a860dc..c152ae5312 100644
--- a/sympy/core/relational.py
+++ b/sympy/core/relational.py
@@ -286,7 +286,6 @@ class Equality(Relational):
     def __new__(cls, lhs, rhs=0, **options):
         from sympy.core.add import Add
         from sympy.core.logic import fuzzy_bool
-        from sympy.core.expr import _n2
         from sympy.simplify.simplify import clear_coefficients
 
         lhs = _sympify(lhs)
@@ -327,10 +326,6 @@ def __new__(cls, lhs, rhs=0, **options):
                         return S.false
                     if z:
                         return S.true
-                # evaluate numerically if possible
-                n2 = _n2(lhs, rhs)
-                if n2 is not None:
-                    return _sympify(n2 == 0)
                 # see if the ratio evaluates
                 n, d = dif.as_numer_denom()
                 rv = None
diff --git a/sympy/core/sympify.py b/sympy/core/sympify.py
index fbe187ffd1..64f1a815c1 100644
--- a/sympy/core/sympify.py
+++ b/sympy/core/sympify.py
@@ -300,12 +300,6 @@ def sympify(a, locals=None, convert_xor=True, strict=False, rational=False,
     if strict:
         raise SympifyError(a)
 
-    try:
-        from ..tensor.array import Array
-        return Array(a.flat, a.shape)  # works with e.g. NumPy arrays
-    except AttributeError:
-        pass
-
     if iterable(a):
         try:
             return type(a)([sympify(x, locals=locals, convert_xor=convert_xor,
diff --git a/sympy/diffgeom/diffgeom.py b/sympy/diffgeom/diffgeom.py
index de372f38b1..f4ea4365ea 100644
--- a/sympy/diffgeom/diffgeom.py
+++ b/sympy/diffgeom/diffgeom.py
@@ -47,7 +47,7 @@ class Patch(Basic):
 
     On a manifold one can have many patches that do not always include the
     whole manifold. On these patches coordinate charts can be defined that
-    permit the parameterization of any point on the patch in terms of a tuple
+    permit the parametrization of any point on the patch in terms of a tuple
     of real numbers (the coordinates).
 
     This object serves as a container/parent for all coordinate system charts
diff --git a/sympy/integrals/risch.py b/sympy/integrals/risch.py
index 7d0560c46a..ed75b61794 100644
--- a/sympy/integrals/risch.py
+++ b/sympy/integrals/risch.py
@@ -160,9 +160,9 @@ class DifferentialExtension(object):
     # to have a safeguard when debugging.
     __slots__ = ('f', 'x', 'T', 'D', 'fa', 'fd', 'Tfuncs', 'backsubs', 'E_K',
         'E_args', 'L_K', 'L_args', 'cases', 'case', 't', 'd', 'newf', 'level',
-        'ts', 'dummy')
+        'ts',)
 
-    def __init__(self, f=None, x=None, handle_first='log', dummy=False, extension=None, rewrite_complex=False):
+    def __init__(self, f=None, x=None, handle_first='log', dummy=True, extension=None, rewrite_complex=False):
         """
         Tries to build a transcendental extension tower from f with respect to x.
 
@@ -217,16 +217,14 @@ def __init__(self, f=None, x=None, handle_first='log', dummy=False, extension=No
         # (e.g., we pull out a constant from an exponential)
         self.f = f
         self.x = x
-        # setting the default value 'dummy'
-        self.dummy = dummy
-        self.reset()
+        self.reset(dummy=dummy)
         exp_new_extension, log_new_extension = True, True
         if rewrite_complex:
             rewritables = {
                 (sin, cos, cot, tan, sinh, cosh, coth, tanh): exp,
                 (asin, acos, acot, atan): log,
             }
-        # rewrite the trigonometric components
+        #rewrite the trigonometric components
             for candidates, rule in rewritables.items():
                 self.newf = self.newf.rewrite(candidates, rule)
         else:
@@ -287,8 +285,8 @@ def update(seq, atoms, func):
             # has been done to guarantee that the simplest solution is
             # returned and that it would be affected be using different
             # variables. Though it is possible that this is the case
-            # one should know that it has not been done intentionally, so
-            # further improvements may be possible.
+            # one should know that it has not been done intentionally so
+            # further improvements may possible.
 
             # TODO: This probably doesn't need to be completely recomputed at
             # each pass.
@@ -330,7 +328,8 @@ def update(seq, atoms, func):
                         # without first manually rewriting it as exp(x*log(x))
                         self.newf = self.newf.xreplace({old: new})
                         self.backsubs += [(new, old)]
-                        log_new_extension = self._log_part([log(i.base)])
+                        log_new_extension = self._log_part([log(i.base)],
+                            dummy=dummy)
                         exps = update(exps, self.newf.atoms(exp), lambda i:
                             i.exp.is_rational_function(*self.T) and i.exp.has(*self.T))
                         continue
@@ -386,16 +385,16 @@ def update(seq, atoms, func):
             logs = sorted(set(logs), key=default_sort_key)
 
             if handle_first == 'exp' or not log_new_extension:
-                exp_new_extension = self._exp_part(exps)
+                exp_new_extension = self._exp_part(exps, dummy=dummy)
                 if exp_new_extension is None:
                     # reset and restart
                     self.f = self.newf
-                    self.reset()
+                    self.reset(dummy=dummy)
                     exp_new_extension = True
                     continue
 
             if handle_first == 'log' or not exp_new_extension:
-                log_new_extension = self._log_part(logs)
+                log_new_extension = self._log_part(logs, dummy=dummy)
 
         self.fa, self.fd = frac_in(self.newf, self.t)
         self._auto_attrs()
@@ -423,7 +422,7 @@ def _auto_attrs(self):
         self.d = self.D[self.level]
         self.case = self.cases[self.level]
 
-    def _exp_part(self, exps):
+    def _exp_part(self, exps, dummy=True):
         """
         Try to build an exponential extension.
 
@@ -517,7 +516,7 @@ def _exp_part(self, exps):
                 self.E_K.append(len(self.T) - 1)
                 self.D.append(darg.as_poly(self.t, expand=False)*Poly(self.t,
                     self.t, expand=False))
-                if self.dummy:
+                if dummy:
                     i = Dummy("i")
                 else:
                     i = Symbol('i')
@@ -530,7 +529,7 @@ def _exp_part(self, exps):
             return None
         return new_extension
 
-    def _log_part(self, logs):
+    def _log_part(self, logs, dummy=True):
         """
         Try to build a logarithmic extension.
 
@@ -571,7 +570,7 @@ def _log_part(self, logs):
                 self.L_K.append(len(self.T) - 1)
                 self.D.append(cancel(darg.as_expr()/arg).as_poly(self.t,
                     expand=False))
-                if self.dummy:
+                if dummy:
                     i = Dummy("i")
                 else:
                     i = Symbol('i')
@@ -596,16 +595,12 @@ def _important_attrs(self):
         return (self.fa, self.fd, self.D, self.T, self.Tfuncs,
             self.backsubs, self.E_K, self.E_args, self.L_K, self.L_args)
 
-    def __repr__(self):
-        return 'DifferentialExtension(extension=dict(fa=%s, fd=%s, D=%s))' % \
-                (self.fa, self.fd, self.D)
+    # TODO: Implement __repr__
 
     def __str__(self):
-        return "{'fa': %s, 'fd': %s, 'D': %s, 'T': %s, 'Tfuncs': %s, " \
-            "'backsubs': %s, 'E_K': %s, 'E_args': %s, 'L_K': %s, 'L_args': %s}" % \
-            (tuple(self._important_attrs[i] for i in range(10)))
+        return str(self._important_attrs)
 
-    def reset(self):
+    def reset(self, dummy=True):
         """
         Reset self to an initial state.  Used by __init__.
         """
@@ -614,7 +609,7 @@ def reset(self):
         self.D = [Poly(1, self.x)]
         self.level = -1
         self.L_K, self.E_K, self.L_args, self.E_args = [], [], [], []
-        if self.dummy:
+        if dummy:
             self.ts = numbered_symbols('t', cls=Dummy)
         else:
             # For testing
@@ -1673,8 +1668,7 @@ def risch_integrate(f, x, extension=None, handle_first='log',
     """
     f = S(f)
 
-    DE = extension or DifferentialExtension(f, x, handle_first=handle_first,
-            dummy=True, rewrite_complex=rewrite_complex)
+    DE = extension or DifferentialExtension(f, x, handle_first=handle_first, rewrite_complex=rewrite_complex)
     fa, fd = DE.fa, DE.fd
 
     result = S(0)
diff --git a/sympy/logic/boolalg.py b/sympy/logic/boolalg.py
index f9734b5bfa..a762f74d6f 100644
--- a/sympy/logic/boolalg.py
+++ b/sympy/logic/boolalg.py
@@ -86,6 +86,9 @@ class BooleanAtom(Boolean):
     is_Boolean = True
     _op_priority = 11  # higher than Expr
 
+    def simplify(self, ratio=None, measure=None):
+        return self
+
     @property
     def canonical(self):
         return self
diff --git a/sympy/physics/units/quantities.py b/sympy/physics/units/quantities.py
index ac285c7986..49db2438b6 100644
--- a/sympy/physics/units/quantities.py
+++ b/sympy/physics/units/quantities.py
@@ -7,7 +7,7 @@
 from __future__ import division
 
 from sympy.core.compatibility import string_types
-from sympy import sympify, Mul, Pow, S, Symbol, Add, AtomicExpr
+from sympy import sympify, Expr, Mul, Pow, S, Symbol, Add, AtomicExpr
 from sympy.physics.units import Dimension
 from sympy.physics.units import dimensions
 from sympy.physics.units.prefixes import Prefix


Test patch:
diff --git a/sympy/core/tests/test_relational.py b/sympy/core/tests/test_relational.py
index c38ac5bf6d..a155902c72 100644
--- a/sympy/core/tests/test_relational.py
+++ b/sympy/core/tests/test_relational.py
@@ -1,7 +1,6 @@
 from sympy.utilities.pytest import XFAIL, raises
-from sympy import (S, Symbol, symbols, nan, oo, I, pi, Float, And, Or,
-    Not, Implies, Xor, zoo, sqrt, Rational, simplify, Function, Eq,
-    log, cos, sin)
+from sympy import (S, Symbol, symbols, nan, oo, I, pi, Float, And, Or, Not,
+                   Implies, Xor, zoo, sqrt, Rational, simplify, Function)
 from sympy.core.compatibility import range
 from sympy.core.relational import (Relational, Equality, Unequality,
                                    GreaterThan, LessThan, StrictGreaterThan,
@@ -572,8 +571,6 @@ def test_issue_8245():
     assert (r >= a) == False
     assert (r <= a) == True
 
-    assert Eq(log(cos(2)**2 + sin(2)**2), 0) == True
-
 
 def test_issue_8449():
     p = Symbol('p', nonnegative=True)
diff --git a/sympy/core/tests/test_sympify.py b/sympy/core/tests/test_sympify.py
index 71e881179d..8581806213 100644
--- a/sympy/core/tests/test_sympify.py
+++ b/sympy/core/tests/test_sympify.py
@@ -4,23 +4,18 @@
 from sympy.abc import x, y
 from sympy.core.sympify import sympify, _sympify, SympifyError, kernS
 from sympy.core.decorators import _sympifyit
-from sympy.external import import_module
-from sympy.utilities.pytest import raises, XFAIL, skip
+from sympy.utilities.pytest import raises, XFAIL
 from sympy.utilities.decorator import conserve_mpmath_dps
 from sympy.geometry import Point, Line
 from sympy.functions.combinatorial.factorials import factorial, factorial2
 from sympy.abc import _clash, _clash1, _clash2
 from sympy.core.compatibility import exec_, HAS_GMPY, PY3
 from sympy.sets import FiniteSet, EmptySet
-from sympy.tensor.array.dense_ndim_array import ImmutableDenseNDimArray
 from sympy.external import import_module
 
 import mpmath
 
 
-numpy = import_module('numpy')
-
-
 def test_issue_3538():
     v = sympify("exp(x)")
     assert v == exp(x)
@@ -501,36 +496,6 @@ def test_issue_8821_highprec_from_str():
     assert Abs(sin(p)) < 1e-127
 
 
-def test_issue_10295():
-    if not numpy:
-        skip("numpy not installed.")
-
-    A = numpy.array([[1, 3, -1],
-                     [0, 1, 7]])
-    sA = S(A)
-    assert sA.shape == (2, 3)
-    for (ri, ci), val in numpy.ndenumerate(A):
-        assert sA[ri, ci] == val
-
-    B = numpy.array([-7, x, 3*y**2])
-    sB = S(B)
-    assert B[0] == -7
-    assert B[1] == x
-    assert B[2] == 3*y**2
-
-    C = numpy.arange(0, 24)
-    C.resize(2,3,4)
-    sC = S(C)
-    assert sC[0, 0, 0].is_integer
-    assert sC[0, 0, 0] == 0
-
-    a1 = numpy.array([1, 2, 3])
-    a2 = numpy.array([i for i in range(24)])
-    a2.resize(2, 4, 3)
-    assert sympify(a1) == ImmutableDenseNDimArray([1, 2, 3])
-    assert sympify(a2) == ImmutableDenseNDimArray([i for i in range(24)], (2, 4, 3))
-
-
 def test_Range():
     # Only works in Python 3 where range returns a range type
     if PY3:
diff --git a/sympy/integrals/tests/test_risch.py b/sympy/integrals/tests/test_risch.py
index 41cb6541e9..a0ad2fe2ae 100644
--- a/sympy/integrals/tests/test_risch.py
+++ b/sympy/integrals/tests/test_risch.py
@@ -405,51 +405,56 @@ def test_integer_powers():
 
 
 def test_DifferentialExtension_exp():
-    assert DifferentialExtension(exp(x) + exp(x**2), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(x**2), x, dummy=False)._important_attrs == \
         (Poly(t1 + t0, t1), Poly(1, t1), [Poly(1, x,), Poly(t0, t0),
         Poly(2*x*t1, t1)], [x, t0, t1], [Lambda(i, exp(i)),
         Lambda(i, exp(i**2))], [], [1, 2], [x, x**2], [], [])
-    assert DifferentialExtension(exp(x) + exp(2*x), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(2*x), x, dummy=False)._important_attrs == \
         (Poly(t0**2 + t0, t0), Poly(1, t0), [Poly(1, x), Poly(t0, t0)], [x, t0],
         [Lambda(i, exp(i))], [], [1], [x], [], [])
-    assert DifferentialExtension(exp(x) + exp(x/2), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(x/2), x, dummy=False)._important_attrs == \
         (Poly(t0**2 + t0, t0), Poly(1, t0), [Poly(1, x), Poly(t0/2, t0)],
         [x, t0], [Lambda(i, exp(i/2))], [], [1], [x/2], [], [])
-    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x + x**2), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x + x**2), x,
+            dummy=False)._important_attrs == \
         (Poly((1 + t0)*t1 + t0, t1), Poly(1, t1), [Poly(1, x), Poly(t0, t0),
         Poly(2*x*t1, t1)], [x, t0, t1], [Lambda(i, exp(i)),
         Lambda(i, exp(i**2))], [], [1, 2], [x, x**2], [], [])
-    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x + x**2 + 1), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x + x**2 + 1), x,
+            dummy=False)._important_attrs == \
         (Poly((1 + S.Exp1*t0)*t1 + t0, t1), Poly(1, t1), [Poly(1, x),
         Poly(t0, t0), Poly(2*x*t1, t1)], [x, t0, t1], [Lambda(i, exp(i)),
         Lambda(i, exp(i**2))], [], [1, 2], [x, x**2], [], [])
-    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x/2 + x**2), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x/2 + x**2), x,
+            dummy=False)._important_attrs == \
         (Poly((t0 + 1)*t1 + t0**2, t1), Poly(1, t1), [Poly(1, x),
         Poly(t0/2, t0), Poly(2*x*t1, t1)], [x, t0, t1],
         [Lambda(i, exp(i/2)), Lambda(i, exp(i**2))],
         [(exp(x/2), sqrt(exp(x)))], [1, 2], [x/2, x**2], [], [])
-    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x/2 + x**2 + 3), x)._important_attrs == \
+    assert DifferentialExtension(exp(x) + exp(x**2) + exp(x/2 + x**2 + 3), x,
+    dummy=False)._important_attrs == \
         (Poly((t0*exp(3) + 1)*t1 + t0**2, t1), Poly(1, t1), [Poly(1, x),
         Poly(t0/2, t0), Poly(2*x*t1, t1)], [x, t0, t1], [Lambda(i, exp(i/2)),
         Lambda(i, exp(i**2))], [(exp(x/2), sqrt(exp(x)))], [1, 2], [x/2, x**2],
         [], [])
-    assert DifferentialExtension(sqrt(exp(x)), x)._important_attrs == \
+    assert DifferentialExtension(sqrt(exp(x)), x, dummy=False)._important_attrs == \
         (Poly(t0, t0), Poly(1, t0), [Poly(1, x), Poly(t0/2, t0)], [x, t0],
         [Lambda(i, exp(i/2))], [(exp(x/2), sqrt(exp(x)))], [1], [x/2], [], [])
 
-    assert DifferentialExtension(exp(x/2), x)._important_attrs == \
+    assert DifferentialExtension(exp(x/2), x, dummy=False)._important_attrs == \
         (Poly(t0, t0), Poly(1, t0), [Poly(1, x), Poly(t0/2, t0)], [x, t0],
         [Lambda(i, exp(i/2))], [], [1], [x/2], [], [])
 
 
 def test_DifferentialExtension_log():
-    assert DifferentialExtension(log(x)*log(x + 1)*log(2*x**2 + 2*x), x)._important_attrs == \
+    assert DifferentialExtension(log(x)*log(x + 1)*log(2*x**2 + 2*x), x,
+        dummy=False)._important_attrs == \
         (Poly(t0*t1**2 + (t0*log(2) + t0**2)*t1, t1), Poly(1, t1),
         [Poly(1, x), Poly(1/x, t0),
         Poly(1/(x + 1), t1, expand=False)], [x, t0, t1],
         [Lambda(i, log(i)), Lambda(i, log(i + 1))], [], [], [],
         [1, 2], [x, x + 1])
-    assert DifferentialExtension(x**x*log(x), x)._important_attrs == \
+    assert DifferentialExtension(x**x*log(x), x, dummy=False)._important_attrs == \
         (Poly(t0*t1, t1), Poly(1, t1), [Poly(1, x), Poly(1/x, t0),
         Poly((1 + t0)*t1, t1)], [x, t0, t1], [Lambda(i, log(i)),
         Lambda(i, exp(t0*i))], [(exp(x*log(x)), x**x)], [2], [t0*x], [1], [x])
@@ -457,24 +462,26 @@ def test_DifferentialExtension_log():
 
 def test_DifferentialExtension_symlog():
     # See comment on test_risch_integrate below
-    assert DifferentialExtension(log(x**x), x)._important_attrs == \
+    assert DifferentialExtension(log(x**x), x, dummy=False)._important_attrs == \
         (Poly(t0*x, t1), Poly(1, t1), [Poly(1, x), Poly(1/x, t0), Poly((t0 +
             1)*t1, t1)], [x, t0, t1], [Lambda(i, log(i)), Lambda(i, exp(i*t0))],
             [(exp(x*log(x)), x**x)], [2], [t0*x], [1], [x])
-    assert DifferentialExtension(log(x**y), x)._important_attrs == \
+    assert DifferentialExtension(log(x**y), x, dummy=False)._important_attrs == \
         (Poly(y*t0, t0), Poly(1, t0), [Poly(1, x), Poly(1/x, t0)], [x, t0],
         [Lambda(i, log(i))], [(y*log(x), log(x**y))], [], [], [1], [x])
-    assert DifferentialExtension(log(sqrt(x)), x)._important_attrs == \
+    assert DifferentialExtension(log(sqrt(x)), x, dummy=False)._important_attrs == \
         (Poly(t0, t0), Poly(2, t0), [Poly(1, x), Poly(1/x, t0)], [x, t0],
         [Lambda(i, log(i))], [(log(x)/2, log(sqrt(x)))], [], [], [1], [x])
 
 
 def test_DifferentialExtension_handle_first():
-    assert DifferentialExtension(exp(x)*log(x), x, handle_first='log')._important_attrs == \
+    assert DifferentialExtension(exp(x)*log(x), x, handle_first='log',
+    dummy=False)._important_attrs == \
         (Poly(t0*t1, t1), Poly(1, t1), [Poly(1, x), Poly(1/x, t0),
         Poly(t1, t1)], [x, t0, t1], [Lambda(i, log(i)), Lambda(i, exp(i))],
         [], [2], [x], [1], [x])
-    assert DifferentialExtension(exp(x)*log(x), x, handle_first='exp')._important_attrs == \
+    assert DifferentialExtension(exp(x)*log(x), x, handle_first='exp',
+    dummy=False)._important_attrs == \
         (Poly(t0*t1, t1), Poly(1, t1), [Poly(1, x), Poly(t0, t0),
         Poly(1/x, t1)], [x, t0, t1], [Lambda(i, exp(i)), Lambda(i, log(i))],
         [], [1], [x], [2], [x])
@@ -482,9 +489,9 @@ def test_DifferentialExtension_handle_first():
     # This one must have the log first, regardless of what we set it to
     # (because the log is inside of the exponential: x**x == exp(x*log(x)))
     assert DifferentialExtension(-x**x*log(x)**2 + x**x - x**x/x, x,
-    handle_first='exp')._important_attrs == \
+    handle_first='exp', dummy=False)._important_attrs == \
         DifferentialExtension(-x**x*log(x)**2 + x**x - x**x/x, x,
-        handle_first='log')._important_attrs == \
+        handle_first='log', dummy=False)._important_attrs == \
         (Poly((-1 + x - x*t0**2)*t1, t1), Poly(x, t1),
             [Poly(1, x), Poly(1/x, t0), Poly((1 + t0)*t1, t1)], [x, t0, t1],
             [Lambda(i, log(i)), Lambda(i, exp(t0*i))], [(exp(x*log(x)), x**x)],
@@ -493,7 +500,7 @@ def test_DifferentialExtension_handle_first():
 
 def test_DifferentialExtension_all_attrs():
     # Test 'unimportant' attributes
-    DE = DifferentialExtension(exp(x)*log(x), x, handle_first='exp')
+    DE = DifferentialExtension(exp(x)*log(x), x, dummy=False, handle_first='exp')
     assert DE.f == exp(x)*log(x)
     assert DE.newf == t0*t1
     assert DE.x == x
@@ -544,21 +551,21 @@ def test_DifferentialExtension_extension_flag():
 
 def test_DifferentialExtension_misc():
     # Odd ends
-    assert DifferentialExtension(sin(y)*exp(x), x)._important_attrs == \
+    assert DifferentialExtension(sin(y)*exp(x), x, dummy=False)._important_attrs == \
         (Poly(sin(y)*t0, t0, domain='ZZ[sin(y)]'), Poly(1, t0, domain='ZZ'),
         [Poly(1, x, domain='ZZ'), Poly(t0, t0, domain='ZZ')], [x, t0],
         [Lambda(i, exp(i))], [], [1], [x], [], [])
     raises(NotImplementedError, lambda: DifferentialExtension(sin(x), x))
-    assert DifferentialExtension(10**x, x)._important_attrs == \
+    assert DifferentialExtension(10**x, x, dummy=False)._important_attrs == \
         (Poly(t0, t0), Poly(1, t0), [Poly(1, x), Poly(log(10)*t0, t0)], [x, t0],
         [Lambda(i, exp(i*log(10)))], [(exp(x*log(10)), 10**x)], [1], [x*log(10)],
         [], [])
-    assert DifferentialExtension(log(x) + log(x**2), x)._important_attrs in [
+    assert DifferentialExtension(log(x) + log(x**2), x, dummy=False)._important_attrs in [
         (Poly(3*t0, t0), Poly(2, t0), [Poly(1, x), Poly(2/x, t0)], [x, t0],
         [Lambda(i, log(i**2))], [], [], [], [1], [x**2]),
         (Poly(3*t0, t0), Poly(1, t0), [Poly(1, x), Poly(1/x, t0)], [x, t0],
         [Lambda(i, log(i))], [], [], [], [1], [x])]
-    assert DifferentialExtension(S.Zero, x)._important_attrs == \
+    assert DifferentialExtension(S.Zero, x, dummy=False)._important_attrs == \
         (Poly(0, x), Poly(1, x), [Poly(1, x)], [x], [], [], [], [], [], [])
 
 
@@ -566,7 +573,7 @@ def test_DifferentialExtension_Rothstein():
     # Rothstein's integral
     f = (2581284541*exp(x) + 1757211400)/(39916800*exp(3*x) +
     119750400*exp(x)**2 + 119750400*exp(x) + 39916800)*exp(1/(exp(x) + 1) - 10*x)
-    assert DifferentialExtension(f, x)._important_attrs == \
+    assert DifferentialExtension(f, x, dummy=False)._important_attrs == \
         (Poly((1757211400 + 2581284541*t0)*t1, t1), Poly(39916800 +
         119750400*t0 + 119750400*t0**2 + 39916800*t0**3, t1),
         [Poly(1, x), Poly(t0, t0), Poly(-(10 + 21*t0 + 10*t0**2)/(1 + 2*t0 +
@@ -581,7 +588,7 @@ class TestingException(Exception):
 
 
 def test_DecrementLevel():
-    DE = DifferentialExtension(x*log(exp(x) + 1), x)
+    DE = DifferentialExtension(x*log(exp(x) + 1), x, dummy=False)
     assert DE.level == -1
     assert DE.t == t1
     assert DE.d == Poly(t0/(t0 + 1), t1)
@@ -665,14 +672,3 @@ def test_xtothex():
     a = risch_integrate(x**x, x)
     assert a == NonElementaryIntegral(x**x, x)
     assert isinstance(a, NonElementaryIntegral)
-
-
-def test_DifferentialExtension_printing():
-    DE = DifferentialExtension(exp(2*x**2) + log(exp(x**2) + 1), x)
-    assert repr(DE) == "DifferentialExtension(extension=dict(fa=Poly(t1 + t0**2, t1, domain='ZZ[t0]'), " \
-        "fd=Poly(1, t1, domain='ZZ'), D=[Poly(1, x, domain='ZZ'), Poly(2*x*t0, t0, domain='ZZ[x]'), " \
-        "Poly(2*t0*x/(t0 + 1), t1, domain='ZZ(x,t0)')]))"
-    assert str(DE) == "{'fa': Poly(t1 + t0**2, t1, domain='ZZ[t0]'), 'fd': Poly(1, t1, domain='ZZ'), " \
-        "'D': [Poly(1, x, domain='ZZ'), Poly(2*x*t0, t0, domain='ZZ[x]'), Poly(2*t0*x/(t0 + 1), t1, domain='ZZ(x,t0)')], " \
-        "'T': [x, t0, t1], 'Tfuncs': [Lambda(i, exp(i**2)), Lambda(i, log(t0 + 1))], 'backsubs': [], " \
-        "'E_K': [1], 'E_args': [x**2], 'L_K': [2], 'L_args': [t0 + 1]}"
diff --git a/sympy/logic/tests/test_boolalg.py b/sympy/logic/tests/test_boolalg.py
index 72e8c17252..7a322c9585 100644
--- a/sympy/logic/tests/test_boolalg.py
+++ b/sympy/logic/tests/test_boolalg.py
@@ -675,6 +675,8 @@ def test_true_false():
         assert ITE(F, F, T) is true
         assert ITE(F, F, F) is false
 
+    assert all(i.simplify(1, 2) is i for i in (S.true, S.false))
+
 
 def test_bool_as_set():
     x = symbols('x')
diff --git a/sympy/stats/tests/test_finite_rv.py b/sympy/stats/tests/test_finite_rv.py
index 574b442947..169253386a 100644
--- a/sympy/stats/tests/test_finite_rv.py
+++ b/sympy/stats/tests/test_finite_rv.py
@@ -204,14 +204,13 @@ def test_binomial_numeric():
                 assert P(Eq(X, k)) == binomial(n, k)*p**k*(1 - p)**(n - k)
 
 
-@slow
 def test_binomial_symbolic():
-    n = 10  # Because we're using for loops, can't do symbolic n
+    n = 2  # Because we're using for loops, can't do symbolic n
     p = symbols('p', positive=True)
     X = Binomial('X', n, p)
     assert simplify(E(X)) == n*p == simplify(moment(X, 1))
     assert simplify(variance(X)) == n*p*(1 - p) == simplify(cmoment(X, 2))
-    assert cancel((skewness(X) - (1-2*p)/sqrt(n*p*(1-p)))) == 0
+    assert cancel((skewness(X) - (1 - 2*p)/sqrt(n*p*(1 - p)))) == 0
 
     # Test ability to change success/failure winnings
     H, T = symbols('H T')