Covariance and contravariance: conflict without a cause

  • Giuseppe Castagna
Part of the Progress in Theoretical Computer Science book series (PTCS)


In this chapter we expand the discussion started in Section 4.6.4. We argue that covariance and contravariance appropriately characterize two distinct and independent mechanisms. The so-called contravariance rule correctly captures substitutivity, or the subtyping relation (that establishes which sets of codes can replace in every context another given set). Instead, a covariant relation characterizes the specialization of code (i.e., the definition of new code that replaces the old one in some particular cases).


Covariant Specialization Binary Method Small Talk Type Safety Inheritance Hierarchy 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Copyright information

© Birkhäuser Boston 1997

Authors and Affiliations

  • Giuseppe Castagna
    • 1
  1. 1.CNRS, LIENSParisFrance

Personalised recommendations