人走了说什么安慰的话| 7月15是什么节| 南乳和腐乳有什么区别| 什么是纸片人| 房颤是什么意思| 什么样的刘胡兰| 新生儿拉稀是什么原因| 偏头疼是什么原因引起| 宝宝爱出汗是什么原因| 夏天脚底冰凉是什么原因| 胸外扩是什么样子| 金鱼吃什么食物| 不为良相便为良医是什么意思| 梦见挖坑什么意思| 副乳是什么| 阳历2月份是什么星座| 孕妇吃什么坚果比较好| 农历七月初五是什么星座| 长公主是皇上的什么人| 淋巴发炎挂什么科| 酒后吐吃什么可以缓解| 血氧饱和度低于90有什么危害| 药物流产吃什么药| 喝什么酒不会胖| 燕窝什么人不适合吃| 录取线差是什么意思| 三维彩超主要检查什么| 慢性萎缩性胃炎是什么意思| f4什么意思| 猴和什么属相相冲相克| 叶子发黄缺什么肥| 人为什么要生孩子| 乌龙是什么意思| 不作为是什么意思| 法式刘海适合什么脸型| 果实属于什么器官| 空调买什么牌子好| 血肌酐低是什么原因| 水有什么作用| 室早三联律是什么意思| 眼睛里有红血丝是什么原因| 心律不齐是什么原因| 胃子老是胀气是什么原因| pp材质是什么| 氩弧焊对身体有什么危害| 苍茫的天涯是我的爱是什么歌| 心血管狭窄吃什么药| 屡试不爽是什么意思| 1999属什么生肖| 月月红是什么花| 土的行业有什么工作| 大尾巴狼是什么意思| 西咪替丁是治什么病| 靖国神社是什么地方| 故人是什么意思| 阻生智齿是什么意思| 清华大学什么时候成立| 颈椎病头疼吃什么药| 老子是什么时期的人| 男性生殖系统感染吃什么药| 霍光和卫子夫什么关系| 小孩爱流鼻血是什么原因| 闭关什么意思| 移车打什么电话| 神经衰弱是什么意思| 梦见自己牙齿掉光了是什么征兆| 闲情雅致是什么意思| 低血钾吃什么补上来的快| 榔头是什么意思| 大海里面有什么| 天体是什么| 梦见自己和别人结婚是什么意思| 清明节的习俗有什么| 浅绿色配什么颜色好看| 工程院院士是什么级别| 颈椎病挂号挂什么科| 大学有什么专业适合女生| 什么样的人死后还会出现| 辛辣的辛是什么意思| 剌是什么意思| 宫腔积液吃什么药效果最好| 4月17日是什么星座| 女性腹部彩超检查什么| 雷同是什么意思| 菠菜不能和什么食物一起吃| 小孩手足口病吃什么食物好| 机警是什么意思| 血管瘤是什么样子的| 婴儿大便隐血阳性是什么意思| 轻度脑萎缩是什么意思| 黄疸肝炎有什么症状| 公历是什么历| 女人吃牛蛙有什么好处| 博士点是什么意思| 水果都有什么| 为什么屁股上会长痘| 左眼皮老跳是什么原因| 什么的杏花| 什么东西止血最快最好| 安琪儿是什么意思| 腋毛什么时候开始生长| 花名册是什么意思| 阳历8月份是什么星座| 嘴巴臭是什么原因| 氯雷他定片是治什么的| 我知道你在想什么| 包干费用是什么意思| 撕裂是什么意思| 男性性功能减退吃什么药| 84年属鼠是什么命| 九加虎念什么| 肋骨突出是什么原因| 喝醋有什么好处和坏处| 太子是什么生肖| 高铁与动车的区别是什么| 劲酒是什么酒| e代表什么方向| 梦见死人是什么意思| 吃洋葱有什么好处和坏处| reald厅什么意思| 什么是阴道炎| 8月29日是什么星座| 梦到一个人意味着什么| 矿油是什么| 女性分泌物少是什么原因| 皮肤白斑是什么原因| 口水粘稠是什么原因| 女性膀胱炎是什么症状| 十二月十四日是什么星座| 丝瓜有什么好处| 尿发黄是什么原因男性| 什么方什么计| 北方的木瓜叫什么| 筋膜刀是什么| se是什么意思| 胚由什么发育而来| 磨平了棱角是什么意思| 纳豆激酶有什么作用| 背部疼痛是什么原因引起的| 皮肤瘙痒用什么药膏| 拉肚子可以吃什么药| 九宫八卦是什么意思| 吃葡萄有什么好处| 什么是地中海贫血| 一只眼睛肿了是什么原因| 阳虚吃什么中药| mr是什么意思| 蜱虫长什么样子| 男人射精什么感觉| 总是想吐是什么原因| 盆腔镜检查是查什么的| 晚上八点多是什么时辰| 什么粥最养胃| 大脑供血不足用什么药| 乳酸是什么东西| 蜗牛吃什么| 妇检tct是什么检查| 展望未来什么意思| ecg医学上什么意思| 牙齿上有黄斑是什么原因| 人为什么会胖| 10.19什么星座| 大便泡沫状是什么原因| 河蟹吃什么食物| b3是什么维生素| 气滞血瘀吃什么药| 12月27号是什么星座| 豆角没熟中毒什么症状| 小孩自闭症有什么表现| 买买提是什么意思| 经常射精有什么危害| 五行属火适合什么行业| ngu是什么意思| 枸杞子和什么泡水喝补肾壮阳| 雯是什么意思| 什么什么不宁| 手指疣初期什么样子| 梦见自己的手镯断了什么意思| 室内用什么隔墙最便宜| 冷暴力什么意思| 血稠是什么原因引起的| 马脸是什么脸型| 过敏性紫癜是什么原因引起的| 肝气郁结吃什么药| 照顾是什么意思| 2t是什么意思| 左眉上方有痣代表什么| 观音菩萨属什么生肖| 杜牧号什么| 蚧壳虫用什么药最有效| 什么的医术| 美国为什么要打伊拉克| 孕妇吃什么鱼好| 什么学步成语| 观音土为什么能吃| 木瓜有什么功效| bbq是什么| 处女女和什么星座最配| 左束支传导阻滞是什么意思| 冒菜为什么叫冒菜| 蚊子不喜欢什么味道| ace什么意思| iu是什么意思| 陈百强属什么生肖| 蝙蝠属于什么类| 左下眼皮跳是什么原因| 东山再起是什么生肖| 7月15是什么星座的| 饺子都有什么馅| 张信哲为什么不结婚| 经常自言自语是什么原因| 手脱皮是缺什么| 白细胞高什么原因| 针灸后需要注意什么| 尿潴留是什么原因引起的| 口苦口臭口干吃什么药| 他达拉非是什么药| 女性尿频尿急是什么原因| 困惑什么意思| 为什么屎是臭的| 上马是什么意思| 瞑眩反应是什么意思| 1902年属什么生肖| 强直性脊柱炎什么症状| 心肌缺血吃什么中药| 差强人意是什么意思| 墨镜镜片什么材质好| 惜败是什么意思| 梦见打群架是什么意思| hcd是什么意思| 红色配什么颜色好看| 云南白药里的保险子有什么作用| 脚有点浮肿是什么原因| 吗啡是什么药| 眼疲劳用什么眼药水| 中风吃什么药好| 脂肪液化是什么意思| 花什么叶什么| 吃什么补充膝盖润滑液| 爱哭的人是什么性格| 碳水化合物指的是什么| nba打铁是什么意思| 一只脚心疼是什么原因| 什么叫眼睛散光| 继续近义词是什么| 乳铁蛋白对宝宝有什么好处| 什么是芡实| 糖醇是什么意思| 玫瑰金是什么颜色| 三色堇的花语是什么| 冰柜什么牌子好| 赤日对什么| 28岁属相是什么生肖| 增大摩擦力的方法有什么| 凉拌菜用什么醋好| 妇科炎症吃什么消炎药效果好| 肠炎不能吃什么东西| 冬天怕冷夏天怕热是什么原因| 最近天气为什么这么热| 恐龙的祖先是什么| 虚热吃什么药| 喜形于色是什么意思| 继承衣钵是什么意思| 牡丹和芍药有什么区别| 百度Jump to content

