TeLEx: learning signal temporal logic from positive examples using tightness metric


We propose a novel passive learning approach, TeLex, to infer signal temporal logic (STL) formulas that characterize the behavior of a dynamical system using only observed signal traces of the system. First, we present a template-driven learning approach that requires two inputs: a set of observed traces and a template STL formula. The unknown parameters in the template can include time-bounds of the temporal operators, as well as the thresholds in the inequality predicates. TeLEx finds the value of the unknown parameters such that the synthesized STL property is satisfied by all the provided traces and it is tight. This requirement of tightness is essential to generating interesting properties when only positive examples are provided and there is no option to actively query the dynamical system to discover the boundaries of legal behavior. We propose a novel quantitative semantics for satisfaction of STL properties which enables TeLEx to learn tight STL properties without multidimensional optimization. The proposed new metric is also smooth. This is critical to enable the use of gradient-based numerical optimization engines and it produces a 30x to 100x speed-up with respect to the state-of-art gradient-free optimization. Second, we present a novel technique for automatically learning the structure of the STL formula by incrementally constructing more complex formula guided by the robustness metric of subformula. We demonstrate the effectiveness of the overall approach for learning STL formulas from only positive examples on a set of synthetic and real-world benchmarks.

This is a preview of subscription content, log in to check access.

