Implementing the core synthesis algorithm.