Parametric polymorphism and semantic subtyping: the logical connection

We consider a type algebra equipped with recursive, product, function, intersection, union, and complement types together with type variables and implicit universal quantification over them. We consider the subtyping relation recently defined by Castagna and Xu over such type expressions and show how this relation can be decided in EXPTIME, answering an open question. The novelty, originality and strength of our solution reside in introducing a logical modeling for the semantic subtyping framework. We model semantic subtyping in a tree logic and use a satisfiability-testing algorithm in order to decide subtyping. We report on practical experiments made with a full implementation of the system. This provides a powerful polymorphic type system aiming at maintaining full static type-safety of functional programs that manipulate trees, even with higher-order functions, which is particularly useful in the context of XML.

[1]  Benjamin C. Pierce,et al.  Regular expression types for XML , 2000, TOPL.

[2]  Giuseppe Castagna,et al.  Parametric polymorphism for XML , 2005, POPL '05.

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

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

[5]  Giuseppe Castagna,et al.  Set-theoretic foundation of parametric polymorphism and subtyping , 2011, ICFP.

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

[7]  Nikolaj Bjørner,et al.  Z3: An Efficient SMT Solver , 2008, TACAS.

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

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

[10]  Philip Wadler,et al.  Theorems for free! , 1989, FPCA.

[11]  Andrew D. Gordon,et al.  Semantic subtyping with an SMT solver , 2010, ICFP '10.

[12]  HriţcuCătălin,et al.  Semantic subtyping with an smt solver , 2012 .

[13]  Giuseppe Castagna,et al.  CDuce: an XML-centric general-purpose language , 2003, ACM SIGPLAN Notices.

[14]  Jérôme Vouillon Polymorphic regular tree types and patterns , 2006, POPL '06.

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

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

[17]  John C. Reynolds,et al.  Types, Abstraction and Parametric Polymorphism , 1983, IFIP Congress.