In type theory, a theory within mathematical logic, the bottom type of a type system is the type that is a subtype of all other types.
Where such a type exists, it is often represented with the up tack (⊥) symbol.
When the bottom type is empty, a function whose return type is bottom cannot return any value, not even the lone value of a unit type. In such a language, the bottom type may therefore be known as the zero or never type. In the Curry–Howard correspondence, an empty type corresponds to falsity.
In subtyping systems, the bottom type is a subtype of all types. It is dual to the top type, which spans all possible values in a system.
If a type system is sound, the bottom type is uninhabited and a term of bottom type represents a logical contradiction. In such systems, typically no distinction is drawn between the bottom type and the empty type, and the terms may be used interchangeably.
If the bottom type is inhabited, its terms[s] typically correspond to error conditions such as undefined behavior, infinite recursion, or unrecoverable errors.
In Bounded Quantification with Bottom, Pierce says that "Bot" has many uses:
In a language with exceptions, a natural type for the raise construct is raise ∈ exception -> Bot, and similarly for other control structures. Intuitively, Bot here is the type of computations that do not return an answer.
Bot is useful in typing the "leaf nodes" of polymorphic data structures. For example, List(Bot) is a good type for nil.
Bot is a natural type for the "null pointer" value (a pointer which does not point to any object) of languages like Java: in Java, the null type is the universal subtype of reference types. null is the only value of the null type; and it can be cast to any reference type. However, the null type is not a bottom type as described above, it is not a subtype of int and other primitive types.
A type system including both Top and Bot seems to be a natural target for type inference, allowing the constraints on an omitted type parameter to be captured by a pair of bounds: we write S