natural deduction metalanguage, practical foundations
type theory (dependent, intensional, observational type theory, homotopy type theory)
computational trinitarianism =
propositions as types +programs as proofs +relation type theory/category theory
In type theory, a type may be classified by its “polarity”, either positive or negative, according to whether its term constructors or its term eliminators are regarded as primary, respectively. The idea is due to Jean-Marc Andreoli and Jean-Yves Girard.
Positive types are inductively defined by their term introduction rules and correspond, under categorical semantics, to objects defined as covariant representable functors () such as colimits and left adjoints.
On the other hand, negative types are coinductively defined by their term elimination rules and correspond under categorical semantics to objects defined as contravariant representable functors () such as limits and right adjoints.
Note that polarity is not so much a property of the types themselves, but rather of their presentation by introduction and elimination rules: It may happen that a positive and a negative type are equivalent (this is the case, for example, for the product type in simply typed lambda calculus). In terms of categorical semantics this is simply the fact that a single object may exhibit multiple universal properties.
Generally, in effectful languages, the positive types are better behaved in call-by-value? evaluation strategies and negative types are better behaved in call-by-name? and other lazy evaluation? strategies. A category-theoretic explanation of this fact is that call-by-value? languages can be modeled by the Kleisli category of a monad on a category . Usually, the category will have both limits (negatives) and colimits (positives), however the canonical functor is a left adjoint so it only generally preserves the colimits (positives). Dually, call-by-name languages can be modeled by the Kleisli category of a comonad and the canonical functor is a right adjoint, and so preserves limits (negatives).
Noam Zeilberger, The Logical Basis of Evaluation Order and Pattern-Matching, (pdf)
Robert Harper, Polarity in Type Theory, (blog post)
Last revised on December 17, 2022 at 15:25:56. See the history of this page for a list of all contributions to it.