Logic synthesis for programmable gate arrays