skip to main content
article

Parametric polymorphism for XML

Published: 12 January 2005 Publication History

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," i.e., 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. In this paper, we propose a different method that smoothly extends the semantic approach yet is algorithmically easier. In this, we 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, and so on. As a result, we achieve a sensible system that directly represents a usual expected behavior of polymorphic type systems---"values of variable 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.

References

[1]
A. Aiken, D. Kozen, and E. L. Wimmers. Decidability of systems offset constraints with negative constraints. Information and Computation, 122(1):30--44, 1995.
[2]
A. W. Appel and D. B. MacQueen. Standard ML of New Jersey. In Third Int 'l Symp. on Prog. Lang. Implementation and Logic Programming, pages 1--13. Springer-Verlag, Aug. 1991.
[3]
V. Benzaken, G. Castagna, and A. Frisch. CDuce: An XML-centric general-purpose language. In Proceedings of the International Conference on Functional Programming (ICFP), pages 51--63, 2003.
[4]
G. Bracha, M. Odersky, D. Stoutamire, and P. Wadler. Making the future safe or the past: Addinggenericity to the Java programming language. In C. Chambers, editor, ACM Symposium on Object Oriented Programming: Systems, Languages, and Applications (OOPSLA), pages 183--200, Vancouver, BC, 1998.
[5]
P. S. Canning, W. R. Cook, W. L. Hill, W. G. Oltho., and J. C. Mitchell. F-bounded polymorphism or object-oriented programming. In Conference on Functional Programming Languages and Computer Architecture (FPCA), pages 273--280, 1989.
[6]
L. Cardelli, S. Martini, J. C. Mitchell, and A. Scedrov. An extension of System F with subtyping. Information and Computation, 109 (1--2):4--56, 1994.
[7]
J. Clark and M. Murata. RELAX NG. http://www.relaxng.org, 2001.
[8]
H. Comon, M. Dauchet, R. Gilleron, F. Jacquemard, D. Lugiez, S. Tison, and M. Tommasi. Tree automata techniques and applications. Draft book; available electronically on http://www.grappa.univ-lille3.fr/tata, 1999.
[9]
M. A. Ellis and B. Stroustrup. The Annotated C++ Reference Manual. Addison-Wesley, 1990.
[10]
D. Fallside and Y. Lafon. XML protocol working group. http://www.w3.org/2000/xp/Group/, 2004.
[11]
P. Fankhauser, M. Fernández, A. Malhotra, M. Rys, J. Siméon, and P. Wadler. XQuery 1.0 Formal Semantics. http://www.w3.org/TR/query-semantics/, 2001.
[12]
A. Frisch, G. Castagna, and V. Benzaken. Semantic subtyping. In Seventeenth Annual IEEE Symposium on Logic In Computer Science, pages 137--146, 2002.
[13]
R. Gilleron, S. Tison, and M. Tommasi. Set constraints and automata. Information and Computation, 149(1):1--41, 1999.
[14]
H. Hosoya. Regular expression pattern matching -- a simpler design. Technical Report 1397, RIMS, Kyoto University, 2003.
[15]
H. Hosoya, A. Frisch, and G. Castagna. Parametric polymorphism or XML. http://arbre.is.s.u-tokyo.ac.jp/~hahosoya/papers/polyx.ps, 2004. Full version.
[16]
H. Hosoya and M. Murata. Boolean operations and inclusion test for attribute-element constraints. In Eighth International Conference on Implementation and Application of Automata, volume 2759 of Lecture Notes in Computer Science, pages 201--212. Springer-Verlag, 2003.
[17]
H. Hosoya and B. C. Pierce. Regular expression pattern matching for XML. Journal of Functional Programming, 13(6):961--1004, 2002. Short version appeared in Proceedings of The 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 67--80, 2001.
[18]
H. Hosoya and B. C. Pierce. XDuce: A typed XML processing language. ACM Transactions on Internet Technology, 3(2):117--148, 2003. Short version appeared in Proceedings of Third International Workshop on the Web and Databases (WebDB2000), volume 1997 of Lecture Notes in Computer Science, pp. 226--244, Springer-Verlag.
[19]
H. Hosoya, J. Vouillon, and B. C. Pierce. Regular expression types or XML. ACM Transactions on Programming Languages and Systems, 2004. Short version appeared in Proceedings of the International Conference on Functional Programming (ICFP), pp.11--22, 2000.
[20]
X. Leroy, D. Doligez, J. Garrigue, J. Vouillon, and D. Rémy. The Objective Caml system. Software and documentation available on the Web,http://pauillac.inria.fr/ocaml/, 1996.
[21]
E. Meijer and M. Shields. XMλ: A functional programming language or constructing and manipulating XML documents. Manuscript, 1999.
[22]
T. Milo, D. Suciu, and V. Vianu. Typechecking for XML transformers. In Proceedings of the Nineteenth ACM SIGMOD-SIGACT-SIGART Symposium on Principles of Database Systems, pages 11--22. ACM, May 2000.
[23]
M. Murata. Extended path expressions or XML. In Proceedings of Symposium on Principles of Database Systems (PODS), pages 126--137, 2001.
[24]
S. L. Peyton Jones, C. V. Hall, K. Hammond, W. Partain, and P. Wadler. The Glasgow Haskell compiler: a technical overview. In Proc.UK Joint Framework for Information Technology (JFIT) Technical Conference, July 1993.
[25]
J. C. Reynolds. Types, abstraction, and parametric polymorphism.Information Processing, 83:513--523, 1983.
[26]
M. Shields and E. Meijer. Type-indexed rows. In The 25th Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 261--275, London, Jan 2001.
[27]
K. Stefénsson. Systems of set constraints with negative constraints are nexptime-complete. In Proceedings of Ninth Annual IEEE Symposium on Logic in Computer Science, pages 137--141, 1994.
[28]
A. Tozawa and M. Hagiya. XML schema containment checking based on semi-implicit techniques. In 8th International Conference on Implementation and Application of Automata, volume 2759 of Lecture Notes in Computer Science, pages 213--225. Springer-Verlag, 2003.
[29]
M. Wallace and C. Runciman. Haskell and XML: Generic combinators or type-based translation? In Proceedings of the Fourth ACM SIGPLAN International Conference on Functional Programming (ICFP'99), volume 34-9 of ACM Sigplan Notices, pages 148--159, N.Y., Sept. 27--29 1999. ACM Press.

Cited By

View all
  • (2018)XML TypecheckingEncyclopedia of Database Systems10.1007/978-1-4614-8265-9_788(4817-4822)Online publication date: 7-Dec-2018
  • (2012)A Sound Type System for Typing Runtime ErrorsIPSJ Online Transactions10.2197/ipsjtrans.5.965(96-104)Online publication date: 2012
  • (2012)Loosely Coupled Information Models for Business Process Integration: Incorporating Rule-Based Semantic Bridges into BPELSemantic Web Services10.1007/978-3-642-28735-0_14(217-231)Online publication date: 23-Apr-2012
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 40, Issue 1
Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
January 2005
391 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/1047659
Issue’s Table of Contents
  • cover image ACM Conferences
    POPL '05: Proceedings of the 32nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages
    January 2005
    402 pages
    ISBN:158113830X
    DOI:10.1145/1040305
    • General Chair:
    • Jens Palsberg,
    • Program Chair:
    • Martín Abadi
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 12 January 2005
Published in SIGPLAN Volume 40, Issue 1

Check for updates

Author Tags

  1. XML
  2. polymorphism
  3. subtyping
  4. tree automata

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)1
Reflects downloads up to 07 Mar 2025