宿迁沭阳推进花木新经济就地扩散 销售额一年增12亿元

From Wikipedia, the free encyclopedia
(Redirected from Subtypes)
百度 主要解决了两方面的关系:中国特色和世界一流的关系,人文类高校和理工类高校的区别和联系。

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

If S is a subtype of T, the subtyping relation (written as S <: T,  S ? T,[1] or  S ≤: T ) means that any term of type S can safely be used in any context where a term of type T is expected. 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. The type system of a programming language essentially defines its own subtyping relation, which may well be trivial, should the language support no (or very little) conversion mechanisms.

Due to the subtyping relation, a term may belong to more than one type. Subtyping is therefore a form of type polymorphism. In object-oriented programming the term 'polymorphism' is commonly used to refer solely to this subtype polymorphism, while the techniques of parametric polymorphism would be considered generic programming.

Functional programming languages often allow the subtyping of records. Consequently, simply typed lambda calculus extended with record types is perhaps the simplest theoretical setting in which a useful notion of subtyping may be defined and studied.[2] Because the resulting calculus allows terms to have more than one type, it is no longer a "simple" type theory. Since functional programming languages, by definition, support function literals, 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 system F<:. Various calculi that attempt to capture the theoretical properties of object-oriented programming may be derived from system F<:.

The concept of subtyping is related to the linguistic notions of hyponymy and holonymy. It is also related to the concept of bounded quantification in mathematical logic (see Order-sorted logic). Subtyping should not be confused with the notion of (class or object) inheritance from object-oriented languages;[3] 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, subtyping is called interface inheritance, with inheritance referred to as implementation inheritance.

