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.

Scope of Application

  • 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.

  • 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.

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.

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.

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.

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.

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