A hierarchical knowledge-based/analytical approach to fault-tolerant control in flexible manufacturing