Formal Safety Assessment via Contract-Based Design.