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).
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- R. E. Bryant. Graph-based algorithms for boolean function manipulation. IEEE Trans. on Computers, 35(8):677--691, 1986. Google Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- J. Doner. Tree acceptors and some of their applications. Journal of Computer and System Sciences, 4:406--451, 1970.Google Scholar
Digital Library
- J. Edmund M. Clarke, O. Grumberg, and D. A. Peled. Model checking. MIT Press, Cambridge, MA, USA, 1999. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Cross Ref
- 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 Scholar
Digital Library
- P. Genevès and N. Layaïda. Deciding XPath containement with MSO. Data & Knowledge Engineering, to appear, 2007. Google Scholar
Digital Library
- P. Genevès, N. Layaïda, and A. Schmitt. A satisfiability solver for XML and XPath, June 2006. http://wam.inrialpes.fr/xml.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- H. Hosoya, J. Vouillon, and B. C. Pierce. Regular expression types for XML. ACM Trans. Program. Lang. Syst., 27(1):46--90, 2005. Google Scholar
Digital Library
- G. P. Huet. The zipper. J. Funct. Program., 7(5):549--554, 1997. Google Scholar
Digital Library
- N. Klarlund, A. Møller, and M. I. Schwartzbach. MONA 1.4, January 2001. http://www.brics.dk/mona/.Google Scholar
- D. Kozen. Results on the propositional μ-calculus. Theoretical Computer Science, 27:333--354, 1983.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- G. Miklau and D. Suciu. Containment and equivalence for a fragment of XPath. Journal of the ACM, 51(1):2--45, 2004. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- T. Schwentick. XPath query containment. SIGMOD Record, 33(1):101--109, 2004. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
- 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 Scholar
Digital Library
Index Terms
Efficient static analysis of XML paths and types
Recommendations
Efficient static analysis of XML paths and types
PLDI '07: Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe 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 ...
Type checking and inference for polymorphic and existential types
CATS '09: Proceedings of the Fifteenth Australasian Symposium on Computing: The Australasian Theory - Volume 94This paper proves undecidability of type checking and type inference problems in some variants of typed lambda calculi with polymorphic and existential types. First, type inference in the domain-free polymorphic lambda calculus is proved to be ...
Decidability of Downward XPath
We investigate the satisfiability problem for downward-XPath, the fragment of XPath that includes the child and descendant axes, and tests for (in)equality of attributes’ values. We prove that this problem is decidable, EXPTIME-complete. These bounds ...







Comments