A type-theoretic framework for software component synthesis