Theory of optical signal amplification and processing by quantum-dot semiconductor optical amplifiers