Global Information Lookup Global Information

Subtyping information


In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism. A subtype is a datatype that is related to another datatype (the supertype) by some notion of substitutability, meaning that program elements (typically subroutines or functions), written to operate on elements of the supertype, can also operate on elements of the subtype.

If S is a subtype of T, the subtyping relation (written as S <: T,  ST,[1] or  S ≤: T ) means that any term of type S can safely be used in any context where a term of type T is expected. The precise semantics of subtyping here crucially depends on the particulars of how "safely be used" and "any context" are defined by a given type formalism or programming language. The type system of a programming language essentially defines its own subtyping relation, which may well be trivial, should the language support no (or very little) conversion mechanisms.

Due to the subtyping relation, a term may belong to more than one type. Subtyping is therefore a form of type polymorphism. In object-oriented programming the term 'polymorphism' is commonly used to refer solely to this subtype polymorphism, while the techniques of parametric polymorphism would be considered generic programming.

Functional programming languages often allow the subtyping of records. Consequently, simply typed lambda calculus extended with record types is perhaps the simplest theoretical setting in which a useful notion of subtyping may be defined and studied.[2] Because the resulting calculus allows terms to have more than one type, it is no longer a "simple" type theory. Since functional programming languages, by definition, support function literals, which can also be stored in records, records types with subtyping provide some of the features of object-oriented programming. Typically, functional programming languages also provide some, usually restricted, form of parametric polymorphism. In a theoretical setting, it is desirable to study the interaction of the two features; a common theoretical setting is system F<:. Various calculi that attempt to capture the theoretical properties of object-oriented programming may be derived from system F<:.

The concept of subtyping is related to the linguistic notions of hyponymy and holonymy. It is also related to the concept of bounded quantification in mathematical logic (see Order-sorted logic). Subtyping should not be confused with the notion of (class or object) inheritance from object-oriented languages;[3] subtyping is a relation between types (interfaces in object-oriented parlance) whereas inheritance is a relation between implementations stemming from a language feature that allows new objects to be created from existing ones. In a number of object-oriented languages, subtyping is called interface inheritance, with inheritance referred to as implementation inheritance.

  1. ^ Copestake, Ann. Implementing typed feature structure grammars. Vol. 110. Stanford: CSLI publications, 2002.
  2. ^ Cardelli, Luca. A semantics of multiple inheritance. In G. Kahn, D. MacQueen, and G. Plotkin, editors, Semantics of Data Types, volume 173 of Lecture Notes in Computer Science, pages 51–67. Springer-Verlag, 1984. Full version in Information and Computation, 76(2/3):138–164, 1988.
  3. ^ Cook, Hill & Canning 1990.

and 23 Related for: Subtyping information

Request time (Page generated in 0.5508 seconds.)

Subtyping

Last Update:

its own subtyping relation, which may well be trivial, should the language support no (or very little) conversion mechanisms. Due to the subtyping relation...

Word Count : 3590

Subtypes of HIV

Last Update:

The subtypes of HIV include two main subtypes, known as HIV type 1 (HIV-1) and HIV type 2 (HIV-2). These subtypes have distinct genetic differences and...

Word Count : 3870

Subtype

Last Update:

Look up subtype in Wiktionary, the free dictionary. Subtype may refer to: Viral subtypes, such as Subtypes of HIV Subtyping, a form of type polymorphism...

Word Count : 60

Liskov substitution principle

Last Update:

principle (LSP) is a particular definition of a subtyping relation, called strong behavioral subtyping, that was initially introduced by Barbara Liskov...

Word Count : 1191

Behavioral subtyping

Last Update:

In object-oriented programming, behavioral subtyping is the principle that subclasses should satisfy the expectations of clients accessing subclass objects...

Word Count : 1381

Structural type system

Last Update:

type, which is invoked implicitly. Structural subtyping is arguably more flexible than nominative subtyping, as it permits the creation of ad hoc types...

Word Count : 1104

Influenza A virus

Last Update:

definition, the subtyping scheme only takes into account the two outer proteins, not the at least 8 proteins internal to the virus. Using subtyping and host...

Word Count : 8067

Nominal type system

Last Update:

isomorphic to an existing type. In a similar fashion, nominal subtyping means that one type is a subtype of another if and only if it is explicitly declared to...

Word Count : 437

Gradual typing

Last Update:

the subtype hierarchy. However, because subtyping is transitive, that results in every type becoming related to every other type, and so subtyping would...

Word Count : 1101

Influenza A virus subtype H1N1

Last Update:

In virology, influenza A virus subtype H1N1 (A/H1N1) is a subtype of influenza A virus. Major outbreaks of H1N1 strains in humans include the 1918 Spanish...

Word Count : 5143

Caucasian race

Last Update:

type" which he considered to be distinct from Caucasians, rather than a subtype of it as others had done. While Blumenbach had erroneously thought that...

Word Count : 5674

Ad hoc polymorphism

Last Update:

at compile time, it is not a substitute for late binding as found in subtyping polymorphism. The previous section notwithstanding, there are other ways...

Word Count : 970

Polymorphism

Last Update:

implementation Bounded quantification, restricts type parameters to a range of subtypes Subtyping, different classes related by some common superclass can be used in...

Word Count : 351

Barbara Liskov

Last Update:

principle, which applies these ideas to object-oriented programming, subtyping, and inheritance. Her work was recognized with the 2008 Turing Award,...

Word Count : 1782

Influenza A virus subtype H5N1

Last Update:

Influenza A virus subtype H5N1 (A/H5N1) is a subtype of the influenza A virus, which causes influenza (flu), predominantly in birds. It is enzootic (maintained...

Word Count : 11065

Enneagram of Personality

Last Update:

personality types is understood as having three "instinctual subtypes". These subtypes are believed to be formed according to which one of three instinctual...

Word Count : 3422

Endemism

Last Update:

Endemism is the state of a species only being found in a single defined geographic location, such as an island, state, nation, country or other defined...

Word Count : 3593

Multiple dispatch

Last Update:

as a term's declared or inferred type (or base type in a language with subtyping) is used to determine which of several possibilities will be used at a...

Word Count : 5881

Music genre

Last Update:

A music genre is a conventional category (i.e, genre) that identifies some pieces of music as belonging to a shared tradition or set of conventions. Genre...

Word Count : 4128

Humid continental climate

Last Update:

in question must not be semi-arid or arid. The cooler Dfb, Dwb, and Dsb subtypes are also known as hemiboreal climates. Although amount of snowfall is not...

Word Count : 2740

POPLmark challenge

Last Update:

with subtyping), and has problems such as: Checking that the type system admits transitivity of subtyping. Checking the transitivity of subtyping in the...

Word Count : 495

TRPV1

Last Update:

The transient receptor potential cation channel subfamily V member 1 (TRPV1), also known as the capsaicin receptor and the vanilloid receptor 1, is a protein...

Word Count : 6740

Clade

Last Update:

subtypes, which vary in geographical prevalence. HIV subtype (clade) B, for example is predominant in Europe, the Americas and Japan, whereas subtype...

Word Count : 1774

PDF Search Engine © AllGlobal.net