Origins

[edit]

The notion of subtyping in programming languages dates back to the 1960s; it was introduced in Simula derivatives. The first formal treatments of subtyping were given by John C. Reynolds in 1980 who used category theory to formalize implicit conversions, and Luca Cardelli (1985).[4]

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 Liskov substitution principle, after Barbara Liskov who popularized it in a keynote 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 Jeannette Wing, called behavioral subtyping is considerably stronger than what can be implemented in a type checker. (See § Function types below for details.)

Examples

[edit]
Example of subtypes: where bird is the supertype and all others are subtypes as denoted by the arrow in UML notation

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

As a more practical example, a language might allow integer values to be used wherever floating point values are expected (Integer <: Float), or it might define a generic type Number as a common supertype of integers and the reals. In this second case, we only have Integer <: Number and Float <: Number, but Integer and Float are not subtypes of each other.

Programmers may take advantage of subtyping to write code in a more abstract manner than would be possible without it. Consider the following example:

function max (x as Number, y as Number) is
    if x < y then
        return y
    else
        return x
end

If integer and real are both subtypes of Number, 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 bounded polymorphism.

Subtyping enables a given type to be substituted for another type or abstraction. Subtyping is said to establish an is-a relationship between the subtype and some existing abstraction, either implicitly or explicitly, depending on language support. The relationship can be expressed explicitly via inheritance in languages that support inheritance as a subtyping mechanism.

C++

[edit]

The following C++ code establishes an explicit inheritance relationship between classes B and A, where B is both a subclass and a subtype of A, and can be used as an A wherever a B is specified (via a reference, a pointer or the object itself).

class A
{ public:
   void DoSomethingALike() const {}
};

class B : public A
{ public:
   void DoSomethingBLike() const {}
};

void UseAnA(A const& some_A)
{
   some_A.DoSomethingALike();
}

void SomeFunc()
{
   B b;
   UseAnA(b); // b can be substituted for an A.
}

[5]

Python

[edit]

