<s> """<STR_LIT>""" <EOL> from sympy . abc import x , y <EOL> from sympy . assumptions . assume import global_assumptions , Predicate <EOL> from sympy . assumptions . ask import _extract_facts , Q <EOL> from sympy . core import symbols <EOL> from sympy . logic . boolalg import Or <EOL> from sympy . printing import pretty <EOL> from sympy . assumptions . ask import Q <EOL> from sympy . utilities . pytest import XFAIL <EOL> def test_equal ( ) : <EOL> """<STR_LIT>""" <EOL> assert Q . positive ( x ) == Q . positive ( x ) <EOL> assert Q . positive ( x ) != ~ Q . positive ( x ) <EOL> assert ~ Q . positive ( x ) == ~ Q . positive ( x ) <EOL> def test_pretty ( ) : <EOL> assert pretty ( Q . positive ( x ) ) == "<STR_LIT>" <EOL> assert pretty ( <EOL> set ( [ Q . positive , Q . integer ] ) ) == "<STR_LIT>" <EOL> def test_extract_facts ( ) : <EOL> a , b = symbols ( '<STR_LIT>' , cls = Predicate ) <EOL> assert _extract_facts ( a ( x ) , x ) == a <EOL> assert _extract_facts ( a ( x ) , y ) is None <EOL> assert _extract_facts ( ~ a ( x ) , x ) == ~ a <EOL> assert _extract_facts ( ~ a ( x ) , y ) is None <EOL> assert _extract_facts ( a ( x ) | b ( x ) , x ) == a | b <EOL> assert _extract_facts ( a ( x ) | ~ b ( x ) , x ) == a | ~ b <EOL> assert _extract_facts ( a ( x ) & b ( y ) , x ) == a <EOL> assert _extract_facts ( a ( x ) & b ( y ) , y ) == b <EOL> assert _extract_facts ( a ( x ) | b ( y ) , x ) == None <EOL> assert _extract_facts ( ~ ( a ( x ) | b ( y ) ) , x ) == ~ a <EOL> def test_global ( ) : <EOL> """<STR_LIT>""" <EOL> global_assumptions . add ( Q . is_true ( x > <NUM_LIT:0> ) ) <EOL> assert Q . is_true ( x > <NUM_LIT:0> ) in global_assumptions <EOL> global_assumptions . remove ( Q . is_true ( x > <NUM_LIT:0> ) ) <EOL> assert not Q . is_true ( x > <NUM_LIT:0> ) in global_assumptions <EOL> global_assumptions . add ( Q . is_true ( x > <NUM_LIT:0> ) , Q . is_true ( y > <NUM_LIT:0> ) ) <EOL> assert Q . is_true ( x > <NUM_LIT:0> ) in global_assumptions <EOL> assert Q . is_true ( y > <NUM_LIT:0> ) in global_assumptions <EOL> global_assumptions . clear ( ) <EOL> assert not Q . is_true ( x > <NUM_LIT:0> ) in global_assumptions <EOL> assert not Q . is_true ( y > <NUM_LIT:0> ) in global_assumptions </s>
