A generic technique for synthesizing bounded finite-state controllers