The following python code establishes an explicit inheritance relationship between classes B and A, where B is both a subclass and a subtype of A, and can be used as an A wherever a B is required.

class A:
    def do_something_a_like(self):
        pass

class B(A):
    def do_something_b_like(self):
        pass

def use_an_a(some_a):
    some_a.do_something_a_like()

def some_func():
    b = B()
    use_an_a(b)  # b can be substituted for an A.

The following example, type(a) is a "regular" type, and type(type(a)) is a metatype. While as distributed all types have the same metatype (PyType_Type, which is also its own metatype), this is not a requirement. The type of classic classes, known as types.ClassType, can also be considered a distinct metatype.[6]

>>> a = 0
>>> type(a)
<type 'int'>
>>> type(type(a))
<type 'type'>
>>> type(type(type(a)))
<type 'type'>
>>> type(type(type(type(a))))
<type 'type'>

Java

[edit]

In Java, is-a relation between the type parameters of one class or interface and the type parameters of another are determined by the extends and implements clauses.

Using the Collections classes, ArrayList<E> implements List<E>, and List<E> extends Collection<E>. So ArrayList<String> is a subtype of List<String>, which is a subtype of Collection<String>. The subtyping relationship is preserved between the types automatically. When defining an interface, PayloadList, that associates an optional value of generic type P with each element, its declaration might look like:

interface PayloadList<E, P> extends List<E> {
    void setPayload(int index, P val);
    ...
}

The following parameterizations of PayloadList are subtypes of List<String>:

PayloadList<String, String>
PayloadList<String, Integer>
PayloadList<String, Exception>

Subsumption

[edit]

In type theory the concept of subsumption[7] is used to define or evaluate whether a type S is a subtype of type T.

A type is a set of values. The set can be described extensionally by listing all the values, or it can be described intensionally 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. User-defined types 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.

In discussing the concept of subsumption, the set of values of a type is indicated by writing its name in mathematical italics: T. The type, viewed as a predicate over a domain, is indicated by writing its name in bold: T. The conventional symbol <: means "is a subtype of", and :> means "is a supertype of".[citation needed]

  • A type T subsumes S if the set of values T which it defines, is a superset of the set S, so that every member of S is also a member of T.
  • A type may be subsumed by more than one type: the supertypes of S intersect at S.
  • If S <: T (and therefore S ? T ), then T, the predicate which circumscribes the set T, must be part of the predicate S (over the same domain) which defines S.
  • If S subsumes T, and T subsumes S, then the two types are equal (although they may not be the same type if the type system distinguishes types by name).

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 relevance 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 prevalence of the subtype (the number of situations which are able to generate or produce it).

In the context of subsumption, the type definitions can be expressed using Set-builder notation, which uses a predicate to define a set. Predicates can be defined over a domain (set of possible values) D. 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.)

If there are two predicates, which applies selection criteria for the type T, and which applies additional criteria for the type S, then sets for the two types can be defined:

The predicate is applied alongside as part of the compound predicate S defining S. The two predicates are conjoined, so both must be true for a value to be selected. The predicate subsumes the predicate T, so S <: T.

For example: there is a subfamily of cat species called Felinae, which is part of the family Felidae. The genus Felis, to which the domestic cat species Felis catus belongs, is part of that subfamily.

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, Felis <: Felinae <: Felidae.

If T subsumes S (T :> S) then a procedure, function or expression given a value as an operand (parameter value or term) will therefore be able to operate over that value as one of type T, because . In the example above, we could expect the function ofSubfamily to be applicable to values of all three types Felidae, Felinae and Felis.

Subtyping schemes

[edit]

Type theorists make a distinction between nominal subtyping, in which only types declared in a certain way may be subtypes of each other, and structural subtyping, 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 A can handle all of the messages that objects of type B can handle (that is, if they define all the same methods), then A is a subtype of B regardless of whether either inherits from the other. This so-called duck typing is common in dynamically typed object-oriented languages. Sound structural subtyping rules for types other than object types are also well known.[citation needed]

