<s> from sympy . sets import ( ConditionSet , Intersection , FiniteSet , EmptySet , Union ) <EOL> from sympy import ( Symbol , Eq , S , Abs , sin , pi , Lambda , Interval , And , Mod ) <EOL> x = Symbol ( '<STR_LIT:x>' ) <EOL> def test_CondSet ( ) : <EOL> sin_sols_principal = ConditionSet ( x , Eq ( sin ( x ) , <NUM_LIT:0> ) , <EOL> Interval ( <NUM_LIT:0> , <NUM_LIT:2> * pi , False , True ) ) <EOL> assert pi in sin_sols_principal <EOL> assert pi / <NUM_LIT:2> not in sin_sols_principal <EOL> assert <NUM_LIT:3> * pi not in sin_sols_principal <EOL> assert <NUM_LIT:5> in ConditionSet ( x , x ** <NUM_LIT:2> > <NUM_LIT:4> , S . Reals ) <EOL> assert <NUM_LIT:1> not in ConditionSet ( x , x ** <NUM_LIT:2> > <NUM_LIT:4> , S . Reals ) <EOL> def test_CondSet_intersect ( ) : <EOL> input_conditionset = ConditionSet ( x , x ** <NUM_LIT:2> > <NUM_LIT:4> , Interval ( <NUM_LIT:1> , <NUM_LIT:4> , False , False ) ) <EOL> other_domain = Interval ( <NUM_LIT:0> , <NUM_LIT:3> , False , False ) <EOL> output_conditionset = ConditionSet ( x , x ** <NUM_LIT:2> > <NUM_LIT:4> , Interval ( <NUM_LIT:1> , <NUM_LIT:3> , False , False ) ) <EOL> assert Intersection ( input_conditionset , other_domain ) == output_conditionset <EOL> def test_issue_9849 ( ) : <EOL> assert ConditionSet ( x , Eq ( x , x ) , S . Naturals ) == S . Naturals <EOL> assert ConditionSet ( x , Eq ( Abs ( sin ( x ) ) , - <NUM_LIT:1> ) , S . Naturals ) == S . EmptySet <EOL> def test_simplified_FiniteSet_in_CondSet ( ) : <EOL> assert ConditionSet ( x , And ( x < <NUM_LIT:1> , x > - <NUM_LIT:3> ) , FiniteSet ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ) ) == FiniteSet ( <NUM_LIT:0> ) <EOL> assert ConditionSet ( x , x < <NUM_LIT:0> , FiniteSet ( <NUM_LIT:0> , <NUM_LIT:1> , <NUM_LIT:2> ) ) == EmptySet ( ) <EOL> assert ConditionSet ( x , And ( x < - <NUM_LIT:3> ) , EmptySet ( ) ) == EmptySet ( ) <EOL> y = Symbol ( '<STR_LIT:y>' ) <EOL> assert ( ConditionSet ( x , And ( x > <NUM_LIT:0> ) , FiniteSet ( - <NUM_LIT:1> , <NUM_LIT:0> , <NUM_LIT:1> , y ) ) == <EOL> Union ( FiniteSet ( <NUM_LIT:1> ) , ConditionSet ( x , And ( x > <NUM_LIT:0> ) , FiniteSet ( y ) ) ) ) <EOL> assert ( ConditionSet ( x , Eq ( Mod ( x , <NUM_LIT:3> ) , <NUM_LIT:1> ) , FiniteSet ( <NUM_LIT:1> , <NUM_LIT:4> , <NUM_LIT:2> , y ) ) == <EOL> Union ( FiniteSet ( <NUM_LIT:1> , <NUM_LIT:4> ) , ConditionSet ( x , Eq ( Mod ( x , <NUM_LIT:3> ) , <NUM_LIT:1> ) , FiniteSet ( y ) ) ) ) </s>
