Theory of Computing Systems

, Volume 57, Issue 4, pp 967–1007 | Cite as

Deciding Twig-definability of Node Selecting Tree Automata

  • Timos Antonopoulos
  • Dag HovlandEmail author
  • Wim Martens
  • Frank Neven


Node selecting tree automata (NSTAs) constitute a general formalism defining unary queries over trees. Basically, a node is selected by an NSTA when it is visited in a selecting state during an accepting run. We consider twig patterns as an abstraction of XPath. Since the queries definable by NSTAs form a strict superset of twig-definable queries, we study the complexity of the problem to decide whether the query by a given NSTA is twig-definable. In particular, we obtain that the latter problem is EXPTIME-complete. In addition, we show that it is also EXPTIME-complete to decide whether the query by a given NSTA is definable by a node selecting string automaton.


Automata Twigs Complexity Definability 


  1. 1.
    Albert, J., Giammerresi, D., Wood, D.: Normal form algorithms for extended context free grammars. Theor. Comput. Sci. 267(1–2), 35–47 (2001)zbMATHCrossRefGoogle Scholar
  2. 2.
    Antonopoulos, T., Hovland, D., Martens, W., Neven, F.: Deciding twig-definability of node selecting tree automata. In: Deutsch, A. (ed.) ICDT, pp 61–73. ACM (2012)Google Scholar
  3. 3.
    Benedikt, M., Fan, W., Geerts, F.: XPath satisfiability in the presence of DTDs. J. ACM 55(2) (2008)Google Scholar
  4. 4.
    Benedikt, M., Fan, W., Kuper, G.M.: Structural properties of XPath fragments. Theor. Comput. Sci. 336(1), 3–31 (2005)zbMATHMathSciNetCrossRefGoogle Scholar
  5. 5.
    Benedikt, M., Koch, C.: XPath leashed. ACM Comput. Surv. 41(1) (2008)Google Scholar
  6. 6.
    Benedikt, M., Segoufin, L.: Regular tree languages definable in FO and in FOmod. ACM Trans. Comput. Log. 11(1) (2009)Google Scholar
  7. 7.
    Bojańczyk, M.: Tree-walking automata. In: International Conference on Language and Automata Theory and Applications (LATA), pp 1–2 (2008)Google Scholar
  8. 8.
    Bojańczyk, M., Muscholl, A., Schwentick, T., Segoufin, L.: Two-variable logic on data trees and XML reasoning. J. ACM 56(3) (2009)Google Scholar
  9. 9.
    Bojańczyk, M., Parys, P.: XPath evaluation in linear time. J. ACM. To appearGoogle Scholar
  10. 10.
    Bojańczyk, M., Segoufin, L.: Tree languages defined in first-order logic with one quantifier alternation. Logical Methods Comput. Sci. 6(4) (2010)Google Scholar
  11. 11.
    Bojańczyk, M., Walukiewicz, I.: Characterizing EF and EX tree logics. Theor. Comput. Sci. 358(2–3), 255–272 (2006)zbMATHCrossRefGoogle Scholar
  12. 12.
    Calvanese, D., Giacomo, G.D., Lenzerini, M., Vardi, M.Y.: Node selection query languages for trees. In: AAAI Conference on Artificial Intelligence (AAAI) (2010)Google Scholar
  13. 13.
    Carme, J., Niehren, J., Tommasi, M.: Querying unranked trees with stepwise tree automata. In: International Conference on Rewriting Techniques and Applications (RTA), pp. 105–118 (2004)Google Scholar
  14. 14.
    Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Löding, C., Tison, S., Tommasi, M.: Tree Automata Techniques and Applications. Available on (2007)
  15. 15.
    Consens, M.P., Milo, T.: Algebras for querying text regions. Expressive power and optimization. J. Comput. Syst. Sci. 57(3), 272–288 (1998)zbMATHMathSciNetCrossRefGoogle Scholar
  16. 16.
    Frick, M., Grohe, M., Koch, C.: Query evaluation on compressed trees (extended abstract). In: IEEE Symposium on Logic in Computer Science (LICS), pp. 188 (2003)Google Scholar
  17. 17.
    Gelade, W., Idziaszek, T., Martens, W., Neven, F.: Simplifying XML Schema: single-type approximations of regular tree languages. In: ACM Symposium on Principles of Database Systems (PODS), pp. 251–260 (2010)Google Scholar
  18. 18.
    Goris, E., Marx, M.: Looping caterpillars. In: Annual IEEE Symposium on Logic in Computer Science (LICS), pp. 51–60 (2005)Google Scholar
  19. 19.
    Gottlob, G., Koch, C.: Monadic datalog and the expressive power of languages for web information extraction. J. ACM 51(1), 74–113 (2004)MathSciNetCrossRefGoogle Scholar
  20. 20.
    Gottlob, G., Koch, C., Pichler, R.: Efficient algorithms for processing XPath queries. ACM Trans. Database Syst. 30(2), 444–491 (2005)MathSciNetCrossRefGoogle Scholar
  21. 21.
    Gottlob, G., Koch, C., Pichler, R., Segoufin, L.: The complexity of xpath query evaluation and XML typing. J. ACM 52(2), 284–335 (2005)MathSciNetCrossRefGoogle Scholar
  22. 22.
    Martens, W., Neven, F., Schwentick, T.: Complexity of decision problems for XML schemas and chain regular expressions. SIAM J. Comput. 39(4), 1486–1530 (2009)zbMATHMathSciNetCrossRefGoogle Scholar
  23. 23.
    Martens, W., Neven, F., Schwentick, T., Bex, G.J.: Expressiveness and complexity of XML Schema. ACM Trans. Database Syst. 31(3), 770–813 (2006)CrossRefGoogle Scholar
  24. 24.
    Marx, M.: Conditional XPath. ACM Trans. Database Syst. 30(4), 929–959 (2005)CrossRefGoogle Scholar
  25. 25.
    Miklau, G., Suciu, D.: Containment and equivalence for a fragment of XPath. J. ACM 51(1), 2–45 (2004)MathSciNetCrossRefGoogle Scholar
  26. 26.
    Neven, F.: Design and Analysis of Query Languages for Structured Documents. PhD thesis, Limburgs Universitair Centrum (1999)Google Scholar
  27. 27.
    Neven, F.: Automata theory for XML researchers. SIGMOD Record 31(3), 39–46 (2002)CrossRefGoogle Scholar
  28. 28.
    Neven, F.: Attribute grammars for unranked trees as a query language for structured documents. J. Comput. Syst. Sci. 70(2), 221–257 (2005)zbMATHMathSciNetCrossRefGoogle Scholar
  29. 29.
    Neven, F., den Bussche, J.V.: Expressiveness of structured document query languages based on attribute grammars. J. ACM 49(1), 56–100 (2002)MathSciNetCrossRefGoogle Scholar
  30. 30.
    Neven, F., Schwentick, T.: Expressive and efficient pattern languages for tree-structured data. In: ACM Symposium on Principles of Database Systems (PODS), pp. 145–156 (2000)Google Scholar
  31. 31.
    Neven, F., Schwentick, T.: Query automata over finite trees. Theor. Comput. Sci. 275(1-2), 633–674 (2002)zbMATHMathSciNetCrossRefGoogle Scholar
  32. 32.
    Neven, F., Schwentick, T.: On the complexity of XPath containment in the presence of disjunction, DTDs, and variables. Logical Methods Comput. Sci. 2(3) (2006)Google Scholar
  33. 33.
    Place, T., Segoufin, L.: Deciding definability in FO2(<) (or XPath) on trees. In: Annual IEEE Symposium on Logic in Computer Science (LICS), pp. 253–262 (2010)Google Scholar
  34. 34.
    Schwentick, T.: XPath query containment. SIGMOD Record 33(1), 101–109 (2004)MathSciNetCrossRefGoogle Scholar
  35. 35.
    Seidl, H.: Deciding equivalence of finite tree automata. SIAM J. Comput. 19 (3), 424–437 (1990)zbMATHMathSciNetCrossRefGoogle Scholar
  36. 36.
    ten Cate, B., Lutz, C.: The complexity of query containment in expressive fragments of XPath 2.0. J. ACM 56(6) (2009)Google Scholar
  37. 37.
    ten Cate, B., Segoufin, L.: Transitive closure logic, nested tree walking automata, and XPath. J. ACM 57(3) (2010)Google Scholar
  38. 38.
    Thomas, W.: Languages, automata, and logic. In: Rozenberg, G., Salomaa, A. (eds.) Handbook of Formal Languages, volume 3, chapter 7, Springer (1997)Google Scholar

Copyright information

© Springer Science+Business Media New York 2015

Authors and Affiliations

  • Timos Antonopoulos
    • 1
  • Dag Hovland
    • 2
    Email author
  • Wim Martens
    • 3
  • Frank Neven
    • 1
  1. 1.Hasselt University and Transnational University of LimburgHasseltBelgium
  2. 2.University of OsloOsloNorway
  3. 3.Universität BayreuthBayreuthGermany

Personalised recommendations