Implementations of programming languages with subtyping fall into two general classes: inclusive implementations, in which the representation of any value of type A also represents the same value at type B if A <: B, and coercive implementations, in which a value of type A can be automatically converted into one of type B. 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.

In almost all type systems that define a subtyping relation, it is reflexive (meaning A <: A for any type A) and transitive (meaning that if A <: B and B <: C then A <: C). This makes it a preorder on types.

Record types

[edit]

Width and depth subtyping

[edit]

Types of records give rise to the concepts of width and depth subtyping. These express two different ways of obtaining a new type of record that allows the same operations as the original record type.

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.

One kind of way to achieve such support, called width subtyping, 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.

The second method, called depth subtyping, 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 Variance).

Subtyping of records can be defined in System F<:, which combines parametric polymorphism with subtyping of record types and is a theoretical basis for many functional programming languages that support both features.

Some systems also support subtyping of labeled disjoint union types (such as algebraic data types). The rule for width subtyping is reversed: every tag appearing in the width subtype must appear in the width supertype.

Function types

[edit]

If T1T2 is a function type, then a subtype of it is any function type S1S2 with the property that T1 <: S1 and S2 <: T2. This can be summarised using the following typing rule:

The parameter type of S1S2 is said to be contravariant because the subtyping relation is reversed for it, whereas the return type is covariant. 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 Scala: a n-ary function is internally a class that inherits the trait (which can be seen as a general interface in Java-like languages), where are the parameter types, and is its return type; "?" before the type means the type is contravariant while "+" means covariant.

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 behavioral subtyping, which besides the type system safety discussed in this article also requires that subtypes preserve all invariants guaranteed by the supertypes in some contract.[8] This definition of subtyping is generally undecidable, so it cannot be verified by a type checker.

The subtyping of mutable references is similar to the treatment of parameter values and return values. Write-only references (or sinks) are contravariant, like parameter values; read-only references (or sources) are covariant, like return values. Mutable references which act as both sources and sinks are invariant.

Relationship with inheritance

[edit]

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 S and T, all combinations of subtyping and inheritance are possible:

  1. S is neither a subtype nor a derived type of T
  2. S is a subtype but is not a derived type of T
  3. S is not a subtype but is a derived type of T
  4. S is both a subtype and a derived type of T

The first case is illustrated by independent types, such as Boolean and Float.

The second case can be illustrated by the relationship between Int32 and Int64. In most object oriented programming languages, Int64 are unrelated by inheritance to Int32. However Int32 can be considered a subtype of Int64 since any 32 bit integer value can be promoted into a 64 bit integer value.

The third case is a consequence of function subtyping input contravariance. Assume a super class of type T having a method m returning an object of the same type (i.e. the type of m is TT, also note that the first parameter of m is this/self) and a derived class type S from T. By inheritance, the type of m in S is SS.[citation needed] In order for S to be a subtype of T the type of m in S must be a subtype of the type of m in T [citation needed], in other words: SS ≤: TT. 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. Since inheritance is an irreflexive relation, S can't be a subtype of T.

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 .[3]

Coercions

[edit]

In coercive subtyping systems, subtypes are defined by explicit type conversion functions from subtype to supertype. For each subtyping relationship (S <: T), a coercion function coerce: ST is provided, and any object s of type S is regarded as the object coerceST(s) of type T. A coercion function may be defined by composition: if S <: T and T <: U then s may be regarded as an object of type u under the compound coercion (coerceTU ° coerceST). The type coercion from a type to itself coerceTT is the identity function idT.

Coercion functions for records and disjoint union 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 f'(t) = coerceS2T2(f(coerceT1S1(t))), reflecting the contravariance of parameter values and covariance of return values.

The coercion function is uniquely determined given the subtype and supertype. 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 : int can be coerced to a floating point number (say, 2.0 : float), then it is not admissible to coerce 2.1 : float to 2 : int, because the compound coercion coercefloatfloat given by coerceintfloat ° coercefloatint would then be distinct from the identity coercion idfloat.

See also

[edit]

