Semantic SubtypingThe distinguishing feature of a type system using SemanticSubtyping is that it has a set-theoretic model, in which types correspond directly to sets of values.
http://www.cduce.org/papers.html
Start with: Guiseppe Castagna and Alain Frisch, "A Gentle Introduction to Semantic Subtyping", Second workshop on Programmable Structured Documents (Hakone).
From the introduction to that paper:
Many recent type systems rely on a subtyping relation. Its definition generally depends on the type algebra, and on its intended use. We can distinguish two main approaches for defining subtyping: the syntactic approach and the semantic one. The syntactic approach -- by far the most widespread -- consists in defining the subtyping relation by axiomatising it in a formal system (a set of inductive or coinductive rules); in the semantic approach [...], instead, one starts with a model of the language and an interpretation of types as subsets of the model, then defines the subtyping relation as the inclusion of denoted sets, and, finally, when the relation is decidable, derives a subtyping algorithm from the semantic definition.
[In short, "syntactic" type systems are those in which types are "constructed" out of more primitive types using various type operations (Cartesian product, union, join, meet, etc.). Which is how all class-based and prototype-based languages work.]
Semantic subtyping is most useful for expressing types of tree-structured data, such as XML, EssExpressions and TermTrees?.
SemanticSubtyping is powerful; on the other hand it has some interesting issues. (Not insurmountable, but interesting nonetheless):
My mistake, HyperSetTheory? does not allow a UniversalSet type, because it would lead to a contradiction via Cantor's Theorem. To have a UniversalSet type, you would need to use a set theory with a restricted version of the axiom of separation (so that Cantor's Theorem does not hold), such as NewFoundations or NFU. See SetOfAllSets.
EditText of this page
(last edited January 8, 2005)
or FindPage with title or text search