Backward type inference for XML queries

Although XQuery is a statically typed, functional query language for XML data, some of its features such as upward and horizontal XPath axes are typed imprecisely. The main reason is that while the XQuery data model allows us to navigate upwards and between siblings from a given XML node, the type model, e.g., regular tree types, can describe only the subtree structure of the given node. To alleviate this limitation, precise forward type inference systems for XQuery were recently proposed using an extended regular type language that can describe not only a given XML node but also its context. In this paper, as a different approach, we propose a novel backward type inference system for XQuery, based on a type language extended with logical formulas. Our backward type inference system provides an exact typing result for XPath axes and a sound typing result for XQuery expressions.

[1]  Gérard P. Huet,et al.  The Zipper , 1997, Journal of Functional Programming.

[2]  Benjamin C. Pierce,et al.  XDuce: A statically typed XML processing language , 2003, TOIT.

[3]  John Doner,et al.  Tree Acceptors and Some of Their Applications , 1970, J. Comput. Syst. Sci..

[4]  Derick Wood,et al.  One-Unambiguous Regular Languages , 1998, Inf. Comput..

[5]  Naoki Kobayashi Model-checking higher-order functions , 2009, PPDP '09.

[6]  Giuseppe Castagna,et al.  Semantic subtyping: Dealing set-theoretically with function, union, intersection, and negation types , 2008, JACM.

[7]  Nils Gesbert,et al.  XQuery and static typing: tackling the problem of backward axes , 2015, ICFP.

[8]  Helmut Seidl,et al.  XML type checking with macro tree transducers , 2005, PODS.

[9]  PottierFrançois Simplifying subtyping constraints , 1996 .

[10]  Joost Engelfriet,et al.  The time complexity of typechecking tree-walking tree transducers , 2009, Acta Informatica.

[11]  Murali Mani,et al.  Taxonomy of XML schema languages using formal language theory , 2005, TOIT.

[12]  Nils Gesbert,et al.  Efficiently Deciding μ-Calculus with Converse over Finite Trees , 2015, ACM Trans. Comput. Log..

[13]  Giuseppe Castagna,et al.  A Core Calculus for XQuery 3.0 - Combining Navigational and Pattern Matching Approaches , 2015, ESOP.

[14]  Michael Benedikt,et al.  Higher­Order Functions and Structured Datatypes , 2012, WebDB.

[15]  Scott Boag,et al.  XQuery 1.0 : An XML Query Language , 2007 .

[16]  Anders Møller,et al.  The Design Space of Type Checkers for XML Transformation Languages , 2004, ICDT.

[17]  Noga Alon,et al.  XML with data values: typechecking revisited , 2003, J. Comput. Syst. Sci..

[18]  Akihiko Tozawa Towards static type checking for XSLT , 2001, DocEng '01.

[19]  WoodDerick,et al.  One-unambiguous regular languages , 1998 .

[20]  Giuseppe Castagna,et al.  CDuce: an XML-centric general-purpose language , 2003, ICFP '03.

[21]  Benjamin C. Pierce,et al.  Regular expression types for XML , 2005, ACM Trans. Program. Lang. Syst..

[22]  Dan Suciu,et al.  Typechecking for XML transformers , 2000, PODS '00.

[23]  James Clark,et al.  XSL Transformations (XSLT) Version 1.0 , 1999 .

[24]  Tim Furche,et al.  XPath: Looking Forward , 2002, EDBT Workshops.

[25]  James Cheney,et al.  Semantics, Types and Effects for XML Updates , 2009, DBPL.

[26]  Pierre Genevès,et al.  Deciding XPath containment with MSO , 2007, Data Knowl. Eng..

[27]  Helmut Seidl,et al.  Exact XML Type Checking in Polynomial Time , 2007, ICDT.

[28]  T. Mansour,et al.  Combinatorics of Compositions and Words , 2009 .

[29]  Giuseppe Castagna,et al.  Optimizing XML querying using type-based document projection , 2013, TODS.

[30]  James Cheney,et al.  Destabilizers and independence of XML updates , 2010, Proc. VLDB Endow..

[31]  Steven J. DeRose,et al.  XML Path Language (XPath) Version 1.0 , 1999 .

[32]  Alain Frisch,et al.  Towards Practical Typechecking for Macro Tree Transducers , 2007, DBPL.

[33]  Naoki Kobayashi,et al.  Higher-order multi-parameter tree transducers and recursion schemes for program verification , 2010, POPL '10.

[34]  François Pottier,et al.  Simplifying Subtyping Constraints: A Theory , 2001, Inf. Comput..

[35]  Dario Colazzo,et al.  Precision and complexity of XQuery type inference , 2011, PPDP.

[36]  Nils Gesbert,et al.  Parametric polymorphism and semantic subtyping: the logical connection , 2011, ICFP.

[37]  Luca Cardelli,et al.  Subtyping recursive types , 1993 .

[38]  Dan Olteanu,et al.  Forward node-selecting queries over trees , 2007, TODS.

[39]  Helmut Seidl,et al.  Macro forest transducers , 2004, Inf. Process. Lett..

[40]  Pierre Genevès,et al.  Efficient static analysis of XML paths and types , 2007, PLDI '07.

[41]  Joost Engelfriet,et al.  Macro Tree Transducers , 1985, J. Comput. Syst. Sci..

[42]  Akihiko Tozawa XML Type Checking Using High-Level Tree Transducer , 2006, FLOPS.

[43]  Sebastian Maneth,et al.  XQuery streaming by Forest Transducers , 2013, 2014 IEEE 30th International Conference on Data Engineering.

[44]  Michael I. Schwartzbach,et al.  Static validation of XSL transformations , 2005, TOPL.

[45]  Alfred V. Aho,et al.  Translations on a Context-Free Grammar , 1971, Inf. Control..