Notes

[edit]
  1. ^ Copestake, Ann. Implementing typed feature structure grammars. Vol. 110. Stanford: CSLI publications, 2002.
  2. ^ 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, 1988.
  3. ^ a b Cook, Hill & Canning 1990.
  4. ^ Pierce, ch. 15 notes
  5. ^ Mitchell, John (2002). "10 "Concepts in object-oriented languages"". Concepts in programming language. Cambridge, UK: Cambridge University Press. p. 287. ISBN 0-521-78098-5.
  6. ^ Guido van Rossum. "Subtyping Built-in Types". Retrieved 2 October 2012.
  7. ^ Benjamin C. Pierce, Types and Programming Languages, MIT Press, 2002, 15.1 "Subsumption", p. 181-182
  8. ^ Barbara Liskov, Jeannette Wing, A behavioral notion of subtyping, ACM Transactions on Programming Languages and Systems, Volume 16, Issue 6 (November 1994), pp. 1811–1841. An updated version appeared as CMU technical report: Liskov, Barbara; Wing, Jeannette (July 1999). "Behavioral Subtyping Using Invariants and Constraints" (PS). Retrieved 2025-08-06.

References

[edit]

Textbooks

  • Benjamin C. Pierce, Types and programming languages, MIT Press, 2002, ISBN 0-262-16209-1, chapter 15 (subtyping of record types), 19.3 (nominal vs. structural types and subtyping), and 23.2 (varieties of polymorphism)
  • C. Szyperski, D. Gruntz, S. Murer, Component software: beyond object-oriented programming, 2nd ed., Pearson Education, 2002, ISBN 0-201-74572-0, pp. 93–95 (a high-level presentation aimed at programming language users)

Papers

Cook, William R.; Hill, Walter; Canning, Peter S. (1990). Inheritance is not subtyping. Proc. 17th ACM SIGPLAN-SIGACT Symp. on Principles of Programming Languages (POPL). pp. 125–135. CiteSeerX 10.1.1.102.8635. doi:10.1145/96709.96721. ISBN 0-89791-343-4.
  • 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 John C. Mitchell, editors, Theoretical Aspects of Object-Oriented Programming: Types, Semantics, and Language Design (MIT Press, 1994).

Further reading

[edit]
低压48有什么危险 honor是什么牌子手机 相位是什么意思 翼字五行属什么 室间隔缺损是什么意思
水过鸭背是什么意思 天冬氨酸氨基转移酶高是什么原因 六月是什么生肖 痱子涂什么药膏好 玉竹长什么样子
铁观音是什么茶类 瓜子脸配什么发型好看 精神病的前兆是什么 眼皮发黑是什么病症 阴虱长什么样
马什么梅 凯旋归来是什么意思 小龙虾什么季节吃最好 窦性心动过速什么意思 乳牙是什么
举重的器材叫什么gangsutong.com trab是甲状腺什么指标hcv9jop6ns6r.cn 望尘莫及什么意思hcv8jop4ns3r.cn 牛皮癣用什么药hcv9jop4ns7r.cn 孕吐吃什么药zhiyanzhang.com
脉率是什么hcv9jop8ns3r.cn 梦见很多蛇是什么意思jiuxinfghf.com 老花眼有什么症状hcv9jop0ns8r.cn 95是什么意思hcv9jop8ns3r.cn 牙膏什么牌子最好hcv8jop2ns6r.cn
少叙痣是什么意思hcv8jop8ns1r.cn 那敢情好是什么意思hcv8jop1ns6r.cn 足字旁的字和什么有关cl108k.com 专升本要考什么hcv7jop7ns4r.cn 多囊肾是什么病hcv9jop7ns3r.cn
乳腺钼靶是什么hcv7jop9ns1r.cn 男人蛋疼是什么原因hcv9jop2ns4r.cn 什么样的笑脸hcv8jop2ns8r.cn 什么中药补肾hcv8jop3ns0r.cn dwi呈高信号什么意思hcv9jop0ns6r.cn
百度