A Boyer-Moore Type Algorithm for Timed Pattern Matching

  • Masaki Waga
  • Takumi Akazaki
  • Ichiro Hasuo
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9884)


The timed pattern matching problem is formulated by Ulus et al. and has been actively studied since, with its evident application in monitoring real-time systems. The problem takes as input a timed word/signal and a timed pattern (specified either by a timed regular expression or by a timed automaton); and it returns the set of those intervals for which the given timed word, when restricted to the interval, matches the given pattern. We contribute a Boyer-Moore type optimization in timed pattern matching, relying on the classic Boyer-Moore string matching algorithm and its extension to (untimed) pattern matching by Watson and Watson. We assess its effect through experiments; for some problem instances our Boyer-Moore type optimization achieves speed-up by two times, indicating its potential in real-world monitoring tasks where data sets tend to be massive.


Pattern Match Regular Expression String Match Input String Naive Algorithm 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



Thanks are due to the anonymous referees for their careful reading and expert comments. The authors are supported by Grant-in-Aid No. 15KT0012, JSPS; T.A. is supported by Grant-in-Aid for JSPS Fellows.


  1. 1.
    Alur, R., Dill, D.L.: A theory of timed automata. Theor. Comput. Sci. 126(2), 183–235 (1994)MathSciNetCrossRefzbMATHGoogle Scholar
  2. 2.
    Asarin, E., Caspi, P., Maler, O.: A Kleene theorem for timed automata. In: Proceedings of the LICS 1997, pp. 160–171. IEEE Computer Society (1997)Google Scholar
  3. 3.
    Asarin, E., Caspi, P., Maler, O.: Timed regular expressions. J. ACM 49(2), 172–206 (2002)MathSciNetCrossRefzbMATHGoogle Scholar
  4. 4.
    Behrmann, G., Bouyer, P., Larsen, K.G., Pelánek, R.: Lower and upper bounds in zone-based abstractions of timed automata. STTT 8(3), 204–215 (2006)CrossRefzbMATHGoogle Scholar
  5. 5.
    Boyer, R.S., Moore, J.S.: A fast string searching algorithm. Commun. ACM 20(10), 762–772 (1977)CrossRefzbMATHGoogle Scholar
  6. 6.
    Colombo, C., Pace, G.J.: Fast-forward runtime monitoring — an industrial case study. In: Qadeer, S., Tasiran, S. (eds.) RV 2012. LNCS, vol. 7687, pp. 214–228. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  7. 7.
    Deshmukh, J.V., Donzé, A., Ghosh, S., Jin, X., Juniwal, G., Seshia, S.A.: Robust online monitoring of signal temporal logic. In: Bartocci, E., Majumdar, R. (eds.) RV 2015. LNCS, vol. 9333, pp. 55–70. Springer, Heidelberg (2015). doi: 10.1007/978-3-319-23820-3_4 CrossRefGoogle Scholar
  8. 8.
    Dokhanchi, A., Hoxha, B., Fainekos, G.: On-line monitoring for temporal logic robustness. In: Bonakdarpour, B., Smolka, S.A. (eds.) RV 2014. LNCS, vol. 8734, pp. 231–246. Springer, Heidelberg (2014)Google Scholar
  9. 9.
    Donzé, A., Ferrère, T., Maler, O.: Efficient robust monitoring for STL. In: Sharygina, N., Veith, H. (eds.) CAV 2013. LNCS, vol. 8044, pp. 264–279. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  10. 10.
    Ferrère, T., Maler, O., Ničković, D., Ulus, D.: Measuring with timed patterns. In: Kroening, D., Păsăreanu, C.S. (eds.) CAV 2015. LNCS, vol. 9207, pp. 322–337. Springer, Heidelberg (2015)CrossRefGoogle Scholar
  11. 11.
    Geist, J., Rozier, K.Y., Schumann, J.: Runtime observer pairs and bayesian network reasoners on-board FPGAs: flight-certifiable system health management for embedded systems. In: Bonakdarpour, B., Smolka, S.A. (eds.) RV 2014. LNCS, vol. 8734, pp. 215–230. Springer, Heidelberg (2014)Google Scholar
  12. 12.
    Herrmann, P.: Renaming is necessary in timed regular expressions. In: Pandu Rangan, C., Raman, V., Sarukkai, S. (eds.) FST TCS 1999. LNCS, vol. 1738, pp. 47–59. Springer, Heidelberg (1999)CrossRefGoogle Scholar
  13. 13.
    Ho, H.-M., Ouaknine, J., Worrell, J.: Online monitoring of metric temporal logic. In: Bonakdarpour, B., Smolka, S.A. (eds.) RV 2014. LNCS, vol. 8734, pp. 178–192. Springer, Heidelberg (2014)Google Scholar
  14. 14.
    Kane, A., Chowdhury, O., Datta, A., Koopman, P.: A case study on runtime monitoring of an autonomous research vehicle (ARV) system. In: Bartocci, E., Majumdar, R. (eds.) RV 2015. LNCS, vol. 9333, pp. 102–117. Springer, Heidelberg (2015). doi: 10.1007/978-3-319-23820-3_7 CrossRefGoogle Scholar
  15. 15.
    Knuth, D.E., Morris Jr., J.H., Pratt, V.R.: Fast pattern matching in strings. SIAM J. Comput. 6(2), 323–350 (1977)MathSciNetCrossRefzbMATHGoogle Scholar
  16. 16.
    Simulink User’s Guide. The MathWorks Inc., Natick (2015)Google Scholar
  17. 17.
  18. 18.
    Ouaknine, J., Worrell, J.: On the decidability and complexity of metric temporal logic over finite words. Logical Meth. Comput. Sci. 3(1), 1–27 (2007)MathSciNetCrossRefzbMATHGoogle Scholar
  19. 19.
    Pandya, P.K., Suman, P.V.: An introduction to timed automata. In: Modern Applications of Automata Theory, pp. 111–148. World Scientific (2012)Google Scholar
  20. 20.
    Ulus, D., Ferrère, T., Asarin, E., Maler, O.: Timed pattern matching. In: Legay, A., Bozga, M. (eds.) FORMATS 2014. LNCS, vol. 8711, pp. 222–236. Springer, Heidelberg (2014)Google Scholar
  21. 21.
    Ulus, D., Ferrère, T., Asarin, E., Maler, O.: Online timed pattern matching using derivatives. In: Chechik, M., Raskin, J.-F. (eds.) TACAS 2016. LNCS, vol. 9636, pp. 736–751. Springer, Heidelberg (2016). doi: 10.1007/978-3-662-49674-9_47 CrossRefGoogle Scholar
  22. 22.
    Waga, M., Akazaki, T., Hasuo, I.: Code that Accompanies “A Boyer-Moore Type Algorithm for TimedPattern Matching”.
  23. 23.
    Waga, M., Akazaki, T., Hasuo, I.: A Boyer-Moore Type Algorithm for Timed Pattern Matching (2016). CoRR, abs/1606.07207Google Scholar
  24. 24.
    Watson, B.W., Watson, R.E.: A Boyer-Moore-style algorithm for regular expression pattern matching. Sci. Comput. Program. 48(2–3), 99–117 (2003)CrossRefzbMATHGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  1. 1.University of TokyoTokyoJapan
  2. 2.JSPS Research FellowTokyoJapan

Personalised recommendations