Synthesis of correct and distributed adaptors for component-based systems: an automatic approach