Automatic Generation of Optimized Process Models from Declarative Specifications