Other Metrics

Citations

Cited By

View all
  • (2018)XML TypecheckingEncyclopedia of Database Systems10.1007/978-1-4614-8265-9_788(4817-4822)Online publication date: 7-Dec-2018
  • (2012)A Sound Type System for Typing Runtime ErrorsIPSJ Online Transactions10.2197/ipsjtrans.5.965(96-104)Online publication date: 2012
  • (2012)Loosely Coupled Information Models for Business Process Integration: Incorporating Rule-Based Semantic Bridges into BPELSemantic Web Services10.1007/978-3-642-28735-0_14(217-231)Online publication date: 23-Apr-2012
  • (2009)XML TypecheckingEncyclopedia of Database Systems10.1007/978-0-387-39940-9_788(3646-3650)Online publication date: 2009
  • (2018)XML TypecheckingEncyclopedia of Database Systems10.1007/978-1-4614-8265-9_788(4817-4822)Online publication date: 7-Dec-2018
  • (2016)Data type definition and handling for supporting interoperability across organizational bordersJournal of Intelligent Manufacturing10.1007/s10845-014-0884-927:1(167-185)Online publication date: 1-Feb-2016
  • (2016)XML TypecheckingEncyclopedia of Database Systems10.1007/978-1-4899-7993-3_788-2(1-6)Online publication date: 29-Dec-2016
  • (2013)Eliminating the XML overhead in embedded XML languagesProceedings of the 28th Annual ACM Symposium on Applied Computing10.1145/2480362.2480466(542-547)Online publication date: 18-Mar-2013
  • (2011)Regular expression containmentProceedings of the 38th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages10.1145/1926385.1926429(385-398)Online publication date: 26-Jan-2011
  • (2011)Regular expression containmentACM SIGPLAN Notices10.1145/1925844.192642946:1(385-398)Online publication date: 26-Jan-2011
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media