Refinement-based reasoning of optimized reactive systems