Fig. 1
Fig. 2
Fig. 3
Fig. 4
Fig. 5
Fig. 6
Fig. 7
Fig. 8


  1. 1.

  2. 2.

  3. 3.


  1. 1.

    Abbas H, Hoxha B, Fainekos G, Ueda K (2014) Robustness-guided temporal logic testing and verification for stochastic cyber-physical systems. In: IEEE 4th annual international conference on cyber technology in automation, control, and intelligent systems (CYBER). IEEE, pp 1–6

  2. 2.

    Abbas H, Winn A, Fainekos G, Julius AA (2014) Functional gradient descent method for metric temporal logic specifications. In: American control conference (ACC). IEEE, pp 2312–2317

  3. 3.

    Akazaki T (2016) Falsification of conditional safety properties for cyber-physical systems with gaussian process regression. In: International conference on runtime verification. Springer, pp 439–446

  4. 4.

    Aksaray D, Jones A, Kong Z, Schwager M, Belta C (2016) Q-learning for robust satisfaction of signal temporal logic specifications. In: IEEE 55th conference on decision and control (CDC). IEEE, pp 6565–6570

  5. 5.

    Angluin D (1988) Identifying languages from stochastic examples. Technical report, YALEU/DCS/RR-614, Yale University. Department of Computer Science

  6. 6.

    Annpureddy Y, Liu C, Fainekos G, Sankaranarayanan S (2011) S-taliro: a tool for temporal logic falsification for hybrid systems. In: International conference on tools and algorithms for the construction and analysis of systems. Springer, pp 254–257

  7. 7.

    Bartocci E, Bortolussi L, Sanguinetti G (2014) Data-driven statistical learning of temporal logic properties. In: International conference on formal modeling and analysis of timed systems. Springer, pp 23–37

  8. 8.

    Bufo S, Bartocci E, Sanguinetti G, Borelli M, Lucangelo U, Bortolussi L (2014) Temporal logic based monitoring of assisted ventilation in intensive care patients. In: Margaria T, Steffen B (eds) Leveraging applications of formal methods, verification and validation. Specialized techniques and applications. Springer, Berlin, pp 391–403

    Google Scholar 

  9. 9.

    Denis F (2001) Learning regular languages from simple positive examples. Mach Learn 44(1–2):37–66

    Article  Google Scholar 

  10. 10.

    Deshmukh JV, Majumdar R, Prabhu VS (2015) Quantifying conformance using the Skorokhod metric. In: International conference on computer aided verification. Springer, pp 234–250

  11. 11.

    Donzé A (2010) Breach, a toolbox for verification and parameter synthesis of hybrid systems. In: International conference on computer aided verification. Springer, pp 167–170

  12. 12.

    Donzé A (2013) On signal temporal logic. In: International conference on runtime verification. Springer, pp 382–383

  13. 13.

    Donzé A, Maler O (2010) Robust satisfaction of temporal logic over real-valued signals. In: International conference on formal modeling and analysis of timed systems. Springer, pp 92–106

  14. 14.

    Facchinei F, Lucidi S, Palagi L (2002) A truncated Newton algorithm for large scale box constrained optimization. SIAM J Optim 12(4):1100–1125

    MathSciNet  Article  Google Scholar 

  15. 15.

    Fainekos GE, Pappas GJ (2006) Robustness of temporal logic specifications. In: Havelund K, Núñez M, Roşu G, Wolff B (eds) Formal approaches to software testing and runtime verification. Springer, Berlin, pp 178–192

    Google Scholar 

  16. 16.

    Fu J, Topcu U (2016) Synthesis of joint control and active sensing strategies under temporal logic constraints. IEEE Trans Autom Control 61(11):3464–3476.

    MathSciNet  Article  MATH  Google Scholar 

  17. 17.

    Giuseppe B, Cristian Ioan V, Francisco PA, Hirotoshi Y, Calin B (2016) A decision tree approach to data classification using signal temporal logic. In: Hybrid systems: computation and control (HSCC), Vienna, Austria, pp 1–10

  18. 18.

    Gold EM (1967) Language identification in the limit. Inf Control 10(5):447–474

    MathSciNet  Article  Google Scholar 

  19. 19.

    Horning JJ (1969) A study of grammatical inference. Technical report, DTIC document

  20. 20.

    Hoxha B, Dokhanchi A, Fainekos G (2015) Mining parametric temporal logic properties in model based design for cyber-physical systems. arXiv preprint arXiv:1512.07956

  21. 21.

    Jakšić S, Bartocci E, Grosu R, Ničković D (2016) Quantitative monitoring of STL with edit distance. In: International conference on runtime verification. Springer, pp 201–218

  22. 22.

    Jha S, Raman V (2016) Automated synthesis of safe autonomous vehicle control under perception uncertainty. In: Rayadurgam S, Tkachuk O (eds) NASA formal methods: 8th international symposium, NFM, pp 117–132

  23. 23.

    Jha S, Raman V (2016) On optimal control of stochastic linear hybrid systems. In: Fränzle M, Markey N (eds) Formal modeling and analysis of timed systems: 14th international conference. Springer, pp 69–84.

  24. 24.

    Jha S, Seshia SA (2017) A theory of formal synthesis via inductive learning. Acta Inf.

    MathSciNet  Article  Google Scholar 

  25. 25.

    Jha S, Tiwari A, Seshia SA, Sahai T, Shankar N (2017) Telex: passive STL learning using only positive examples. In: 17th international conference on runtime verification (RV), pp 208–224

    Google Scholar 

  26. 26.

    Jin X, Donzé A, Deshmukh JV, Seshia SA (2015) Mining requirements from closed-loop control models. IEEE Trans Comput Aided Des Integr Circuits Syst 34(11):1704–1717

    Article  Google Scholar 

  27. 27.

    Kong Z, Jones A, Medina Ayala A, Aydin Gol E, Belta C (2014) Temporal logic inference for classification and prediction from data. In: Proceedings of the 17th international conference on Hybrid systems: computation and control. ACM, pp 273–282

  28. 28.

    Koshiba T, Mäkinen E, Takada Y (1997) Learning deterministic even linear languages from positive examples. Theor Comput Sci 185(1):63–79

    MathSciNet  Article  Google Scholar 

  29. 29.

    Lindemann L, Dimarogonas DV (2016) Robust control for signal temporal logic specifications using average space robustness. arXiv preprint arXiv:1607.07019

  30. 30.

    Maler O, Nickovic D (2004) Monitoring temporal properties of continuous signals. In: Lakhnech Y, Yovine S (eds) Formal techniques, modelling and analysis of timed and fault-tolerant systems. Springer, Berlin, pp 152–166

    Google Scholar 

  31. 31.

    Maler O, Nickovic D, Pnueli A (2008) Checking temporal properties of discrete, timed and continuous behaviors. In: Avron A, Dershowitz N, Rabinovich A (eds) Pillars of computer science. Springer, Berlin, pp 475–505

    Google Scholar 

  32. 32.

    Muggleton S (1996) Learning from positive data. In: International conference on inductive logic programming. Springer, pp 358–376

  33. 33.

    Muggleton S (1997) Learning from positive data. Springer, Berlin, pp 358–376

    Google Scholar 

  34. 34.

    Muggleton S, De Raedt L (1994) Inductive logic programming: theory and methods. J Log Program 19:629–679

    MathSciNet  Article  Google Scholar 

  35. 35.

    Pant VY, Abbas H, Mangharam R (2017) Smooth operator: control using the smooth robustness of temporal logic. In: CCTA, pp 1235–1240

  36. 36.

    Price K, Storn RM, Lampinen JA (2006) Differential evolution: a practical approach to global optimization. Springer, Berlin

    Google Scholar 

  37. 37.

    Raman V, Donzé A, Maasoumy M, Murray RM, Sangiovanni-Vincentelli AL, Seshia SA (2014) Model predictive control with signal temporal logic specifications. In: CDC, pp 81–87

  38. 38.

    Sadraddini S, Belta C (2015) Robust temporal logic model predictive control. In: 53rd Annual Allerton conference on communication, control, and computing (Allerton). IEEE, pp 772–779

  39. 39.

    Silvetti S, Nenzi L, Bortolussi L, Bartocci E (2017) A robust genetic algorithm for learning temporal specifications from data. CoRR abs/1711.06202.

  40. 40.

    Valiant LG (1984) A theory of the learnable. Commun ACM 27(11):1134–1142

    Article  Google Scholar 

  41. 41.

    Yang H, Hoxha B, Fainekos G (2012) Querying parametric temporal logic properties on embedded systems. In: IFIP international conference on testing software and systems. Springer, pp 136–151

  42. 42.

    Zhang B, Zuo W (2008) Learning from positive and unlabeled examples: a survey. In: International symposiums on information processing, pp 650–654

  43. 43.

    Zhu C, Byrd RH, Lu P, Nocedal J (1997) Algorithm 778: fortran subroutines for large-scale bound-constrained optimization. ACM Trans Math Softw (TOMS) 23(4):550–560

    MathSciNet  Article  Google Scholar 

Download references


This work is supported in part by US National Science Foundation (NSF) under Award Numbers CNS-1740079, CNS-1750009 and US ARL Cooperative Agreement W911NF-17-2-0196. All opinions expressed are those of the authors and not necessarily of the US NSF or ARL.

Author information



Corresponding author

Correspondence to Susmit Jha.

Rights and permissions

Reprints and Permissions

About this article

Verify currency and authenticity via CrossMark

Cite this article

Jha, S., Tiwari, A., Seshia, S.A. et al. TeLEx: learning signal temporal logic from positive examples using tightness metric. Form Methods Syst Des 54, 364–387 (2019).

Download citation


  • Signal temporal logic
  • Specification mining
  • Transparent machine learning
  • Interpretable machine learning
  • Cyber-physical system
  • Autonomous system