Abstract
Despite the extensiveness of recent investigations on static typing for XML, parametric polymorphism has rarely been treated. This well-established typing discipline can also be useful in XML processing in particular for programs involving “parametric schemas,” that is, schemas parameterized over other schemas (e.g., SOAP). The difficulty in treating polymorphism for XML lies in how to extend the “semantic” approach used in the mainstream (monomorphic) XML type systems. A naive extension would be “semantic” quantification over all substitutions for type variables. However, this approach reduces to an NEXPTIME-complete problem for which no practical algorithm is known and induces a subtyping relation that may not always match the programmer's intuition. In this article, we propose a different method that smoothly extends the semantic approach yet is algorithmically easier. The key idea here is to devise a novel and simple marking technique, where we interpret a polymorphic type as a set of values with annotations of which subparts are parameterized. We exploit this interpretation in every ingredient of our polymorphic type system such as subtyping, inference of type arguments, etc. As a result, we achieve a sensible system that directly represents a usual expected behavior of polymorphic type systems—“values of abstract types are never reconstructed”—in a reminiscence of Reynold's parametricity theory. Also, we obtain a set of practical algorithms for typechecking by local modifications to existing ones for a monomorphic system.
- Aiken, A., Kozen, D., and Wimmers, E. L. 1995. Decidability of systems of set constraints with negative constraints. Inf. Comput. 122, 1, 30--44. Google Scholar
Digital Library
- Alon, N., Milo, T., Neven, F., Suciu, D., and Vianu, V. 2001. XML with data values: Typechecking revisited. In Proceedings of Symposium on Principles of Database Systems (PODS). ACM, New York. Google Scholar
Digital Library
- Altheim, M. and McCarron, S. 2001. XHTML 1.1 — Module-based XHTML. http://www.w3.org/TR/2001/REC-xhtml11-20010531/.Google Scholar
- Appel, A. W. and MacQueen, D. B. 1991. Standard ML of New Jersey. In Proceedings of the 3rd International Symposium on Programming Language Implementation and Logic Programming. Springer-Verlag, Berlin, Germany, 1--13.Google Scholar
Cross Ref
- Ausbrooks, R., Buswell, S., Dalmas, S., Devitt, S., Diaz, A., Hunter, R., Smith, B., Soiffer, N., Sutor, R., and Watt, S. 2003. Mathematical Markup Language (MathML) Version 2.0 (Second Edition). http://www.w3.org/Math/.Google Scholar
- Benzaken, V., Castagna, G., and Frisch, A. 2003. CDuce: An XML-centric general-purpose language. In Proceedings of the International Conference on Functional Programming (ICFP). 51--63. Google Scholar
Digital Library
- Bracha, G., Odersky, M., Stoutamire, D., and Wadler, P. 1998. Making the future safe for the past: Adding genericity to the Java programming language. In Proceedings of the ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA). ACM, New York, 183--200. Google Scholar
Digital Library
- Bray, T., Paoli, J., Sperberg-McQueen, C. M., and Maler, E. 2000. Extensible markup language (XML#8482;). http://www.w3.org/XML/.Google Scholar
- Canning, P. S., Cook, W. R., Hill, W. L., Olthoff, W. G., and Mitchell, J. C. 1989. F-bounded polymorphism for object-oriented programming. In Proceedings of the Conference on Functional Programming Languages and Computer Architecture (FPCA). 273--280. Google Scholar
Digital Library
- Cardelli, L., Martini, S., Mitchell, J. C., and Scedrov, A. 1994. An extension of System F with subtyping. Inf. Comput. 109, 1--2, 4--56. Google Scholar
Digital Library
- Castagna, G. and Nguyen, K. 2008. Typed iterators for XML. In ICFP '08: Proceedings of the 13th ACM-SIGPLAN International Conference on Functional Programming. ACM, New York, 15--26. Google Scholar
Digital Library
- Castagna, G. and Pierce, B. C. 1995. Corrigendum: decidable bounded quantification. In POPL'95: Proceedings of the 22nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 408. Google Scholar
Digital Library
- Comon, H., Dauchet, M., Gilleron, R., Jacquemard, F., Lugiez, D., Tison, S., and Tommasi, M. 1999. Tree automata techniques and applications. Draft book; available electronically on http://www.grappa.univ-lille3.fr/tata.Google Scholar
- Fallside, D. and Lafon, Y. 2004. XML protocol working group. http://www.w3.org/2000/xp/Group/.Google Scholar
- Fankhauser, P., Fernández, M., Malhotra, A., Rys, M., Siméon, J., and Wadler, P. 2001. XQuery 1.0 Formal Semantics. http://www.w3.org/TR/query-semantics/.Google Scholar
- Frisch, A. 2004. Théorie, conception et réalisation d'un langage de programmation adapté à XML. Ph.D. dissertation, Universite Paris 7, Paris, France.Google Scholar
- Frisch, A. 2006. OCaml + XDuce. SIGPLAN Not. 41, 9, 192--200. Google Scholar
Digital Library
- Frisch, A., Castagna, G., and Benzaken, V. 2002. Semantic subtyping. In Proceedings of the 17th Annual IEEE Symposium on Logic Computer Science. IEEE Computer Society Press, Los Alamitos, CA, 137--146. Google Scholar
Digital Library
- Frisch, A., Castagna, G., and Benzaken, V. 2008. Semantic subtyping: dealing set-theoretically with function, union, intersection, and negation types. J. ACM 55, 4, 1--64. Google Scholar
Digital Library
- Gilleron, R., Tison, S., and Tommasi, M. 1999. Set constraints and automata. Inf. Comput. 149, 1, 1--41.Google Scholar
Cross Ref
- Harren, M., Raghavachari, M., Shmueli, O., Burke, M. G., Bordawekar, R., Pechtchanski, I., and Sarkar, V. 2005. XJ: Facilitating XML processing in Java. In Proceedings of the 14th International Conference on World Wide Web (WWW2005). ACM, New York, 278--287. Google Scholar
Digital Library
- Hosoya, H. 2003. Regular expression pattern matching—a simpler design. Tech. Rep. 1397, RIMS, Kyoto Univ., Kyoto, Japan.Google Scholar
- Hosoya, H. 2006. Regular expression filters for XML. J. Funct. Prog. 16, 6, 711--750. (Short version appeared in Proceedings of Programming Language Technologies for XML (PLAN-X), pp.13--27, 2004.) Google Scholar
Digital Library
- Hosoya, H., Frisch, A., and Castagna, G. 2005. Parametric polymorphism for XML. In Proceedings of the 32nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 50--62. Google Scholar
Digital Library
- Hosoya, H. and Murata, M. 2003. Boolean operations and inclusion test for attribute-element constraints. In Proceedings of the 8th International Conference on Implementation and Application of Automata. Lecture Notes in Computer Science, vol. 2759. Springer-Verlag, Berlin, Germany, 201--212. Google Scholar
Digital Library
- Hosoya, H. and Pierce, B. C. 2002. Regular expression pattern matching for XML. J. Funct. Prog. 13, 6, 961--1004. (Short version appeared in Proceedings of the 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 2001, pp. 67--80.) Google Scholar
Digital Library
- Hosoya, H. and Pierce, B. C. 2003. XDuce: A typed XML processing language. ACM Trans. Internet Tech. 3, 2, 117--148. (Short version appeared in Proceedings of the 3rd International Workshop on the Web and Databases (WebDB2000), Lecture Notes in Computer Science, vol. 1997. Springer-Verlag, Berlin, Germany, pp. 226--244. Google Scholar
Digital Library
- Hosoya, H., Vouillon, J., and Pierce, B. C. 2004. Regular expression types for XML. ACM Trans. Prog. Lang. Syst. 27, 1, 46--90. (Short version appeared in Proceedings of the International Conference on Functional Programming (ICFP), pp. 11--22, 2000.) Google Scholar
Digital Library
- Ishikawa, M. 2002. An XHTML + MathML + SVG Profile. http://www.w3.org/TR/XHTMLplusMathMLplusSVG/xhtml-math-svg.html.Google Scholar
- Jackson, D., Ferraiolo, J., and Fujisawa, J. 2002. Scalable Vector Graphics (SVG) 1.1 Specification. http://www.w3.org/TR/2002/CR-SVG11-20020430/.Google Scholar
- Kirkegaard, C. and Møller, A. 2006. XACT - XML transformations in Java. In Proceedings of the Programming Language Technologies for XML (PLAN-X). 87.Google Scholar
- Leroy, X., Doligez, D., Garrigue, J., Vouillon, J., and Rémy, D. 1996. The Objective Caml system. Software and documentation available on the Web, http://pauillac.inria.fr/ocaml/.Google Scholar
- Maneth, S., Perst, T., Berlea, A., and Seidl, H. 2005. XML type checking with macro tree transducers. In Proceedings of Symposium on Principles of Database Systems (PODS). ACM, New York, 283--294. Google Scholar
Digital Library
- Maneth, S., Perst, T., and Seidl, H. 2007. Exact XML type checking in polynomial time. In Proceedings of the International Conference on Database Theory (ICDT). 254--268. Google Scholar
Digital Library
- Meijer, E. and Shields, M. 1999. XMλ: A functional programming language for constructing and manipulating XML documents. Manuscript.Google Scholar
- Milner, R., Tofte, M., and Harper, R. 1990. The Definition of Standard ML. The MIT Press, Cambridge, MA. Google Scholar
Digital Library
- Milo, T., Suciu, D., and Vianu, V. 2000. Typechecking for XML transformers. In Proceedings of the 19th ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems. ACM, New York, 11--22. Google Scholar
Digital Library
- Murata, M. 2001. Extended path expressions for XML. In Proceedings of Symposium on Principles of Database Systems (PODS). ACM, New York, 126--137. Google Scholar
Digital Library
- Nottingham, M. and Sayre, R. 2005. The Atom Syndication Format (RFC 4287). ftp://ftp.rfc-editor.org/in-notes/rfc4287.txt.Google Scholar
- OASIS. 2002. DocBook. http://www.docbook.org.Google Scholar
- OAS1S. 2007. Open Document Format for Office Applications (OpenDocument). http://www.oasis-open.org/committees/office/.Google Scholar
- Peyton Jones, S. L., Hall, C. V., Hammond, K., Partain, W., and Wadler, P. 1993. The Glasgow Haskell compiler: a technical overview. In Proceedings of the UK Joint Framework for Information Technology (JFIT) Technical Conference.Google Scholar
- Python XML Special Interest Group. 1998. The XML bookmark exchange language. http://pyxml.sourceforge.net/topics/xbel/.Google Scholar
- Reynolds, J. C. 1983. Types, abstraction, and parametric polymorphism. Inf. Proc. 83, 513--523.Google Scholar
- Shields, M. and Meijer, E. 2001. Type-indexed rows. In Proceedings of the 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 261--275. Google Scholar
Digital Library
- Stefénsson, K. 1994. Systems of set constraints with negative constraints are nexptime-complete. In Proceedings of 9th Annual IEEE Symposium on Logic in Computer Science. IEEE Computer Society Press, Los Alamitos, CA, 137--141.Google Scholar
Cross Ref
- Stroustrup, B. 2000. The C++ Programming Language. Addison-Wesley, Reading, MA. Google Scholar
Digital Library
- Suda, T. and Hosoya, H. 2005. Non-backtracking top-down algorithm for checking tree automata containment. In Proceedings of Conference on Implementation and Applications of Automata (CIAA). 83--92. Google Scholar
Digital Library
- Sulzmann, M. and Lu, K. Z. M. 2006a. A type-safe embedding of XDuce into ML. Electric Notes Theoret. Comput. Sci. 148, 2, 239--264. Google Scholar
Digital Library
- Sulzmann, M. and Lu, K. Z. M. 2006b. XHaskell. In Proceedings of the Programming Language Technologies for XML (PLAN-X). 92. Demonstration.Google Scholar
- Tozawa, A. and Hagiya, M. 2003. XML schema containment checking based on semi-implicit techniques. In Proceedings of the 8th International Conference on Implementation and Application of Automata. Lecture Notes in Computer Science, vol. 2759. Springer-Verlag, Berlin, Germany, 213--225. Google Scholar
Digital Library
- Vansummeren, S. 2006. Type inference for unique pattern matching. ACM Trans. Prog. Lang. Syst. 28, 3, 389--428. Google Scholar
Digital Library
- Vouillon, J. 2006a. Polymorphic regular tree types and patterns. In Proceedings of the ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. ACM, New York, 103--114. Google Scholar
Digital Library
- Vouillon, J. 2006b. Polymorphism and XDuce-style patterns. In PLAN-X '06, Proceedings of the 4th Workshop on Programming Language Technologies for XML. 49--60.Google Scholar
- Wallace, M. and Runciman, C. 1999. Haskell and XML: Generic combinators or type-based translation? In Proceedings of the 4th ACM SIGPLAN International Conference on Functional Programming (ICFP'99). ACM, New York, 148--159. Google Scholar
Digital Library
Index Terms
Parametric polymorphism for XML
Recommendations
Set-theoretic foundation of parametric polymorphism and subtyping
ICFP '11: Proceedings of the 16th ACM SIGPLAN international conference on Functional programmingWe define and study parametric polymorphism for a type system with recursive, product, union, intersection, negation, and function types. We first recall why the definition of such a system was considered hard "when not impossible" and then present the ...
Parametric polymorphism for XML
Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesDespite the extensiveness of recent investigations on static typing for XML, parametric polymorphism has rarely been treated. This well-established typing discipline can also be useful in XML processing in particular for programs involving "parametric ...
Parametric polymorphism for XML
POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languagesDespite the extensiveness of recent investigations on static typing for XML, parametric polymorphism has rarely been treated. This well-established typing discipline can also be useful in XML processing in particular for programs involving "parametric ...






Comments