skip to main content
article

Efficient static analysis of XML paths and types

Published:10 June 2007Publication History
Skip Abstract Section

Abstract

We present an algorithm to solve XPath decision problems under regular tree type constraints and show its use to statically type-check XPath queries. To this end, we prove the decidability of a logic with converse for finite ordered trees whose time complexity is a simple exponential of the size of a formula. The logic corresponds to the alternation free modal μ-calculus without greatest fixpoint, restricted to finite trees, and where formulas are cycle-free.

Our proof method is based on two auxiliary results. First, XML regular tree types and XPath expressions have a linear translation to cycle-free formulas. Second, the least and greatest fixpoints are equivalent for finite trees, hence the logic is closed under negation.

Building on these results, we describe a practical, effective system for solving the satisfiability of a formula. The system has been experimented with some decision problems such as XPath emptiness, containment, overlap, and coverage, with or without type constraints. The benefit of the approach is that our system can be effectively used in static analyzers for programming languages manipulating both XPath expressions and XML type annotations (as input and output types).

References

  1. L. Afanasiev, P. Blackburn, I. Dimitriou, B. Gaiffe, E. Goris, M. Marx, and M. de Rijke. PDL for ordered trees. Journal of Applied Non-Classical Logics, 15(2):115--135, 2005.Google ScholarGoogle ScholarCross RefCross Ref
  2. P. Barceló and L. Libkin. Temporal logics over unranked trees. In LICS '05: Proceedings of the 20th Annual IEEE Symposium on Logic in Computer Science, pages 31--40, New York, NY, USA, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. M. Benedikt, W. Fan, and F. Geerts. XPath satisfiability in the presence of DTDs. In PODS '05: Proceedings of the twenty-fourth ACM Symposium on Principles of Database Systems, pages 25--36, New York, NY, USA, 2005. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. V. Benzaken, G. Castagna, and A. Frisch. CDuce: An XML-centric general-purpose language. In ICFP '03: Proceedings of the Eighth ACM SIGPLAN International Conference on Functional Programming, pages 51--63, New York, NY, USA, 2003. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. E. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Trans. on Computers, 35(8):677--691, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. J. Clark and S. DeRose. XML path language (XPath) version 1.0, W3C recommendation, November 1999. http://www.w3.org/TR/1999/REC-xpath-19991116.Google ScholarGoogle Scholar
  7. D. Colazzo, G. Ghelli, P. Manghi, and C. Sartiani. Static analysis for path correctness of XML queries. J. Funct. Program., 16(4-5):621--661, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. S. Dal Zilio, D. Lugiez, and C. Meyssonnier. A logic you can count on. In POPL '04: Proceedings of the 31st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 135--146, New York, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Doner. Tree acceptors and some of their applications. Journal of Computer and System Sciences, 4:406--451, 1970.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. J. Edmund M. Clarke, O. Grumberg, and D. A. Peled. Model checking. MIT Press, Cambridge, MA, USA, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. E. A. Emerson and C. S. Jutla. Tree automata, μ-calculus and determinacy. In Proceedings of the 32nd annual Symposium on Foundations of Computer Science, pages 368--377, Los Alamitos, CA, USA, 1991. IEEE Computer Society Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. W. Fan, C.-Y. Chan, and Garofalakis. Secure XML querying with security views. In SIGMOD '04: Proceedings of the 2004 ACM SIGMOD International Conference on Management of Data, pages 587--598, New York, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. V. Gapeyev and B.C. Pierce. Regular object types. In European Conference on Object-Oriented Programming (ECOOP), Darmstadt, Germany, 2003. A preliminary version was presented at FOOL '03.Google ScholarGoogle ScholarCross RefCross Ref
  14. P. Genevès and N. Layaïda. A system for the static analysis of XPath. ACM Trans. Inf. Syst., 24(4):475--502, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. P. Genevès and N. Layaïda. Deciding XPath containement with MSO. Data & Knowledge Engineering, to appear, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. P. Genevès, N. Layaïda, and A. Schmitt. A satisfiability solver for XML and XPath, June 2006. http://wam.inrialpes.fr/xml.Google ScholarGoogle Scholar
  17. P. Genevès and J.-Y. Vion-Dury. Logic-based XPath optimization. In DocEng '04: Proceedings of the 2004 ACM Symposium on Document Engineering, pages 211--219, NY, USA, 2004. ACM Press. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. E. Grädel, W. Thomas, and T. Wilke, editors. Automata logics, and infinite games: a guide to current research. Springer-Verlag, New York, NY, USA, 2002.Google ScholarGoogle Scholar
  19. H. Hosoya, J. Vouillon, and B. C. Pierce. Regular expression types for XML. ACM Trans. Program. Lang. Syst., 27(1):46--90, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. G. P. Huet. The zipper. J. Funct. Program., 7(5):549--554, 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. N. Klarlund, A. Møller, and M. I. Schwartzbach. MONA 1.4, January 2001. http://www.brics.dk/mona/.Google ScholarGoogle Scholar
  22. D. Kozen. Results on the propositional μ-calculus. Theoretical Computer Science, 27:333--354, 1983.Google ScholarGoogle ScholarCross RefCross Ref
  23. M. Y. Levin and B. C. Pierce. Type-based optimization for regular patterns. In DBPL '05: Proceedings of the 10th International Symposium on Database Programming Languages, volume 3774 of LNCS, London, UK, August 2005. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. G. Miklau and D. Suciu. Containment and equivalence for a fragment of XPath. Journal of the ACM, 51(1):2--45, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. A. Møller and M. I. Schwartzbach. The design space of type checkers for XML transformation languages. In Proc. Tenth International Conference on Database Theory, ICDT '05, volume 3363 of LNCS, pages 17--36. Springer-Verlag, January 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. M. Murata, D. Lee, M. Mani, and K. Kawaguchi. Taxonomy of XML schema languages using formal language theory. ACM Transactions on Internet Technology, 5(4):660--704, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. G. Pan, U. Sattler, and M. Y. Vardi. BDD-based decision procedures for the modal logic K. Journal of Applied Non-classical Logics, 16(1-2):169--208, 2006.Google ScholarGoogle Scholar
  28. T. Schwentick. XPath query containment. SIGMOD Record, 33(1):101--109, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Y. Tanabe, K. Takahashi, M. Yamamoto, A. Tozawa, and M. Hagiya. A decision procedure for the alternation-free two-way modal μcalculus. In In TABLEAUX 2005, volume 3702 of LNCS, pages 277--291, London, UK, September 2005. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. A. Tozawa. On binary tree logic for XML and its satisfiability test. In PPL '04: Informal Proceedings of the Sixth JSSST Workshop on Programming and Programming Languages, 2004.Google ScholarGoogle Scholar
  31. M. Y. Vardi. Reasoning about the past with two-way automata. In ICALP '98: Proceedings of the 25th International Colloquium on Automata, Languages and Programming, pages 628--641, London, UK, 1998. Springer-Verlag. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Efficient static analysis of XML paths and types

        Recommendations

        Comments

        Login options

        Check if you have access through your login credentials or your institution to get full access on this article.

        Sign in

        Full Access

        • Published in

          cover image ACM SIGPLAN Notices
          ACM SIGPLAN Notices  Volume 42, Issue 6
          Proceedings of the 2007 PLDI conference
          June 2007
          491 pages
          ISSN:0362-1340
          EISSN:1558-1160
          DOI:10.1145/1273442
          Issue’s Table of Contents
          • cover image ACM Conferences
            PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation
            June 2007
            508 pages
            ISBN:9781595936332
            DOI:10.1145/1250734

          Copyright © 2007 ACM

          Publisher

          Association for Computing Machinery

          New York, NY, United States

          Publication History

          • Published: 10 June 2007

          Check for updates

          Qualifiers

          • article

        PDF Format

        View or Download as a PDF file.

        PDF

        eReader

        View online with eReader.

        eReader
        About Cookies On This Site

        We use cookies to ensure that we give you the best experience on our website.

        Learn more

        Got it!