Skip to content

Subtyping

In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism.

Core Idea

Subtyping is treated here as the recurring computer science and information systems identity summarized by this source-grounded definition: In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism.

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 , , or ) 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.

For Subtyping, the abstraction is narrower than the article's general subject matter: a positive case must preserve In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism. Retaining only the name, a familiar example, or a downstream effect is insufficient. The specialist roles and tests remain anchored in computer science and information systems, which is why this identity is domain-specific rather than prime.

Structural Signature

Sig role-phrases:

  • Defining carrier — Liskov's work in this area focused on behavioral subtyping, which besides the type system safety discussed in this article also requires that subtypes preserve all invariants guaranteed by the supertypes in some contract.
  • Constitutive relation — 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.
  • Operating condition — Because it must consider mutable objects, the ideal notion of subtyping defined by Liskov and Jeannette Wing, called behavioral subtyping is considerably stronger than what can be implemented in a type checker.
  • Recognition evidence — Rewriting this function so that it would only accept 'x' and 'y' of the same type requires bounded polymorphism.
  • Admissible variation — In Java, is-a relation between the type parameters of one class or interface and the type parameters of another are determined by the extends and implements clauses.
  • Characteristic consequence — The set can be described extensionally by listing all the values, or it can be described intensionally by stating the membership of the set by a predicate over a domain of possible values.
  • Failure boundary — In common programming languages enumeration types are defined extensionally by listing values.

What It Is Not

  • Not the whole field of computer science and information systems. The node requires the specific identity stated by In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism.
  • Not an over-broad reading. Depth subtyping only makes sense for immutable records: for example, you can assign 1.5 to the 'x' field of a real point (a record with two real fields), but you can't do the same to the 'x' field of an integer point (which, however, is a deep subtype of the real point type) because 1.5 is not an integer (see Variance).
  • Not an over-broad reading. Subtyping should not be confused with the notion of (class or object) inheritance from object-oriented languages; 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.
  • Not an over-broad reading. In this second case, we only have Integer Number and Float Number , but Integer and Float are not subtypes of each other.
  • Not automatically Type variable. Retrieval proximity does not establish equivalence; the two identities must be compared by carrier, operation, and failure boundary.

Scope of Application

Subtyping applies literally inside computer science and information systems wherever the source-defined carrier and relation can be established. Its documented habitats include:

  • Function types. In languages that allow side effects, like most object-oriented languages, subtyping is generally not sufficient to guarantee that a function can be safely used in the context of another.
  • Relationship with inheritance. By bottom-up application of the function subtyping rule, this means: S ≤: T and T ≤: S, which is only possible if S and T are the same.
  • Documented setting. Subtyping should not be confused with the notion of (class or object) inheritance from object-oriented languages; 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.
  • Origins. Reynolds in 1980 who used category theory to formalize implicit conversions, and Luca Cardelli (1985).
  • Examples. The UML notation is used in this diagram, with open-headed arrows showing the direction and type of the relationship between the supertype and its subtypes.
  • Examples. As a more practical example, a language might allow integer values to be used wherever floating point values are expected ( Integer Float ), or it might define a generic type Number as a common supertype of integers and the reals.

Outside computer science and information systems, the name should be retained only when these same operational conditions survive; otherwise the comparison belongs to the broader parent Classification or should be marked as analogy.

Clarity

A clear use of Subtyping names the carrier, the operative relation, and the conditions under which the source treats the identity as present. The minimal definition is In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism. The strongest recognition evidence in the frozen account is: Rewriting this function so that it would only accept 'x' and 'y' of the same type requires bounded polymorphism. A report should distinguish that evidence from a proxy, consequence, or common implementation. It should also state the qualification Depth subtyping only makes sense for immutable records: for example, you can assign 1.5 to the 'x' field of a real point (a record with two real fields), but you can't do the same to the 'x' field of an integer point (which, however, is a deep subtype of the real point type) because 1.5 is not an integer (see Variance). so that a reader can reproduce the classification rather than infer it from topical resemblance.

Manages Complexity

Subtyping compresses multiple computer science and information systems details into a stable diagnostic relation. The source shows both the central mechanism—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.—and the practical consequence—the set can be described extensionally by listing all the values, or it can be described intensionally by stating the membership of the set by a predicate over a domain of possible values. This compression makes cases comparable while leaving parameters, conventions, exceptions, and evidential quality explicit. It is lossy by design: local history and implementation details may be omitted only when they do not alter the defining relation.

