Formal Methodology for Compositional Cross-Layer Optimization -- From Service