first attempt at 2sat (Papadimitriou version)