Abstract Reasoning

  1. Type the carrier. Identify the computer science and information systems entities to which the claim applies.
  2. State the relation. Use the source-grounded identity: In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism.
  3. Check operation and conditions. Because it must consider mutable objects, the ideal notion of subtyping defined by Liskov and Jeannette Wing, called behavioral subtyping is considerably stronger than what can be implemented in a type checker.
  4. Demand recognition evidence. Rewriting this function so that it would only accept 'x' and 'y' of the same type requires bounded polymorphism.
  5. Test variation. Change an implementation or setting while preserving in Java, is-a relation between the type parameters of one class or interface and the type parameters of another are determined by the extends and implements clauses.
  6. Run the collapse test. Remove the defining operation; if the label still seems equally apt, only a topic or correlate was retained.
  7. Reduce cautiously. When the specialist conditions cannot be carried, route the residual comparison to Classification.

Knowledge Transfer

Within the home domain. Knowledge about Subtyping transfers literally when a new case preserves the same carrier type, relation, and recognition test. In languages that allow side effects, like most object-oriented languages, subtyping is generally not sufficient to guarantee that a function can be safely used in the context of another. By bottom-up application of the function subtyping rule, this means: S ≤: T and T ≤: S, which is only possible if S and T are the same.

Beyond the home domain. No canonical parent is asserted for Subtyping. An outside case receives the specialist name only when the same typed roles and rejection conditions can be filled literally; otherwise the comparison remains an analogy pending later graph densification.

Examples

Canonical

The first case is illustrated by independent types, such as Boolean and Float. This case is canonical because it supplies a concrete carrier and lets the defining relation be checked rather than merely named.

Mapped back: carrier → the entities in the documented case; operation → In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism; recognition evidence → Rewriting this function so that it would only accept 'x' and 'y' of the same type requires bounded polymorphism

Applied / In Practice

In this second case, we only have Integer Number and Float Number , but Integer and Float are not subtypes of each other. The applied case shows how the identity is used under a second setting or qualification while keeping the same operative relation.

Mapped back: changed setting → Examples; invariant → In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism; boundary → the case exits the class when depth subtyping only makes sense for immutable records: for example, you can assign 1.5 to the 'x' field of a real point (a record with two real fields), but you can't do the same to the 'x' field of an integer point (which, however, is a deep subtype of the real point type) because 1.5 is not an integer (see Variance)

Structural Tensions

T1 — Stable identity versus admissible variation. Depth subtyping only makes sense for immutable records: for example, you can assign 1.5 to the 'x' field of a real point (a record with two real fields), but you can't do the same to the 'x' field of an integer point (which, however, is a deep subtype of the real point type) because 1.5 is not an integer (see Variance). The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Which changes preserve the defining relation, and which replace it?

T2 — Recognition versus proxy. Subtyping should not be confused with the notion of (class or object) inheritance from object-oriented languages; 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. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Does the cited evidence establish the identity or only a correlated sign?

T3 — Definition versus implementation. In this second case, we only have Integer Number and Float Number , but Integer and Float are not subtypes of each other. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Is the observed implementation constitutive, optional, or merely common?

