check if 2-CNF formula is satisfiable.