Formal and Adaptive Methods for Automation of Parallel Programs Construction