Learning Temporal Properties is NP-hard

Benjamin Bordais,Daniel Neider,Rajarshi Roy
2023-12-19
Abstract:We investigate the complexity of LTL learning, which consists in deciding given a finite set of positive ultimately periodic words, a finite set of negative ultimately periodic words, and a bound B given in unary, if there is an LTL-formula of size less than or equal to B that all positive words satisfy and that all negative violate. We prove that this decision problem is NP-hard. We then use this result to show that CTL learning is also NP-hard. CTL learning is similar to LTL learning except that words are replaced by finite Kripke structures and we look for the existence of CTL formulae.
Logic in Computer Science
What problem does this paper attempt to address?
### The problems the paper attempts to solve This paper aims to explore and prove the computational complexity issues of learning temporal properties. Specifically, it investigates whether it is NP - hard to automatically learn Linear Temporal Logic (LTL) and Computation Tree Logic (CTL) formulas given positive and negative examples. #### Problem background Temporal logics are one of the most popular specification languages for describing the temporal behavior of computing systems. These logics were initially introduced in the context of program verification and are now widely used in fields such as reinforcement learning, motion planning, formal verification, reactive synthesis, and process mining. However, most applications still rely on manually writing temporal logic specifications based on human intuition, which is an inefficient and error - prone process. Therefore, recent research has focused on automatically learning temporal logic formulas based on the behavioral observations of the system. #### Research motivation Although some efficient algorithms have been developed in practical applications to learn temporal logic formulas from observational data, there has been relatively little theoretical analysis of these problems, especially in terms of computational complexity. The only previous significant research was done by Fijalkow and Lagarde, who proved that learning certain fragments of LTL (i.e., subclasses of LTL with a restricted set of temporal operators) from finite executions is NP - complete. #### Main contributions This paper fills this gap by studying in detail the computational complexity of learning temporal properties. The authors consider two main problems: 1. **LTL learning problem**: Given a set of positive examples \(P\) and negative examples \(N\), and a desired maximum formula size \(B\), does there exist an LTL formula \(\phi\) with a size not exceeding \(B\) such that all positive examples satisfy \(\phi\), while all negative examples do not satisfy \(\phi\). 2. **CTL learning problem**: Similarly, given a set of positive and negative examples, and a desired maximum formula size \(B\), does there exist a CTL formula \(\phi\) with a size not exceeding \(B\) such that all positive example models satisfy \(\phi\), while all negative example models do not satisfy \(\phi\). The authors prove that both of these problems are NP - hard and that they are both in NP. Specifically, the authors prove the NP - hardness of the LTL learning problem by reducing the SAT problem to it, and further point out that the NP - hardness of the CTL learning problem can be directly obtained from the reduction of the LTL learning problem. #### Conclusions The main conclusions of this paper are: - The problems of learning LTL formulas and CTL formulas are both NP - hard. - These results indicate that automatically learning temporal logic formulas is a computationally very difficult problem and requires more in - depth research and more efficient algorithm design. Through these conclusions, this paper provides an important theoretical basis for the learning of temporal logics and reveals its inherent computational complexity challenges.