Improved sat generator and sat_solve pass