Semantic subtyping

A. Frisch1, G. Castagna2, V. Benzaken3
1Département dE28099Informatique, École Normale Supérieure, Paris, France
2C.N.R.S., Département dE28099Informatique, École Normale Supérieure, Paris, France
3LRI, UMR 8623, C.N.R.S., Université Paris Sud, Orsay, France

Tóm tắt

Usually subtyping relations are defined either syntactically by a formal system or semantically by an interpretation of types in an untyped denotational model. In this paper we show how to define a subtyping relation semantically, for a language whose operational semantics is driven by types; we consider a rich type algebra, with product, arrow, recursive, intersection, union and complement types. Our approach is to "bootstrap" the subtyping relation through a notion of set-theoretic model of the type algebra. The advantages of the semantic approach are manifold. Foremost we get "for free" many properties (e.g., the transitivity of subtyping) that, with axiomatized subtyping, would require tedious and error prone proofs. Equally important is that the semantic approach allows one to derive complete algorithms for the subtyping relation or the propagation of types through patterns. As the subtyping relation has a natural (inasmuch as semantic) interpretation, the type system can give informative error messages when static type-checking fails. Last but not least the approach has an immediate impact in the definition and the implementation of languages manipulating XML documents, as this was our original motivation.

Từ khóa

#Algebra #XML #Programming profession #Databases

Tài liệu tham khảo

damm, 1994, Subtyping with union types intersection types and recursive types II 10.1006/inco.1995.1033 10.1145/165180.165188 10.1145/351240.351242 10.1145/360204.360209 hosoya, 2000, XDuce: A typed XML processing language, Proc Third Int'l Workshop Web and Databases (WebDB '00) frisch, 2001, Types re?cursifs, combinaisons boole?ennes et fonctions surcharge?es: Application au typage de XML, DEA Programmation