1 Diagnosis of Discrete Event Systems Using Satisfiability Algorithms: A theoretical and empirical study Alban Grastien, Anbu Anbulagan Abstract—We propose a novel algorithm for the diagnosis of systems modelled as discrete event systems. Instead of computing all paths of the model that are consistent with the observations, we use a two-level approach: at the first level diagnostic questions are generated in the form does there exist a path from a given subset that is consistent with the observations?, whilst at the second level a SAT solver is used to answer the questions. Our experiments show that this approach, implemented in SAT, can solve problems that we could not solve with other techniques. Index Terms—Diagnosis, Discrete Event Systems, Propositional Satisfiability I. I NTRODUCTION Because of imperfect design, bad conception, improper use or simply natural ageing or uncontrollability of the environ- ment, any system is prone to malfunction. These malfunctions or faults may reduce the quality of service of the system and be harmful for the system (through the cascading effect) or to the users. Monitoring the observations generated by sensors on the system or by the system itself is necessary to determine the occurrence of faults (detection), to determine which faults took place (identification), and to determine where faults took place (isolation). This is the task of diagnosis [1]. We are interested here in model-based diagnosis (MBD) where the diagnostic task is performed using only a description of the system’s behaviour (the model); furthermore, we assume the model is a finite-state discrete event system (DES, [2]), i.e., a model for dynamic systems where the state evolution is discrete and its domain is finite. The traditional approach to diagnosis of DES is to compute all model paths consistent with the observations, and to extract the diagnosis information (such as, which faulty events occurred) from these paths. This approach is very expensive for large systems as the size of the model is exponential in the number of components; most techniques developed in the last 15 years aim at reducing this complexity but the class of systems they can diagnose is still very limited. In general however, we are not interested in all possible system behaviours but in more specific information. Diagnosis of DES can be seen as finding specific paths on the system model. Similar path-finding problems include classical AI planning, model-checking and diagnosability.A Alban Grastien is with the Optimisation Research Group of NICTA, 7 London Circuit, Canberra ACT 2601, Australia, and the AI Group of the Australian National University (email: alban.grastien@nicta.com.au). Anbu Anbulagan is with the Australian National University, Canberra ACT 2600, Australia (email: a.anbulagan@anu.edu.au). successful approach that has been developed for these three problems is the use of propositional satisfiability (SAT) al- gorithms [3]–[5]. Given a propositional formula defined on a set of Boolean variables, SAT is the problem of finding an assignment to the variables that makes the formula logically true, or determining that no such assignment exists. The path- finding problem is transformed into a propositional formula that is satisfiable if and only if a path exists; a SAT solver is then run to find a solution to this problem, if any; finally the path is trivially reconstructed from the satisfying assignment. We propose a similar approach for the diagnosis of DES. Our approach does not search for all the paths consistent with the observations; instead we use a two-level approach that looks for specific paths: 1) At the first level the diagnostic problem is transformed into simple problems that we call diagnostic questions. Each question is a decision problem of the following form: Does the DES allow for a path generating the observations and satisfying a certain property? 2) Each diagnostic question is answered at the second level. If the answer is yes, a path is returned that supports the positive answer. We implemented this level with SAT. To illustrate the feasability of this method, we solve a sim- plified diagnostic problem whose purpose is to find an ex- planation that minimizes the number of fault occurrences; the relevance of such a problem is discussed in the next section, and the more general case is discussed in the Extension section. This allows us to concentrate on the second level of this approach, i.e., the translation of the diagnostic question into a SAT problem and its resolution. This two-level approach allows us to use efficient SAT algorithms to solve hard diagnostic problems. Using this approach we can generate the miniminal-cardinality diagnosis and detect the occurrence of specific events. We make the following contributions: 1) We define a formal framework for a two-level approach to diagnosis of DES based on diagnostic questions. 2) We show how diagnostic questions can be translated into SAT problems (illustrated for the class of questions required for our simplified diagnostic problems). 3) We provide experimental results showing that this ap- proach is able to compute the preferred diagnosis for a class of hard diagnostic problems. 4) We discuss the resolution of more general diagnostic problems and SAT-related improvements.