def test_de_morgans_law_negated_key_with_gate(): assert de_morgans_law( "content:hi and not (user or author or creator):someone")
def test_de_morgans_law_negated_word_with_gate(): assert de_morgans_law( "user:someone and not type:(nominate or qualify)" ) == "user:someone and type:(not nominate and not qualify)"
def test_de_morgans_law_negated_word(): assert de_morgans_law("not type:(nominate or qualify)" ) == "type:(not nominate and not qualify)"
def test_de_morgans_law_elimination(): assert de_morgans_law("not not (A and B)") == "(A and B)"
def test_de_morgans_law_complex(): assert de_morgans_law( "x not (D and not (A or B and C) or E and F)y" ) == "x ((not D or (A or B and C)) and (not E or not F))y"
def test_de_morgans_law(): assert de_morgans_law( "not (A or B and C)") == "(not A and (not B or not C))"