c++ code for pseudo-Boolean function manipulation