T4 — Scope versus overextension. However, the very possibility of implementing such an operator highly constrains the Number type (for example, one can't compare an integer with a complex number), and actually only comparing integers with integers, and reals with reals, makes sense. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Can every claimed application fill the same typed roles without metaphor?

T5 — Transfer versus domain accent. Liskov's work in this area focused on behavioral subtyping, which besides the type system safety discussed in this article also requires that subtypes preserve all invariants guaranteed by the supertypes in some contract. The tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: Does the receiving case instantiate Subtyping literally, co-instantiate Classification, or only resemble it?

T6 — Autonomy versus reduction. 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 tension matters because emphasizing only one side either dissolves the identity or overstates what the evidence and domain conventions warrant.

Diagnostic: What does Subtyping distinguish that the broader parent Classification leaves together?

Structural–Framed Character

Subtyping is structural-leaning. Its structural side is the repeatable organization summarized by In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism. Its framed side is the computer science and information systems vocabulary that fixes the carrier, evidence, exceptions, and admissible transformations.

Evaluative weight: the identity can be stated descriptively even when applications carry practical stakes. Human-practice dependence: the source-grounded carrier determines whether the relation exists independently or is constituted by a practice. Institutional origin: disciplinary conventions stabilize the name and test. Vocabulary portability: Because it must consider mutable objects, the ideal notion of subtyping defined by Liskov and Jeannette Wing, called behavioral subtyping is considerably stronger than what can be implemented in a type checker. Import versus recognition: literal transfer requires the same mechanism; shape alone is analogy.

Its portable skeleton is Classification. Its character: a recurring specialist identity whose thin organization can be abstracted, while its operational meaning remains domain-bound.

Structural Core vs. Domain Accent

What is skeletal. In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism. The stable skeleton is the typed relation expressed in that definition and the entry's recognition and collapse tests. The source identifies these operative conditions: Liskov's work in this area focused on behavioral subtyping, which besides the type system safety discussed in this article also requires that subtypes preserve all invariants guaranteed by the supertypes in some contract. 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. It further constrains recognition and variation through: Because it must consider mutable objects, the ideal notion of subtyping defined by Liskov and Jeannette Wing, called behavioral subtyping is considerably stronger than what can be implemented in a type checker. Rewriting this function so that it would only accept 'x' and 'y' of the same type requires bounded polymorphism.

What is domain-bound. computer science and information systems supplies the operative entities, technical vocabulary, warrants, and exceptions that make Subtyping literal. Its documented scope includes the condition that In languages that allow side effects, like most object-oriented languages, subtyping is generally not sufficient to guarantee that a function can be safely used in the context of another. Another bounded application condition is that By bottom-up application of the function subtyping rule, this means: S ≤: T and T ≤: S, which is only possible if S and T are the same. These are not decorative examples; they determine which carrier and evidence can fill the abstraction's roles.

Why no parent is asserted. Removing those specialist details does not currently yield one live catalog node that is a necessary genus for every instance. The entry is therefore approved as unparented rather than attached by topical resemblance. Its collapse evidence remains specific—In Java, is-a relation between the type parameters of one class or interface and the type parameters of another are determined by the extends and implements clauses.—and future graph densification may discover a defensible relation only if it preserves that boundary.

This entry presupposes Type System.

  • Approved unparented node. No current live node supplies a defensible necessary genus or structural prerequisite for Subtyping. The reviewed identity is: In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism. The accelerated suggestion was declined because topical or lexical similarity does not establish hierarchy; the node is admitted without a parent pending later graph densification.
  • Related reasoning operations. Evidence, representation, comparison, classification, transformation, or evaluation may participate in particular cases, but participation does not make any one of them a necessary parent of every instance.

Relationships to Other Abstractions

Local relationship map for SubtypingParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.SubtypingDOMAINDomain-specific abstraction: Type System — presupposesType SystemDOMAINDomain-specific abstraction: Bottom Type — presupposesBottom TypeDOMAIN

Current abstraction Subtyping Domain-specific

Parents (1) — more general patterns this builds on

  • Subtyping presupposes Type System Domain-specific

    Subtyping is defined through substitutability and ordering relations inside a type system.

Children (1) — more specific cases that build on this

  • Bottom Type Domain-specific presupposes Subtyping

    A bottom type requires a subtyping relation in which it is below every admissible type.

Hierarchy paths (2) — routes to 2 parentless roots

Neighborhood in Abstraction Space

Subtyping sits in a moderately populated region (52nd percentile for distinctiveness): it has near-neighbors but no dense thicket of look-alikes.

Family — Computation Models & Complexity Classes (37 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-10-08

Not to Be Confused With

  • Classification. The parent omits the specialist differentia. Tell: Can the case establish In programming language theory, subtyping (also called subtype polymorphism or inclusion polymorphism) is a form of type polymorphism?
  • Type variable. A formal variable ranging over types, enabling polymorphic expressions and quantified type schemes without denoting a mutable runtime storage location. Tell: Which entry's carrier, operation, and failure condition are satisfied?
  • Typed lambda calculus. A lambda-calculus formalism assigning types to variables and terms and restricting abstraction and application through typing rules. Tell: Which entry's carrier, operation, and failure condition are satisfied?
  • Typing rule. A formal inference rule specifying how types of component expressions and contextual assumptions justify a type judgment for a larger syntactic construction. Tell: Which entry's carrier, operation, and failure condition are satisfied?
  • A measurement, proxy, or consequence. Those may provide evidence without being the identity. Tell: Would Subtyping remain present if the detector or downstream effect changed?
  • A metaphorical analogue. A similar shape outside computer science and information systems lacks the specialist mechanism. Tell: Do the native roles transfer literally, or only the parent Classification?

References

  • Frozen Wikipedia discovery revision: https://en.wikipedia.org/wiki/Subtyping (revision 1361547078).
  • Preserved source candidate: https://www.python.org/dev/peps/pep-0253/
  • Preserved source candidate: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.39.1223
  • Preserved source candidate: http://reports-archive.adm.cs.cmu.edu/anon/1999/CMU-CS-99-156.ps

The frozen Wikipedia revision is discovery provenance. The retained source set was reviewed for identity, formal or operational relation, and scope. The encyclopedia's structural synthesis is bounded to those claims; a thin authority surface is recorded as a nonblocking source-strengthening repair rather than concealed.