Repository: sympy/sympy

Issue:
solveset and Piecewise give wrong result
Please consider this:
```
from sympy.abc import x
from sympy import Piecewise
from sympy import Intersection
from sympy import solveset
from sympy import S

g = Piecewise( (1, x > 10), (0, x <= 10) )

#prints 0 as expected
print g.subs(x, 10)

# prints 1 as expected
print g.subs(x, 11)

# should print sth like Interval.open(10, infty)
print solveset(g > 0 , x, S.Reals)
```
The result is EmptySet for me (python 2.7.16 and sympy 1.6.1)

Discussion:

Patch:
diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
index 0db59087a4..e6d1e30a08 100644
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -969,6 +969,10 @@ def _solveset(f, symbol, domain, _check=False):
     given symbol."""
     # _check controls whether the answer is checked or not
     from sympy.simplify.simplify import signsimp
+    from sympy.logic.boolalg import BooleanTrue
+
+    if isinstance(f, BooleanTrue):
+        return domain
 
     orig_f = f
     if f.is_Mul:
@@ -1008,7 +1012,6 @@ def _solveset(f, symbol, domain, _check=False):
         a = f.args[0]
         result = solveset_real(a > 0, symbol)
     elif f.is_Piecewise:
-        result = EmptySet
         expr_set_pairs = f.as_expr_set_pairs(domain)
         for (expr, in_set) in expr_set_pairs:
             if in_set.is_Relational:


Test patch:
diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
index 673b9910a5..e612c81525 100644
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -694,6 +694,14 @@ def test_piecewise_solveset():
 
     assert solveset(Piecewise((x - 1, Ne(x, I)), (x, True)), x) == FiniteSet(1)
 
+    # issue 19718
+    g = Piecewise((1, x > 10), (0, True))
+    assert solveset(g > 0, x, S.Reals) == Interval.open(10, oo)
+
+    from sympy.logic.boolalg import BooleanTrue
+    f = BooleanTrue()
+    assert solveset(f, x, domain=Interval(-3, 10)) == Interval(-3, 10)
+
 
 def test_solveset_complex_polynomial():
     assert solveset_complex(a*x**2 + b*x + c, x) == \