Rapidity-gap separation and study of single-diffraction dissociation in pp collisions at 12 and 24 GeV/c☆