Optimization-based design of fault-tolerant avionics