Knowledge

Subtyping

Source πŸ“

1781:, replaces the various fields with their subtypes. That is, the fields of the subtype are subtypes of the fields of the supertype. Since any operation supported for a field in the supertype is supported for its subtype, any operation feasible on the record supertype is supported by the record subtype. 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 565:, and an operator of comparison with an arbitrary Number is defined for both types, then values of either type can be passed to this function. 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. Rewriting this function so that it would only accept 'x' and 'y' of the same type requires 2410: 423: 742:. Predicates are partial functions that compare values to selection criteria. For example: "is an integer value greater than or equal to 100 and less than 200?". If a value matches the criteria then the function returns the value. If not, the value is not selected, and nothing is returned. (List comprehensions are a form of this pattern used in many programming languages.) 311:, which can also be stored in records, records types with subtyping provide some of the features of object-oriented programming. Typically, functional programming languages also provide some, usually restricted, form of parametric polymorphism. In a theoretical setting, it is desirable to study the interaction of the two features; a common theoretical setting is 3109:
Reynolds, John C. Using category theory to design implicit conversions and generic operators. In N. D. Jones, editor, Proceedings of the Aarhus Workshop on Semantics-Directed Compiler Generation, number 94 in Lecture Notes in Computer Science. Springer-Verlag, January 1980. Also in Carl A. Gunter and
345:
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. In a number of object-oriented languages,
434:
A simple practical example of subtypes is shown in the diagram. The type "bird" has three subtypes "duck", "cuckoo" and "ostrich". Conceptually, each of these is a variety of the basic type "bird" that inherits many "bird" characteristics but has some specific differences. The
2936:
Cardelli, Luca. A semantics of multiple inheritance. In G. Kahn, D. MacQueen, and G. Plotkin, editors, Semantics of Data Types, volume 173 of Lecture Notes in Computer Science, pages 51–67. Springer-Verlag, 1984. Full version in Information and Computation, 76(2/3):138–164,
1626:, in which the structure of two types determines whether or not one is a subtype of the other. The class-based object-oriented subtyping described above is nominal; a structural subtyping rule for an object-oriented language might say that if objects of type 2010: 726:
of the subtype (the number of situations where it can be accepted or introduced), as compared to its "more general" supertypes. The disadvantage of having this more detailed information is that it represents incorporated choices which reduce the
1340: 1766:
Recall that a record is a collection of (named) fields. Since a subtype is a type which allows all operations allowed on the original type, a record subtype should support the same operations on the fields as the original type supported.
302:
extended with record types is perhaps the simplest theoretical setting in which a useful notion of subtyping may be defined and studied. Because the resulting calculus allows terms to have more than one type, it is no longer a "simple"
1508: 385:
The concept of subtyping has gained visibility (and synonymy with polymorphism in some circles) with the mainstream adoption of object-oriented programming. In this context, the principle of safe substitution is often called the
2273:
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. Liskov's work in this area focused on
2170: 1695:. The subtyping induced by subclassing in an object-oriented language is usually inclusive; subtyping relations that relate integers and floating-point numbers, which are represented differently, are usually coercive. 2742:
subtypes may be defined componentwise; in the case of width-extended records, type coercion simply discards any components which are not defined in the supertype. The type coercion for function types may be given by
1774:, adds more fields to the record. More formally, every (named) field appearing in the width supertype will appear in the width subtype. Thus, any operation feasible on the supertype will be supported by the subtype. 1107: 721:
In terms of information specificity, a subtype is considered more specific than any one of its supertypes, because it holds at least as much information as each of them. This may increase the applicability, or
961: 604:
like records (structs, interfaces) or classes are defined intensionally by an explicit type declaration or by using an existing value, which encodes type information, as a prototype to be copied or extended.
1896: 2597:
Subtyping and inheritance are compatible when all inherited fields and methods of the derived type have types which are subtypes of the corresponding fields and methods from the inherited type .
2244: 871: 600:
by stating the membership of the set by a predicate over a domain of possible values. In common programming languages enumeration types are defined extensionally by listing values.
2038:. Informally, this reversal occurs because the refined type is "more liberal" in the types it accepts and "more conservative" in the type it returns. This is what exactly works in 999: 1513:
The conjunction of predicates has been expressed here through application of the second predicate over the domain of values conforming to the first predicate. Viewed as types,
2808:. Thus, when multiple subtyping relationships are defined, one must be careful to guarantee that all type coercions are coherent. For instance, if an integer such as 2 : 2268: 1144: 1588: 1558: 2317:
Subtyping and inheritance are independent (orthogonal) relationships. They may coincide, but none is a special case of the other. In other words, between two types
1026: 801: 770: 2989:, ACM Transactions on Programming Languages and Systems, Volume 16, Issue 6 (November 1994), pp. 1811–1841. An updated version appeared as CMU technical report: 398:
address at a conference on object-oriented programming in 1987. Because it must consider mutable objects, the ideal notion of subtyping defined by Liskov and
1348: 2049: 439:
notation is used in this diagram, with open-headed arrows showing the direction and type of the relationship between the supertype and its subtypes.
2881: 2798: 2035: 2031: 1782: 1656:
is common in dynamically typed object-oriented languages. Sound structural subtyping rules for types other than object types are also well known.
1763:
subtyping. These express two different ways of obtaining a new type of record that allows the same operations as the original record type.
1043: 3110:
John C. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design (MIT Press, 1994).
879: 3306: 1647: 342: 3733: 3677: 3311: 3047:, chapter 15 (subtyping of record types), 19.3 (nominal vs. structural types and subtyping), and 23.2 (varieties of polymorphism) 608:
In discussing the concept of subsumption, the set of values of a type is indicated by writing its name in mathematical italics:
318:. Various calculi that attempt to capture the theoretical properties of object-oriented programming may be derived from system F 3301: 3296: 270:
Due to the subtyping relation, a term may belong to more than one type. Subtyping is therefore a form of type polymorphism. In
141: 3743: 3284: 3185: 442:
As a more practical example, a language might allow integer values to be used wherever floating point values are expected (
2186: 1814:). The rule for width subtyping is reversed: every tag appearing in the width subtype must appear in the width supertype. 482: 243:
where a term of type T is expected. The precise semantics of subtyping here crucially depends on the particulars of how
717:, then the two types are equal (although they may not be the same type if the type system distinguishes types by name). 3462: 3156: 3134: 3100: 3059: 3044: 2453: 2176: 2435: 2005:{\displaystyle {T_{1}\leq :S_{1}\quad S_{2}\leq :T_{2}} \over {S_{1}\rightarrow S_{2}\leq :T_{1}\rightarrow T_{2}}} 1800: 291: 3435: 813: 171: 33: 3552: 3357: 3289: 3251: 2420: 198:
or functions), written to operate on elements of the supertype, can also operate on elements of the subtype.
387: 3452: 3382: 3230: 2927:
Copestake, Ann. Implementing typed feature structure grammars. Vol. 110. Stanford: CSLI publications, 2002.
2309:) are covariant, like return values. Mutable references which act as both sources and sinks are invariant. 2279: 2172: 2039: 738:, which uses a predicate to define a set. Predicates can be defined over a domain (set of possible values) 299: 2278:, which besides the type system safety discussed in this article also requires that subtypes preserve all 3707: 3342: 2180: 1560:
as an operand (parameter value or term) will therefore be able to operate over that value as one of type
271: 155: 969: 426:
Example of subtypes: where bird is the supertype and all others are subtypes as denoted by the arrow in
3330: 3077:. Proc. 17th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages (POPL). pp. 125–135. 134: 3640: 3592: 3504: 3482: 3477: 3405: 3271: 3225: 1752: 1635: 436: 427: 295: 3083: 3514: 3178: 2999: 2270:
is its return type; "βˆ’" before the type means the type is contravariant while "+" means covariant.
2249: 17: 2985: 1335:{\displaystyle {\mathit {Felinae=\{cat\in Felidae\mid \ ofSubfamily(cat,felinaeSubfamilyName)\}}}} 3667: 3582: 2893: 2431: 1796: 279: 63: 3410: 3266: 3220: 3078: 2887: 2467: 1622: 362:
The notion of subtyping in programming languages dates back to the 1960s; it was introduced in
334: 3400: 3375: 2301:
is similar to the treatment of parameter values and return values. Write-only references (or
127: 1567: 1537: 263:
of a programming language essentially defines its own subtyping relation, which may well be
3738: 3202: 2908: 2275: 1004: 779: 748: 735: 612:. The type, viewed as a predicate over a domain, is indicated by writing its name in bold: 566: 403: 256: 54: 49: 8: 3728: 3672: 3650: 3577: 3430: 3422: 3171: 2287: 1811: 1616: 375: 284: 77: 40: 3655: 3635: 3587: 3562: 3347: 3316: 2283: 1659:
Implementations of programming languages with subtyping fall into two general classes:
338: 115: 1698:
In almost all type systems that define a subtyping relation, it is reflexive (meaning
1503:{\displaystyle {\mathit {Felis=\{cat\in Felinae\mid \ ofGenus(cat,felisGenusName)\}}}} 3542: 3472: 3447: 3261: 3256: 3152: 3130: 3096: 3055: 3040: 2726: 601: 308: 264: 110: 731:
of the subtype (the number of situations which are able to generate or produce it).
3687: 3572: 3370: 3122: 3088: 2427: 2298: 1620:, in which only types declared in a certain way may be subtypes of each other, and 454:
as a common supertype of integers and the reals. In this second case, we only have
367: 191: 100: 95: 72: 3692: 3557: 3509: 3442: 2903: 2606: 371: 252: 202: 105: 3140: 3062:, pp. 93–95 (a high-level presentation aimed at programming language users) 2165:{\displaystyle {\mathtt {Function_{N}({-A_{1}},{-A_{2}},\dots ,{-A_{n}},{+B})}}} 3645: 3467: 3457: 3365: 2995: 2991: 2739: 1807: 399: 391: 2034:
because the subtyping relation is reversed for it, whereas the return type is
3722: 3567: 3144: 2890:(for the perils of subtyping variable-types on the same basis as value-types) 2709: 379: 2401:
since any 32 bit integer value can be promoted into a 64 bit integer value.
3524: 3499: 2291: 1789: 734:
In the context of subsumption, the type definitions can be expressed using
407: 312: 1492: 1435: 1324: 1249: 3702: 3697: 3547: 3494: 3321: 1888: 1652: 341:). Subtyping should not be confused with the notion of (class or object) 304: 267:, should the language support no (or very little) conversion mechanisms. 260: 195: 3092: 3607: 3602: 3519: 3487: 3392: 3335: 3004: 2562:. By bottom-up application of the function subtyping rule, this means: 2609:
functions from subtype to supertype. For each subtyping relationship (
3660: 3617: 3612: 3279: 3235: 3194: 2805: 2305:) are contravariant, like parameter values; read-only references (or 1102:{\displaystyle \mathbf {S} =\mathbf {T} \land P_{s}=P_{T}\land P_{s}} 2438:. Statements consisting only of original research should be removed. 366:
derivatives. The first formal treatments of subtyping were given by
3597: 2898: 2804:
The coercion function is uniquely determined given the subtype and
1799:
with subtyping of record types and is a theoretical basis for many
1735: 485:
than would be possible without it. Consider the following example:
330: 326: 181: 1663:
implementations, in which the representation of any value of type
1040:, so both must be true for a value to be selected. The predicate 956:{\displaystyle S=\{v\in D\mid \ P_{T}(v){\text{ and }}P_{s}(v)\}} 395: 325:
The concept of subtyping is related to the linguistic notions of
307:. Since functional programming languages, by definition, support 274:
the term 'polymorphism' is commonly used to refer solely to this
2605:
In coercive subtyping systems, subtypes are defined by implicit
657:
A type may be subsumed by more than one type: the supertypes of
2377:
The second case can be illustrated by the relationship between
363: 2325:, all combinations of subtyping and inheritance are possible: 1838:
is a function type, then a subtype of it is any function type
422: 3163: 2945: 2943: 3159:. Section 8.6 contrast the subtyping of records and objects. 2586:
are the same. Since inheritance is an irreflexive relation,
2366:
The first case is illustrated by independent types, such as
1411: 1213: 3215: 2812:
can be coerced to a floating point number (say, 2.0 :
406:
is considerably stronger than what can be implemented in a
3073:
Cook, William R.; Hill, Walter; Canning, Peter S. (1990).
2940: 3210: 1534:) then a procedure, function or expression given a value 1489: 1486: 1483: 1480: 1477: 1474: 1471: 1468: 1465: 1462: 1459: 1456: 1453: 1450: 1447: 1444: 1441: 1438: 1432: 1429: 1426: 1423: 1420: 1417: 1414: 1405: 1402: 1399: 1396: 1393: 1390: 1387: 1381: 1378: 1375: 1369: 1366: 1363: 1360: 1357: 1321: 1318: 1315: 1312: 1309: 1306: 1303: 1300: 1297: 1294: 1291: 1288: 1285: 1282: 1279: 1276: 1273: 1270: 1267: 1264: 1261: 1258: 1255: 1252: 1246: 1243: 1240: 1237: 1234: 1231: 1228: 1225: 1222: 1219: 1216: 1207: 1204: 1201: 1198: 1195: 1192: 1189: 1183: 1180: 1177: 1171: 1168: 1165: 1162: 1159: 1156: 1153: 2658:. A coercion function may be defined by composition: if 1122:
For example: there is a subfamily of cat species called
3000:"Behavioral Subtyping Using Invariants and Constraints" 3052:
Component software: beyond object-oriented programming
2157: 2086: 2046:-ary function is internally a class that inherits the 2990: 2801:
of parameter values and covariance of return values.
2252: 2189: 2052: 1900: 1590:. In the example above, we could expect the function 1570: 1540: 1351: 1147: 1046: 1007: 972: 882: 816: 782: 751: 2239:{\displaystyle {\mathtt {A_{1},A_{2},\dots ,A_{n}}}} 1630:
can handle all of the messages that objects of type
592:
A type is a set of values. The set can be described
2863:would then be distinct from the identity coercion 2816:), then it is not admissible to coerce 2.1 : 2262: 2238: 2164: 2004: 1582: 1552: 1502: 1334: 1101: 1020: 993: 955: 865: 795: 764: 596:by listing all the values, or it can be described 2974:, MIT Press, 2002, 15.1 "Subsumption", p. 181-182 2385:. In most object oriented programming languages, 1634:can handle (that is, if they define all the same 3720: 2312: 1770:One kind of way to achieve such support, called 3072: 2949: 1806:Some systems also support subtyping of labeled 803:which applies additional criteria for the type 1594:to be applicable to values of all three types 807:, then sets for the two types can be defined: 772:which applies selection criteria for the type 3179: 581:is used to define or evaluate whether a type 135: 2286:. This definition of subtyping is generally 1746: 1495: 1372: 1327: 1174: 950: 889: 860: 823: 686:, the predicate which circumscribes the set 481:Programmers may take advantage of subtyping 2332:is neither a subtype nor a derived type of 1887:This can be summarised using the following 866:{\displaystyle T=\{v\in D\mid \ P_{T}(v)\}} 642:which it defines, is a superset of the set 194:, meaning that program elements (typically 3186: 3172: 2350:is not a subtype but is a derived type of 2341:is a subtype but is not a derived type of 1683:implementations, in which a value of type 1614:Type theorists make a distinction between 235: ) means that any term of type S can 142: 128: 3082: 2454:Learn how and when to remove this message 561:If integer and real are both subtypes of 184:that is related to another datatype (the 2494:, also note that the first parameter of 2359:is both a subtype and a derived type of 421: 2498:is this/self) and a derived class type 2468:function subtyping input contravariance 1788:Subtyping of records can be defined in 1667:also represents the same value at type 483:to write code in a more abstract manner 333:. It is also related to the concept of 14: 3721: 2478:returning an object of the same type ( 201:If S is a subtype of T, the subtyping 3167: 2678:may be regarded as an object of type 2282:guaranteed by the supertypes in some 2255: 2229: 2225: 2221: 2215: 2210: 2206: 2202: 2197: 2193: 2153: 2150: 2146: 2140: 2136: 2132: 2128: 2122: 2116: 2112: 2108: 2104: 2098: 2094: 2090: 2081: 2077: 2073: 2070: 2067: 2064: 2061: 2058: 2055: 694:(over the same domain) which defines 450:), or it might define a generic type 3129:, Cambridge University Press, 1998, 3054:, 2nd ed., Pearson Education, 2002, 2403: 1609: 1138:belongs, is part of that subfamily. 1134:, to which the domestic cat species 3050:C. Szyperski, D. Gruntz, S. Murer, 2738:Coercion functions for records and 2466:The third case is a consequence of 411: 24: 3115: 2977: 1710:) and transitive (meaning that if 1354: 1150: 1028:as part of the compound predicate 994:{\displaystyle \mathbf {T} =P_{T}} 350:, with inheritance referred to as 25: 3755: 3127:Theories of programming languages 2538:must be a subtype of the type of 1817: 1516:Felis <: Felinae <: Felidae 2986:A behavioral notion of subtyping 2983:Barbara Liskov, Jeannette Wing, 2824:, because the compound coercion 2408: 2389:are unrelated by inheritance to 2290:, so it cannot be verified by a 2175:(which can be seen as a general 1801:functional programming languages 1056: 1048: 974: 690:, must be part of the predicate 478:are not subtypes of each other. 292:Functional programming languages 3734:Polymorphism (computer science) 3037:Types and programming languages 2972:Types and Programming Languages 2470:. Assume a super class of type 2397:can be considered a subtype of 1925: 1741: 1650:from the other. This so-called 3193: 2964: 2955: 2930: 2921: 2506:. By inheritance, the type of 1988: 1962: 1126:, which is part of the family 947: 941: 923: 917: 857: 851: 577:In type theory the concept of 572: 13: 1: 3252:Arbitrary-precision or bignum 3023: 2950:Cook, Hill & Canning 1990 2882:Covariance and contravariance 2682:under the compound coercion ( 2313:Relationship with inheritance 2263:{\displaystyle {\mathtt {B}}} 2246:are the parameter types, and 1755:give rise to the concepts of 1646:regardless of whether either 745:If there are two predicates, 620:means "is a subtype of", and 388:Liskov substitution principle 294:often allow the subtyping of 3075:Inheritance is not subtyping 2629:is provided, and any object 2600: 2578:, which is only possible if 1803:that support both features. 300:simply typed lambda calculus 7: 3744:Object-oriented programming 2875: 2434:the claims made and adding 624:means "is a supertype of". 417: 337:in mathematical logic (see 272:object-oriented programming 156:programming language theory 101:Single and dynamic dispatch 10: 3760: 2637:is regarded as the object 1777:The second method, called 646:, so that every member of 616:. The conventional symbol 357: 352:implementation inheritance 278:, while the techniques of 3626: 3593:Strongly typed identifier 3535: 3421: 3391: 3356: 3244: 3201: 1747:Width and depth subtyping 1036:. The two predicates are 27:Form of type polymorphism 2914: 2183:-like languages), where 487: 394:who popularized it in a 3668:Parametric polymorphism 2894:Class-based programming 2617:), a coercion function 1854:with the property that 1797:parametric polymorphism 1689:automatically converted 1109:subsumes the predicate 280:parametric polymorphism 251:are defined by a given 64:Parametric polymorphism 2888:circle-ellipse problem 2712:from a type to itself 2590:can't be a subtype of 2264: 2240: 2166: 2014:The parameter type of 2006: 1584: 1583:{\displaystyle s\in T} 1554: 1553:{\displaystyle s\in S} 1504: 1336: 1103: 1022: 995: 957: 867: 797: 766: 431: 335:bounded quantification 168:inclusion polymorphism 2265: 2241: 2167: 2007: 1585: 1555: 1505: 1337: 1104: 1023: 1021:{\displaystyle P_{s}} 1001:is applied alongside 996: 958: 868: 798: 796:{\displaystyle P_{s}} 767: 765:{\displaystyle P_{T}} 638:if the set of values 585:is a subtype of type 425: 412:Β§ Function types 348:interface inheritance 3035:Benjamin C. Pierce, 2970:Benjamin C. Pierce, 2961:Pierce, ch. 15 notes 2909:Behavioral subtyping 2797:))), reflecting the 2276:behavioral subtyping 2250: 2187: 2050: 1897: 1812:algebraic data types 1623:structural subtyping 1568: 1538: 1349: 1145: 1044: 1005: 970: 880: 814: 780: 749: 736:Set-builder notation 650:is also a member of 567:bounded polymorphism 414:below for details.) 404:behavioral subtyping 376:implicit conversions 346:subtyping is called 282:would be considered 276:subtype polymorphism 257:programming language 190:) by some notion of 164:subtype polymorphism 55:Operator overloading 50:Function overloading 3673:Primitive data type 3578:Recursive data type 3431:Algebraic data type 3307:Quadruple precision 3149:A theory of objects 3093:10.1145/96709.96721 3039:, MIT Press, 2002, 2526:to be a subtype of 1734:). This makes it a 285:generic programming 78:Generic programming 41:Ad hoc polymorphism 3636:Abstract data type 3317:Extended precision 3276:Reduced precision 3151:, Springer, 1996, 2546:, in other words: 2419:possibly contains 2299:mutable references 2260: 2236: 2162: 1950: 1580: 1550: 1500: 1332: 1099: 1018: 991: 953: 863: 793: 762: 602:User-defined types 432: 339:Order-sorted logic 116:Predicate dispatch 3716: 3715: 3448:Associative array 3312:Octuple precision 2727:identity function 2464: 2463: 2456: 2421:original research 2297:The subtyping of 2002: 1795:, which combines 1730: <:  1722: <:  1714: <:  1702: <:  1691:into one of type 1675: <:  1617:nominal subtyping 1610:Subtyping schemes 1413: 1215: 929: 906: 840: 370:in 1980 who used 309:function literals 172:type polymorphism 152: 151: 111:Multiple dispatch 16:(Redirected from 3751: 3688:Type constructor 3573:Opaque data type 3505:Record or Struct 3302:Double precision 3297:Single precision 3188: 3181: 3174: 3165: 3164: 3123:John C. Reynolds 3106: 3086: 3017: 3016: 3014: 3013: 3008: 2981: 2975: 2968: 2962: 2959: 2953: 2947: 2938: 2934: 2928: 2925: 2522:. In order for 2474:having a method 2459: 2452: 2448: 2445: 2439: 2436:inline citations 2412: 2411: 2404: 2400: 2396: 2392: 2388: 2384: 2380: 2373: 2369: 2269: 2267: 2266: 2261: 2259: 2258: 2245: 2243: 2242: 2237: 2235: 2234: 2233: 2232: 2214: 2213: 2201: 2200: 2171: 2169: 2168: 2163: 2161: 2160: 2156: 2145: 2144: 2143: 2121: 2120: 2119: 2103: 2102: 2101: 2085: 2084: 2029: 2011: 2009: 2008: 2003: 2001: 2000: 1999: 1987: 1986: 1974: 1973: 1961: 1960: 1949: 1948: 1947: 1935: 1934: 1924: 1923: 1911: 1910: 1899: 1886: 1869: 1853: 1837: 1642:is a subtype of 1589: 1587: 1586: 1581: 1559: 1557: 1556: 1551: 1518: 1509: 1507: 1506: 1501: 1499: 1498: 1341: 1339: 1338: 1333: 1331: 1330: 1119: 1108: 1106: 1105: 1100: 1098: 1097: 1085: 1084: 1072: 1071: 1059: 1051: 1035: 1027: 1025: 1024: 1019: 1017: 1016: 1000: 998: 997: 992: 990: 989: 977: 962: 960: 959: 954: 940: 939: 930: 927: 916: 915: 904: 872: 870: 869: 864: 850: 849: 838: 802: 800: 799: 794: 792: 791: 771: 769: 768: 763: 761: 760: 741: 697: 689: 681: 664: 653: 649: 645: 641: 611: 564: 557: 554: 551: 548: 545: 542: 539: 536: 533: 530: 527: 524: 521: 518: 515: 512: 509: 506: 503: 500: 497: 494: 491: 477: 473: 469: 465: 461: 457: 453: 449: 445: 368:John C. Reynolds 298:. Consequently, 245:"safely be used" 234: 224: 214: 192:substitutability 144: 137: 130: 96:Virtual function 73:Generic function 30: 29: 21: 3759: 3758: 3754: 3753: 3752: 3750: 3749: 3748: 3719: 3718: 3717: 3712: 3693:Type conversion 3628: 3622: 3558:Enumerated type 3531: 3417: 3411:null-terminated 3387: 3352: 3240: 3197: 3192: 3162: 3118: 3116:Further reading 3113: 3103: 3084:10.1.1.102.8635 3065: 3026: 3021: 3020: 3011: 3009: 3002: 2996:Wing, Jeannette 2992:Liskov, Barbara 2982: 2978: 2969: 2965: 2960: 2956: 2948: 2941: 2935: 2931: 2926: 2922: 2917: 2904:Refinement type 2878: 2871: 2862: 2849: 2836: 2792: 2791: 2784: 2769: 2768: 2761: 2734: 2724: 2707: 2694: 2649: 2607:type conversion 2603: 2460: 2449: 2443: 2440: 2425: 2413: 2409: 2398: 2394: 2390: 2386: 2382: 2378: 2371: 2367: 2315: 2254: 2253: 2251: 2248: 2247: 2228: 2224: 2209: 2205: 2196: 2192: 2191: 2190: 2188: 2185: 2184: 2149: 2139: 2135: 2131: 2115: 2111: 2107: 2097: 2093: 2089: 2080: 2076: 2054: 2053: 2051: 2048: 2047: 2028: 2021: 2015: 1995: 1991: 1982: 1978: 1969: 1965: 1956: 1952: 1951: 1943: 1939: 1930: 1926: 1919: 1915: 1906: 1902: 1901: 1898: 1895: 1894: 1884: 1877: 1871: 1868: 1861: 1855: 1852: 1845: 1839: 1836: 1829: 1823: 1820: 1810:types (such as 1793: 1779:depth subtyping 1772:width subtyping 1749: 1744: 1612: 1569: 1566: 1565: 1539: 1536: 1535: 1514: 1353: 1352: 1350: 1347: 1346: 1149: 1148: 1146: 1143: 1142: 1114: 1093: 1089: 1080: 1076: 1067: 1063: 1055: 1047: 1045: 1042: 1041: 1033: 1012: 1008: 1006: 1003: 1002: 985: 981: 973: 971: 968: 967: 935: 931: 928: and  926: 911: 907: 881: 878: 877: 845: 841: 815: 812: 811: 787: 783: 781: 778: 777: 756: 752: 750: 747: 746: 739: 695: 687: 673: 672:(and therefore 662: 651: 647: 643: 639: 609: 575: 562: 559: 558: 555: 552: 549: 546: 543: 540: 537: 534: 531: 528: 525: 522: 519: 516: 513: 510: 507: 504: 501: 498: 495: 492: 489: 475: 471: 467: 463: 459: 455: 451: 447: 443: 420: 372:category theory 360: 321: 316: 226: 216: 206: 170:) is a form of 148: 106:Double dispatch 28: 23: 22: 15: 12: 11: 5: 3757: 3747: 3746: 3741: 3736: 3731: 3714: 3713: 3711: 3710: 3705: 3700: 3695: 3690: 3685: 3680: 3675: 3670: 3665: 3664: 3663: 3653: 3648: 3646:Data structure 3643: 3638: 3632: 3630: 3624: 3623: 3621: 3620: 3615: 3610: 3605: 3600: 3595: 3590: 3585: 3580: 3575: 3570: 3565: 3560: 3555: 3550: 3545: 3539: 3537: 3533: 3532: 3530: 3529: 3528: 3527: 3517: 3512: 3507: 3502: 3497: 3492: 3491: 3490: 3480: 3475: 3470: 3465: 3460: 3455: 3450: 3445: 3440: 3439: 3438: 3427: 3425: 3419: 3418: 3416: 3415: 3414: 3413: 3403: 3397: 3395: 3389: 3388: 3386: 3385: 3380: 3379: 3378: 3373: 3362: 3360: 3354: 3353: 3351: 3350: 3345: 3340: 3339: 3338: 3328: 3327: 3326: 3325: 3324: 3314: 3309: 3304: 3299: 3294: 3293: 3292: 3287: 3285:Half precision 3282: 3272:Floating point 3269: 3264: 3259: 3254: 3248: 3246: 3242: 3241: 3239: 3238: 3233: 3228: 3223: 3218: 3213: 3207: 3205: 3199: 3198: 3191: 3190: 3183: 3176: 3168: 3161: 3160: 3138: 3119: 3117: 3114: 3112: 3111: 3101: 3071: 3064: 3063: 3048: 3032: 3025: 3022: 3019: 3018: 2976: 2963: 2954: 2939: 2929: 2919: 2918: 2916: 2913: 2912: 2911: 2906: 2901: 2896: 2891: 2884: 2877: 2874: 2867: 2854: 2841: 2828: 2799:contravariance 2789: 2782: 2778: 2766: 2759: 2755: 2740:disjoint union 2732: 2716: 2699: 2686: 2641: 2602: 2599: 2462: 2461: 2416: 2414: 2407: 2364: 2363: 2354: 2345: 2336: 2314: 2311: 2257: 2231: 2227: 2223: 2220: 2217: 2212: 2208: 2204: 2199: 2195: 2159: 2155: 2152: 2148: 2142: 2138: 2134: 2130: 2127: 2124: 2118: 2114: 2110: 2106: 2100: 2096: 2092: 2088: 2083: 2079: 2075: 2072: 2069: 2066: 2063: 2060: 2057: 2030:is said to be 2026: 2019: 1998: 1994: 1990: 1985: 1981: 1977: 1972: 1968: 1964: 1959: 1955: 1946: 1942: 1938: 1933: 1929: 1922: 1918: 1914: 1909: 1905: 1882: 1875: 1866: 1859: 1850: 1843: 1834: 1827: 1819: 1818:Function types 1816: 1808:disjoint union 1791: 1748: 1745: 1743: 1740: 1611: 1608: 1579: 1576: 1573: 1549: 1546: 1543: 1532:T :> S 1511: 1510: 1497: 1494: 1491: 1488: 1485: 1482: 1479: 1476: 1473: 1470: 1467: 1464: 1461: 1458: 1455: 1452: 1449: 1446: 1443: 1440: 1437: 1434: 1431: 1428: 1425: 1422: 1419: 1416: 1410: 1407: 1404: 1401: 1398: 1395: 1392: 1389: 1386: 1383: 1380: 1377: 1374: 1371: 1368: 1365: 1362: 1359: 1356: 1343: 1342: 1329: 1326: 1323: 1320: 1317: 1314: 1311: 1308: 1305: 1302: 1299: 1296: 1293: 1290: 1287: 1284: 1281: 1278: 1275: 1272: 1269: 1266: 1263: 1260: 1257: 1254: 1251: 1248: 1245: 1242: 1239: 1236: 1233: 1230: 1227: 1224: 1221: 1218: 1212: 1209: 1206: 1203: 1200: 1197: 1194: 1191: 1188: 1185: 1182: 1179: 1176: 1173: 1170: 1167: 1164: 1161: 1158: 1155: 1152: 1096: 1092: 1088: 1083: 1079: 1075: 1070: 1066: 1062: 1058: 1054: 1050: 1015: 1011: 988: 984: 980: 976: 966:The predicate 964: 963: 952: 949: 946: 943: 938: 934: 925: 922: 919: 914: 910: 903: 900: 897: 894: 891: 888: 885: 874: 873: 862: 859: 856: 853: 848: 844: 837: 834: 831: 828: 825: 822: 819: 790: 786: 759: 755: 719: 718: 699: 666: 655: 574: 571: 488: 419: 416: 400:Jeannette Wing 392:Barbara Liskov 359: 356: 319: 314: 253:type formalism 237:safely be used 150: 149: 147: 146: 139: 132: 124: 121: 120: 119: 118: 113: 108: 103: 98: 90: 89: 83: 82: 81: 80: 75: 67: 66: 60: 59: 58: 57: 52: 44: 43: 37: 36: 26: 9: 6: 4: 3: 2: 3756: 3745: 3742: 3740: 3737: 3735: 3732: 3730: 3727: 3726: 3724: 3709: 3706: 3704: 3701: 3699: 3696: 3694: 3691: 3689: 3686: 3684: 3681: 3679: 3676: 3674: 3671: 3669: 3666: 3662: 3659: 3658: 3657: 3654: 3652: 3649: 3647: 3644: 3642: 3639: 3637: 3634: 3633: 3631: 3625: 3619: 3616: 3614: 3611: 3609: 3606: 3604: 3601: 3599: 3596: 3594: 3591: 3589: 3586: 3584: 3581: 3579: 3576: 3574: 3571: 3569: 3568:Function type 3566: 3564: 3561: 3559: 3556: 3554: 3551: 3549: 3546: 3544: 3541: 3540: 3538: 3534: 3526: 3523: 3522: 3521: 3518: 3516: 3513: 3511: 3508: 3506: 3503: 3501: 3498: 3496: 3493: 3489: 3486: 3485: 3484: 3481: 3479: 3476: 3474: 3471: 3469: 3466: 3464: 3461: 3459: 3456: 3454: 3451: 3449: 3446: 3444: 3441: 3437: 3434: 3433: 3432: 3429: 3428: 3426: 3424: 3420: 3412: 3409: 3408: 3407: 3404: 3402: 3399: 3398: 3396: 3394: 3390: 3384: 3381: 3377: 3374: 3372: 3369: 3368: 3367: 3364: 3363: 3361: 3359: 3355: 3349: 3346: 3344: 3341: 3337: 3334: 3333: 3332: 3329: 3323: 3320: 3319: 3318: 3315: 3313: 3310: 3308: 3305: 3303: 3300: 3298: 3295: 3291: 3288: 3286: 3283: 3281: 3278: 3277: 3275: 3274: 3273: 3270: 3268: 3265: 3263: 3260: 3258: 3255: 3253: 3250: 3249: 3247: 3243: 3237: 3234: 3232: 3229: 3227: 3224: 3222: 3219: 3217: 3214: 3212: 3209: 3208: 3206: 3204: 3203:Uninterpreted 3200: 3196: 3189: 3184: 3182: 3177: 3175: 3170: 3169: 3166: 3158: 3157:0-387-94775-2 3154: 3150: 3146: 3145:Luca Cardelli 3142: 3139: 3137:, chapter 16. 3136: 3135:0-521-59414-6 3132: 3128: 3124: 3121: 3120: 3108: 3107: 3104: 3102:0-89791-343-4 3098: 3094: 3090: 3085: 3080: 3076: 3070: 3069: 3061: 3060:0-201-74572-0 3057: 3053: 3049: 3046: 3045:0-262-16209-1 3042: 3038: 3034: 3033: 3031: 3030: 3006: 3001: 2998:(July 1999). 2997: 2993: 2988: 2987: 2980: 2973: 2967: 2958: 2951: 2946: 2944: 2933: 2924: 2920: 2910: 2907: 2905: 2902: 2900: 2897: 2895: 2892: 2889: 2885: 2883: 2880: 2879: 2873: 2870: 2866: 2861: 2857: 2853: 2848: 2844: 2840: 2835: 2831: 2827: 2823: 2819: 2815: 2811: 2807: 2802: 2800: 2796: 2788: 2781: 2777: 2773: 2765: 2758: 2754: 2750: 2746: 2741: 2736: 2731: 2728: 2723: 2719: 2715: 2711: 2710:type coercion 2706: 2702: 2698: 2693: 2689: 2685: 2681: 2677: 2673: 2669: 2665: 2661: 2657: 2653: 2648: 2644: 2640: 2636: 2632: 2628: 2624: 2620: 2616: 2612: 2608: 2598: 2595: 2593: 2589: 2585: 2581: 2577: 2573: 2569: 2565: 2561: 2557: 2553: 2549: 2545: 2541: 2537: 2533: 2529: 2525: 2521: 2517: 2513: 2509: 2505: 2501: 2497: 2493: 2489: 2485: 2481: 2477: 2473: 2469: 2458: 2455: 2447: 2437: 2433: 2429: 2423: 2422: 2417:This article 2415: 2406: 2405: 2402: 2375: 2362: 2358: 2355: 2353: 2349: 2346: 2344: 2340: 2337: 2335: 2331: 2328: 2327: 2326: 2324: 2320: 2310: 2308: 2304: 2300: 2295: 2293: 2289: 2285: 2281: 2277: 2271: 2218: 2182: 2178: 2174: 2125: 2045: 2041: 2037: 2033: 2032:contravariant 2025: 2018: 2012: 1996: 1992: 1983: 1979: 1975: 1970: 1966: 1957: 1953: 1944: 1940: 1936: 1931: 1927: 1920: 1916: 1912: 1907: 1903: 1892: 1890: 1881: 1874: 1865: 1858: 1849: 1842: 1833: 1826: 1815: 1813: 1809: 1804: 1802: 1798: 1794: 1786: 1784: 1780: 1775: 1773: 1768: 1764: 1762: 1758: 1754: 1739: 1737: 1733: 1729: 1725: 1721: 1717: 1713: 1709: 1706:for any type 1705: 1701: 1696: 1694: 1690: 1686: 1682: 1678: 1674: 1670: 1666: 1662: 1657: 1655: 1654: 1649: 1645: 1641: 1637: 1633: 1629: 1625: 1624: 1619: 1618: 1607: 1605: 1601: 1597: 1593: 1577: 1574: 1571: 1563: 1547: 1544: 1541: 1533: 1529: 1525: 1520: 1517: 1408: 1384: 1345: 1344: 1210: 1186: 1141: 1140: 1139: 1137: 1133: 1129: 1125: 1120: 1117: 1112: 1094: 1090: 1086: 1081: 1077: 1073: 1068: 1064: 1060: 1052: 1039: 1031: 1013: 1009: 986: 982: 978: 944: 936: 932: 920: 912: 908: 901: 898: 895: 892: 886: 883: 876: 875: 854: 846: 842: 835: 832: 829: 826: 820: 817: 810: 809: 808: 806: 788: 784: 775: 757: 753: 743: 737: 732: 730: 725: 716: 712: 708: 704: 700: 693: 685: 680: 676: 671: 667: 661:intersect at 660: 656: 637: 634: 631: 627: 626: 625: 623: 619: 615: 606: 603: 599: 598:intensionally 595: 594:extensionally 590: 588: 584: 580: 570: 568: 486: 484: 479: 440: 438: 429: 424: 415: 413: 409: 405: 401: 397: 393: 389: 383: 381: 380:Luca Cardelli 377: 374:to formalize 373: 369: 365: 355: 353: 349: 344: 340: 336: 332: 328: 323: 317: 310: 306: 301: 297: 293: 289: 287: 286: 281: 277: 273: 268: 266: 262: 258: 254: 250: 249:"any context" 246: 242: 238: 233: 229: 223: 219: 213: 209: 204: 199: 197: 193: 189: 188: 183: 179: 178: 173: 169: 165: 162:(also called 161: 157: 145: 140: 138: 133: 131: 126: 125: 123: 122: 117: 114: 112: 109: 107: 104: 102: 99: 97: 94: 93: 92: 91: 88: 85: 84: 79: 76: 74: 71: 70: 69: 68: 65: 62: 61: 56: 53: 51: 48: 47: 46: 45: 42: 39: 38: 35: 32: 31: 19: 3682: 3473:Intersection 3148: 3141:MartΓ­n Abadi 3126: 3074: 3067: 3066: 3051: 3036: 3028: 3027: 3010:. Retrieved 2984: 2979: 2971: 2966: 2957: 2932: 2923: 2868: 2864: 2859: 2855: 2851: 2846: 2842: 2838: 2833: 2829: 2825: 2821: 2820:to 2 : 2817: 2813: 2809: 2803: 2794: 2786: 2779: 2775: 2771: 2763: 2756: 2752: 2748: 2744: 2737: 2729: 2721: 2717: 2713: 2704: 2700: 2696: 2691: 2687: 2683: 2679: 2675: 2671: 2667: 2663: 2659: 2655: 2651: 2646: 2642: 2638: 2634: 2630: 2626: 2622: 2618: 2614: 2610: 2604: 2596: 2591: 2587: 2583: 2579: 2575: 2571: 2567: 2563: 2559: 2555: 2551: 2547: 2543: 2539: 2535: 2531: 2530:the type of 2527: 2523: 2519: 2515: 2511: 2507: 2503: 2499: 2495: 2491: 2487: 2483: 2482:the type of 2479: 2475: 2471: 2465: 2450: 2441: 2418: 2376: 2365: 2360: 2356: 2351: 2347: 2342: 2338: 2333: 2329: 2322: 2318: 2316: 2306: 2302: 2296: 2292:type checker 2272: 2043: 2023: 2016: 2013: 1893: 1879: 1872: 1863: 1856: 1847: 1840: 1831: 1824: 1821: 1805: 1787: 1778: 1776: 1771: 1769: 1765: 1760: 1756: 1750: 1742:Record types 1731: 1727: 1723: 1719: 1715: 1711: 1707: 1703: 1699: 1697: 1692: 1688: 1684: 1680: 1676: 1672: 1668: 1664: 1660: 1658: 1651: 1643: 1639: 1631: 1627: 1621: 1615: 1613: 1603: 1599: 1595: 1591: 1561: 1531: 1527: 1523: 1521: 1515: 1512: 1135: 1131: 1130:. The genus 1127: 1123: 1121: 1115: 1110: 1037: 1029: 965: 804: 773: 744: 733: 728: 723: 720: 714: 710: 706: 702: 691: 683: 678: 674: 669: 658: 635: 632: 629: 621: 617: 613: 607: 597: 593: 591: 586: 582: 578: 576: 560: 480: 441: 433: 408:type checker 384: 361: 351: 347: 324: 290: 283: 275: 269: 248: 244: 240: 236: 231: 227: 221: 217: 211: 207: 205:(written as 200: 186: 185: 176: 175: 167: 163: 159: 153: 86: 34:Polymorphism 3739:Type theory 3703:Type theory 3698:Type system 3548:Bottom type 3495:Option type 3436:generalized 3322:Long double 3267:Fixed point 2288:undecidable 1889:typing rule 1653:duck typing 1592:ofSubfamily 1136:Felis catus 579:subsumption 573:Subsumption 343:inheritance 305:type theory 261:type system 241:any context 225:, or   196:subroutines 3729:Data types 3723:Categories 3608:Empty type 3603:Type class 3553:Collection 3510:Refinement 3488:metaobject 3336:signedness 3195:Data types 3024:References 3012:2006-10-05 2654:) of type 2428:improve it 2393:. However 2280:invariants 1976:≤ : 1937:≤ : 1913:≤ : 1738:on types. 1564:, because 729:prevalence 3683:Subtyping 3678:Interface 3661:metaclass 3613:Unit type 3583:Semaphore 3563:Exception 3468:Inductive 3458:Dependent 3423:Composite 3401:Character 3383:Reference 3280:Minifloat 3236:Bit array 3079:CiteSeerX 3029:Textbooks 2837:given by 2806:supertype 2601:Coercions 2444:July 2022 2432:verifying 2219:… 2177:interface 2133:− 2126:… 2109:− 2091:− 2036:covariant 1989:→ 1963:→ 1751:Types of 1661:inclusive 1575:∈ 1545:∈ 1526:subsumes 1409:∣ 1385:∈ 1211:∣ 1187:∈ 1116:S <: T 1087:∧ 1061:∧ 1038:conjoined 1032:defining 902:∣ 896:∈ 836:∣ 830:∈ 724:relevance 713:subsumes 705:subsumes 670:S <: T 402:, called 187:supertype 160:subtyping 87:Subtyping 3708:Variable 3598:Top type 3463:Equality 3371:physical 3348:Rational 3343:Interval 3290:bfloat16 2899:Top type 2876:See also 2633:of type 2284:contract 1790:System F 1783:Variance 1736:preorder 1681:coercive 1648:inherits 1638:), then 682:), then 633:subsumes 490:function 430:notation 418:Examples 390:, after 382:(1985). 331:holonymy 327:hyponymy 313:system F 215:,   203:relation 182:datatype 18:Subtypes 3651:Generic 3627:Related 3543:Boolean 3500:Product 3376:virtual 3366:Address 3358:Pointer 3331:Integer 3262:Decimal 3257:Complex 3245:Numeric 2725:is the 2708:). The 2426:Please 2368:Boolean 2307:sources 1753:records 1687:can be 1636:methods 1600:Felinae 1596:Felidae 1128:Felidae 1124:Felinae 628:A type 472:Integer 456:Integer 444:Integer 410:. (See 396:keynote 358:Origins 296:records 265:trivial 177:subtype 3641:Boxing 3629:topics 3588:Stream 3525:tagged 3483:Object 3406:String 3155:  3133:  3099:  3081:  3068:Papers 3058:  3043:  2852:coerce 2839:coerce 2826:coerce 2776:coerce 2753:coerce 2714:coerce 2697:coerce 2684:coerce 2670:<: 2662:<: 2639:coerce 2619:coerce 2613:<: 1878:<: 1862:<: 1679:, and 1412:  1214:  905:  839:  776:, and 709:, and 563:Number 550:return 541:return 517:Number 505:Number 470:, but 468:Number 466:<: 460:Number 458:<: 452:Number 446:<: 378:, and 364:Simula 259:. The 210:<: 3536:Other 3520:Union 3453:Class 3443:Array 3226:Tryte 2937:1988. 2915:Notes 2869:float 2856:float 2847:float 2834:float 2830:float 2818:float 2814:float 2674:then 2502:from 2399:Int64 2395:Int32 2391:Int32 2387:Int64 2383:Int64 2379:Int32 2372:Float 2303:sinks 2173:trait 2040:Scala 1792:<: 1761:depth 1757:width 1726:then 1604:Felis 1132:Felis 1113:, so 622::> 618:<: 476:Float 464:Float 448:Float 320:<: 315:<: 180:is a 3656:Kind 3618:Void 3478:List 3393:Text 3231:Word 3221:Trit 3216:Byte 3153:ISBN 3131:ISBN 3097:ISBN 3056:ISBN 3041:ISBN 2886:The 2751:) = 2666:and 2582:and 2570:and 2480:i.e. 2381:and 2370:and 2321:and 2181:Java 2042:: a 1870:and 1759:and 1718:and 1602:and 547:else 538:then 532:< 474:and 462:and 329:and 247:and 174:. A 3515:Set 3211:Bit 3089:doi 2860:int 2843:int 2822:int 2810:int 2594:. 2574:≀: 2566:≀: 2554:≀: 2542:in 2534:in 2514:is 2510:in 2486:is 2430:by 2179:in 1822:If 1785:). 1671:if 1522:If 701:If 668:If 556:end 493:max 437:UML 428:UML 255:or 239:in 230:≀: 166:or 154:In 3725:: 3147:, 3143:, 3125:, 3095:. 3087:. 3005:PS 2994:; 2942:^ 2872:. 2865:id 2858:β†’ 2850:∘ 2845:β†’ 2832:β†’ 2785:β†’ 2762:β†’ 2745:f' 2735:. 2730:id 2720:β†’ 2703:β†’ 2695:∘ 2690:β†’ 2645:β†’ 2625:β†’ 2621:: 2558:β†’ 2550:β†’ 2518:β†’ 2490:β†’ 2374:. 2294:. 2022:β†’ 1891:: 1846:β†’ 1830:β†’ 1606:. 1598:, 1519:. 677:βŠ† 589:. 569:. 526:if 523:is 514:as 502:as 354:. 322:. 288:. 220:βŠ‘ 158:, 3187:e 3180:t 3173:v 3105:. 3091:: 3015:. 3007:) 3003:( 2952:. 2795:t 2793:( 2790:1 2787:S 2783:1 2780:T 2774:( 2772:f 2770:( 2767:2 2764:T 2760:2 2757:S 2749:t 2747:( 2733:T 2722:T 2718:T 2705:T 2701:S 2692:U 2688:T 2680:u 2676:s 2672:U 2668:T 2664:T 2660:S 2656:T 2652:s 2650:( 2647:T 2643:S 2635:S 2631:s 2627:T 2623:S 2615:T 2611:S 2592:T 2588:S 2584:T 2580:S 2576:S 2572:T 2568:T 2564:S 2560:T 2556:T 2552:S 2548:S 2544:T 2540:m 2536:S 2532:m 2528:T 2524:S 2520:S 2516:S 2512:S 2508:m 2504:T 2500:S 2496:m 2492:T 2488:T 2484:m 2476:m 2472:T 2457:) 2451:( 2446:) 2442:( 2424:. 2361:T 2357:S 2352:T 2348:S 2343:T 2339:S 2334:T 2330:S 2323:T 2319:S 2256:B 2230:n 2226:A 2222:, 2216:, 2211:2 2207:A 2203:, 2198:1 2194:A 2158:) 2154:B 2151:+ 2147:, 2141:n 2137:A 2129:, 2123:, 2117:2 2113:A 2105:, 2099:1 2095:A 2087:( 2082:N 2078:n 2074:o 2071:i 2068:t 2065:c 2062:n 2059:u 2056:F 2044:n 2027:2 2024:S 2020:1 2017:S 1997:2 1993:T 1984:1 1980:T 1971:2 1967:S 1958:1 1954:S 1945:2 1941:T 1932:2 1928:S 1921:1 1917:S 1908:1 1904:T 1885:. 1883:2 1880:T 1876:2 1873:S 1867:1 1864:S 1860:1 1857:T 1851:2 1848:S 1844:1 1841:S 1835:2 1832:T 1828:1 1825:T 1732:C 1728:A 1724:C 1720:B 1716:B 1712:A 1708:A 1704:A 1700:A 1693:B 1685:A 1677:B 1673:A 1669:B 1665:A 1644:B 1640:A 1632:B 1628:A 1578:T 1572:s 1562:T 1548:S 1542:s 1530:( 1528:S 1524:T 1496:} 1493:) 1490:e 1487:m 1484:a 1481:N 1478:s 1475:u 1472:n 1469:e 1466:G 1463:s 1460:i 1457:l 1454:e 1451:f 1448:, 1445:t 1442:a 1439:c 1436:( 1433:s 1430:u 1427:n 1424:e 1421:G 1418:f 1415:o 1406:e 1403:a 1400:n 1397:i 1394:l 1391:e 1388:F 1382:t 1379:a 1376:c 1373:{ 1370:= 1367:s 1364:i 1361:l 1358:e 1355:F 1328:} 1325:) 1322:e 1319:m 1316:a 1313:N 1310:y 1307:l 1304:i 1301:m 1298:a 1295:f 1292:b 1289:u 1286:S 1283:e 1280:a 1277:n 1274:i 1271:l 1268:e 1265:f 1262:, 1259:t 1256:a 1253:c 1250:( 1247:y 1244:l 1241:i 1238:m 1235:a 1232:f 1229:b 1226:u 1223:S 1220:f 1217:o 1208:e 1205:a 1202:d 1199:i 1196:l 1193:e 1190:F 1184:t 1181:a 1178:c 1175:{ 1172:= 1169:e 1166:a 1163:n 1160:i 1157:l 1154:e 1151:F 1118:. 1111:T 1095:s 1091:P 1082:T 1078:P 1074:= 1069:s 1065:P 1057:T 1053:= 1049:S 1034:S 1030:S 1014:s 1010:P 987:T 983:P 979:= 975:T 951:} 948:) 945:v 942:( 937:s 933:P 924:) 921:v 918:( 913:T 909:P 899:D 893:v 890:{ 887:= 884:S 861:} 858:) 855:v 852:( 847:T 843:P 833:D 827:v 824:{ 821:= 818:T 805:S 789:s 785:P 774:T 758:T 754:P 740:D 715:S 711:T 707:T 703:S 698:. 696:S 692:S 688:T 684:T 679:T 675:S 665:. 663:S 659:S 654:. 652:T 648:S 644:S 640:T 636:S 630:T 614:T 610:T 587:T 583:S 553:x 544:y 535:y 529:x 520:) 511:y 508:, 499:x 496:( 232:T 228:S 222:T 218:S 212:T 208:S 143:e 136:t 129:v 20:)

Index

Subtypes
Polymorphism
Ad hoc polymorphism
Function overloading
Operator overloading
Parametric polymorphism
Generic function
Generic programming
Subtyping
Virtual function
Single and dynamic dispatch
Double dispatch
Multiple dispatch
Predicate dispatch
v
t
e
programming language theory
type polymorphism
datatype
substitutability
subroutines
relation
type formalism
programming language
type system
trivial
object-oriented programming
parametric polymorphism
generic programming

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