About: Subtyping

An Entity of Type: Inflection113803782, from Named Graph: http://dbpedia.org, within Data Space: dbpedia.org

In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which 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, 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 p

Property Value
dbo:abstract
  • Στην θεωρία γλωσσών προγραμματισμού, πολυμορφισμός υποτύπων είναι μια μορφή πολυμορφισμού τύπων στην οποία ένας υποτύπος είναι ένας τύπος δεδομένων που σχετίζεται σε έναν άλλο τύπο δεδομένων (τον υπερτύπο) με ενός είδους , πράγμα που σημαίνει ότι οι δομές του προγράμματος, συνήθως υπορουτίνες ή συναρτήσεις που γράφτηκαν για να λειτουργούν πάνω σε στοιχεία του υπερτύπου μπορούν επίσης να λειτουργήσουν με τα στοιχεία του υποτύπου. Αν S είναι ένας υποτύπος του Τ, η υποτύπου γράφεται συχνά S <: Τ, που σημαίνει ότι οποιοσδήποτε όρος του τύπου S μπορεί "να χρησιμοποιηθεί με ασφάλεια σε ένα πλαίσιο όπου" αναμένεται ένας όρος του τύπου Τ. Οι ακριβής σημασιολογία του πολυμορφισμού υποτύπων εξαρτάται σε μεγάλο βαθμό από το τι ακριβώς σημαίνει "μπορεί να χρησιμοποιηθεί με ασφάλεια σε ένα πλαίσιο όπου" σε μία δεδομένη γλώσσα προγραμματισμού. Το σύστημα τύπων μιας γλώσσας προγραμματισμού καθορίζει ουσιαστικά τη δική του σχέση υποκατηγοριών, η οποία μπορεί κάλλιστα να είναι τετριμμένη. Επειδή η σχέση υποτύπου επιτρέπει ένας όρος να έχει (ανήκει σε) περισσότερους από έναν τύπο, οι υποτύποι είναι μια μορφή του , για αυτό ονομάζεται (ορθότερα) πολυμορφισμός υποτύπων. Στον αντικειμενοστρεφή προγραμματισμό, η σχέση υποτύπου ονομάζεται συχνά απλά "πολυμορφισμός" (βλ. ). Η σχέση υποτύπου δεν ονομάζεται σχεδόν ποτέ έτσι στην θεωρία τύπων ή στον συναρτησιακό προγραμματισμό, όπου απλώς ο όρος "πολυμορφισμός" αναφέρεται συνήθως σε παραμετρικό πολυμορφισμό, όπως στον . (Μηχανισμοί με παρόμοιο στόχο, αλλά μη ταυτόσημοι με τον παραμετρικό πολυμορφισμό, είναι γνωστοί με άλλα ονόματα στον αντικειμενοστρεφή προγραμματισμό, π.χ. ή .) Οι συχνά επιτρέπουν τη λειτουργία υποτύπων σε εγγραφές. Κατά συνέπεια, ο λ-λογισμός με απλό σύστημα τύπων επεκτεταμένος με τύπους εγγραφών είναι ίσως το πιο απλό θεωρητικό πλαίσιο στο οποίο μπορεί να οριστεί και να μελετηθεί κάποια χρήσιμη έννοια υποτύπου. Επειδή ο προκύπτων λογισμός επιτρέπει όρους που έχουν περισσότερους από έναν τύπο, δεν είναι πλέον μία "απλή" θεωρία τύπων. Δεδομένου ότι οι συναρτησιακές γλώσσες προγραμματισμού εξ' ορισμού υποστηρίζουν , που μπορούν επίσης να αποθηκεύονται σε εγγραφές, οι εγγραφές εφοδιασμένες με τη λειτουργία υποτύπου παρέχουν ορισμένα από τα χαρακτηριστικά του αντικειμενοστρεφούς προγραμματισμού (εκτός αν προστεθούν στη γλώσσα αναφορές, αυτά τα "αντικείμενα" είναι ). Συνήθως, οι συναρτησιακές γλώσσες προγραμματισμού παρέχουν επίσης κάποια, συνήθως περιορισμένη, μορφή παραμετρικού πολυμορφισμού. Σε ένα θεωρητικό πλαίσιο, είναι σκόπιμο να μελετήσει κανείς την αλληλεπίδραση των δύο χαρακτηριστικών. Ένα κοινό θεωρητικό πλαίσιο είναι το . Διάφοροι λογισμοί που επιχειρούν να συλλάβουν τις θεωρητικές ιδιότητες του αντικειμενοστρεφούς προγραμματισμού μπορεί να προκύψουν από το σύστημα F<:. Η έννοια των υποτύπων σχετίζεται με τις γλωσσικές έννοιες της και . Συνδέεται επίσης με την έννοια της στη μαθηματική λογική. Οι υποτύποι δεν πρέπει να συγχέονται με την έννοια της (κλάσεων ή αντικειμένων) των αντικειμενοστρεφών γλώσσών. Η σχέση υποτύπου είναι μια σχέση μεταξύ τύπων (διαπροσωπειών σε αντικειμενοστρεφές ιδίωμα), ενώ η κληρονομικότητα είναι μία σχέση μεταξύ υλοποιήσεων, που προκύπτει από μια κάποιο χαρακτηριστικό της γλώσσας το οποίο επιτρέπει σε νέα αντικείμενα να δημιουργηθούν από υπάρχοντα. Σε ορισμένες αντικειμενοστρεφείς γλώσσες, η σχέση υποτύπων καλείται κληρονομικότητα διαπροσωπειών. (el)
  • In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which 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, 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. 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; 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. (en)
  • サブタイピング(英: subtyping)や部分型とは、型のポリモーフィズムの形態であり、上位と定義された型を、その下位と定義された型で、型安全性に則って代替できるというの概念および実装を意味している。 スーパータイプは、そのサブタイプの数々によって代替/代入可能とされており、これは代入可能性(substitutability)と呼ばれる。そのスーパータイプとサブタイプの関係は、is-aとも言われる。記号<:を用いてsubtype <: supertypeと表記される。 スーパータイプ+サブタイプの概念はその時の用法で、上位型(supertype)+下位型(subtype)、基底型(base type)+派生型(derived type)、基本型(basic type)+拡張型(extend type)、上位型(supertype)+部分型(subtype) などの別称に使い分けられており、それぞれの性質にも差異がある。 (ja)
  • In informatica, e in particolare in programmazione, si definisce sottotipo un tipo di dato legato ad un altro tipo di dato, detto super-tipo, da una relazione di sostituibilità, intesa nel senso che un programma scritto per utilizzare elementi costruiti sul modello del supertipo, può funzionare anche con elementi costruiti sul modello del sottotipo. In generale, si assume che la relazione supertipo-sottotipo sia quella definita dal principio di sostituzione di Liskov. Ad esempio, un certo linguaggio potrebbe ammettere l'uso di valori interi al posto di valori floating point, oppure potrebbe definire un tipo numero in luogo del quale possono essere sia interi sia numeri con virgola. Nel primo caso il tipo intero sarebbe un sottotipo di floating point; nel secondo questi due tipi non avrebbero alcuna mutua relazione reciproca, ma entrambi sarebbero sottotipi di numero. (it)
  • Podtyp – konstrukcja programistyczna umożliwiająca w określonym języku programowania definiowanie ograniczeń na pewnym typie bazowym. Pojęcie podtypu zdefiniowane zostało wprost w języku Ada, w którym istnieje jednoznaczne odróżnienie deklaracji typu i podtypu, identyfikowane odpowiednim słowem kluczowym: * subtype – dla podtypów w odróżnieniu od * type – dla typów, w tym także typów pochodnych. Podtyp jest więc nałożeniem pewnego ograniczenia na pewien typ (w nomenklaturze języka Ada nazywany typem bazowym). W przypadku podtypów ograniczenia te dotyczą wyłącznie zakresu możliwych wartości należących do podtypu, stanowiących pewien podzbiór wyodrębniony ze zbioru możliwych wartości typu bazowego. Jest to więc różna konstrukcja w porównaniu z typem pochodnym, definiującym jednak nowy typ, mimo że również oparty na pewnym typie macierzystym. Przykład w Adzie: <b>subtype</b> <i>miesiąc</i> <b>is</b> INTEGER <b>range</b> 1..12; Na tak zdefiniowanym podtypie można wykonywać wszystkie te same operacje, które są dopuszczalne dla typu INTEGER, a ograniczony jest jedynie zakres wartości. Istnieją języki, w których występują konstrukcje analogiczne do podtypu, mimo że język nie definiuje wprost takiego pojęcia. Przykładem jest język Pascal, w którym występuje typ okrojony. Jego cechy są jednak takie, iż jest to podtyp pewnego typu bazowego. Typ bazowy w Pascalu musi być typem porządkowym. <b>type</b> <i>miesiąc</i>=1..12; Nie definiuje się tu wprost typu bazowego, wynika on z typu literałów użytych do ograniczenia zakresu wartości. Na wartościach takiego typu tak jak w podtypie dopuszczalne są wszystkie operacje typu bazowego. Nowy typ (podtyp) jest zgodny w sensie przypisania z typem bazowym. W języku Modula 2 typ bazowy, w definicji podtypu, może być wyspecyfikowany jawnie lub pominięty: * <b>TYPE</b> <i>miesiąc</i>=1..12 * <b>TYPE</b> <i>miesiąc</i>:INTEGER=1..12 (pl)
  • Polymorfism innebär inom programmering att en symbol, till exempel en variabel, inte har en fix datatyp utan att datatypen kan ändras under programmets gång. Variabeln kan till exempel börja med att vara en enkel variabeltyp, till exempel ett heltal (integer), och sedan bli en sammansatt variabeltyp (till exempel en array, eller ett objekt, eller en array av objekt), eller en funktion. Objektorienterade språk med statiska datatyper, till exempel C++ och Java, har bara möjlighet till begränsad polymorfism genom underklasser. Procedurorienterade språk med statiska datatyper som C och Pascal saknar polymorfism. Genuint polymorfa språk som Javascript har däremot polymorfismen inbyggd i språket så där definierar man ingen datatyp då man deklarerar en variabel utan datatypen avgörs av vilket värde variabeln senare tilldelas i programmet. I till exempel Javascript skriver man bara "var" då man deklarerar en variabel. Exempel i Javascript: var a; // a är en variabel, datatypen ännu odefinierad........a = 23; // a är ett tal (Javascript skiljer inte på heltal och flyttal)........a = "Text"; // a är en textsträng........a = [ 23, 45, 67 ]; // a är en array av tre tal........a = AnythingElse; // a har nu samma datatyp som "AnythingElse"........a = [ "Text1", 23, AnythingElse ]; // a är en array som innehåller blandade datatyper........ Script-språk som Javascript, Perl, PHP, Python brukar ha polymorfa variabler. Fördelen är större flexibilitet, nackdelen är att man inte har tillgång till strikt typkontroll som hjälpmedel vid avlusning. (sv)
  • 在编程语言理论中,子类型(动名词,英語:subtyping)是一种类型多态的形式。这种形式下,子类型(名词,英語:subtype)可以替换另一种相关的数据类型(超类型,英語:supertype)。也就是说,针对超类型元素进行操作的子程序、函数等程序元素,也可以操作相应的子类型。如果 S 是 T 的子类型,这种子类型关系通常写作 S <: T,意思是在任何需要使用 T 类型对象的环境中,都可以安全地使用 S 类型的对象。子类型的准确语义取决于具体的编程语言中「X 环境中,可以安全地使用 Y」的意义。编程语言的类型系统定义了各自不同的子类型关系。 由于子类型关系的存在,某个对象可能同时属于多种类型,因此,子类型(英語:subtyping)是一种类型多态的形式,也被称作子类型多态(英語:subtype polymorphism)或者包含多态(英語:inclusion polymorphism)。在面向对象程序设计中,多态一般仅指这里所说的「子类型多态」,而「参数多态」则一般被称作泛型编程。 子类型与面向对象语言中(类或对象)的继承是两个概念。子类型反映了类型(即面向对象中的接口)之间的关系;而继承反映了一类对象可以从另一类对象创造出来,是语言特性的实现。因此,子类型也称接口继承;继承称作实现继承。 (zh)
dbo:thumbnail
dbo:wikiPageID
  • 213508 (xsd:integer)
dbo:wikiPageLength
  • 25073 (xsd:nonNegativeInteger)
dbo:wikiPageRevisionID
  • 1118856289 (xsd:integer)
dbo:wikiPageWikiLink
dbp:wikiPageUsesTemplate
dcterms:subject
gold:hypernym
rdf:type
rdfs:comment
  • サブタイピング(英: subtyping)や部分型とは、型のポリモーフィズムの形態であり、上位と定義された型を、その下位と定義された型で、型安全性に則って代替できるというの概念および実装を意味している。 スーパータイプは、そのサブタイプの数々によって代替/代入可能とされており、これは代入可能性(substitutability)と呼ばれる。そのスーパータイプとサブタイプの関係は、is-aとも言われる。記号<:を用いてsubtype <: supertypeと表記される。 スーパータイプ+サブタイプの概念はその時の用法で、上位型(supertype)+下位型(subtype)、基底型(base type)+派生型(derived type)、基本型(basic type)+拡張型(extend type)、上位型(supertype)+部分型(subtype) などの別称に使い分けられており、それぞれの性質にも差異がある。 (ja)
  • 在编程语言理论中,子类型(动名词,英語:subtyping)是一种类型多态的形式。这种形式下,子类型(名词,英語:subtype)可以替换另一种相关的数据类型(超类型,英語:supertype)。也就是说,针对超类型元素进行操作的子程序、函数等程序元素,也可以操作相应的子类型。如果 S 是 T 的子类型,这种子类型关系通常写作 S <: T,意思是在任何需要使用 T 类型对象的环境中,都可以安全地使用 S 类型的对象。子类型的准确语义取决于具体的编程语言中「X 环境中,可以安全地使用 Y」的意义。编程语言的类型系统定义了各自不同的子类型关系。 由于子类型关系的存在,某个对象可能同时属于多种类型,因此,子类型(英語:subtyping)是一种类型多态的形式,也被称作子类型多态(英語:subtype polymorphism)或者包含多态(英語:inclusion polymorphism)。在面向对象程序设计中,多态一般仅指这里所说的「子类型多态」,而「参数多态」则一般被称作泛型编程。 子类型与面向对象语言中(类或对象)的继承是两个概念。子类型反映了类型(即面向对象中的接口)之间的关系;而继承反映了一类对象可以从另一类对象创造出来,是语言特性的实现。因此,子类型也称接口继承;继承称作实现继承。 (zh)
  • Στην θεωρία γλωσσών προγραμματισμού, πολυμορφισμός υποτύπων είναι μια μορφή πολυμορφισμού τύπων στην οποία ένας υποτύπος είναι ένας τύπος δεδομένων που σχετίζεται σε έναν άλλο τύπο δεδομένων (τον υπερτύπο) με ενός είδους , πράγμα που σημαίνει ότι οι δομές του προγράμματος, συνήθως υπορουτίνες ή συναρτήσεις που γράφτηκαν για να λειτουργούν πάνω σε στοιχεία του υπερτύπου μπορούν επίσης να λειτουργήσουν με τα στοιχεία του υποτύπου. Αν S είναι ένας υποτύπος του Τ, η υποτύπου γράφεται συχνά S <: Τ, που σημαίνει ότι οποιοσδήποτε όρος του τύπου S μπορεί "να χρησιμοποιηθεί με ασφάλεια σε ένα πλαίσιο όπου" αναμένεται ένας όρος του τύπου Τ. Οι ακριβής σημασιολογία του πολυμορφισμού υποτύπων εξαρτάται σε μεγάλο βαθμό από το τι ακριβώς σημαίνει "μπορεί να χρησιμοποιηθεί με ασφάλεια σε ένα πλαίσιο όπο (el)
  • In programming language theory, subtyping (also subtype polymorphism or inclusion polymorphism) is a form of type polymorphism in which 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, 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 p (en)
  • In informatica, e in particolare in programmazione, si definisce sottotipo un tipo di dato legato ad un altro tipo di dato, detto super-tipo, da una relazione di sostituibilità, intesa nel senso che un programma scritto per utilizzare elementi costruiti sul modello del supertipo, può funzionare anche con elementi costruiti sul modello del sottotipo. In generale, si assume che la relazione supertipo-sottotipo sia quella definita dal principio di sostituzione di Liskov. (it)
  • Podtyp – konstrukcja programistyczna umożliwiająca w określonym języku programowania definiowanie ograniczeń na pewnym typie bazowym. Pojęcie podtypu zdefiniowane zostało wprost w języku Ada, w którym istnieje jednoznaczne odróżnienie deklaracji typu i podtypu, identyfikowane odpowiednim słowem kluczowym: * subtype – dla podtypów w odróżnieniu od * type – dla typów, w tym także typów pochodnych. Przykład w Adzie: <b>subtype</b> <i>miesiąc</i> <b>is</b> INTEGER <b>range</b> 1..12; <b>type</b> <i>miesiąc</i>=1..12; * <b>TYPE</b> <i>miesiąc</i>=1..12 * <b>TYPE</b> <i>miesiąc</i>:INTEGER=1..12 (pl)
  • Polymorfism innebär inom programmering att en symbol, till exempel en variabel, inte har en fix datatyp utan att datatypen kan ändras under programmets gång. Variabeln kan till exempel börja med att vara en enkel variabeltyp, till exempel ett heltal (integer), och sedan bli en sammansatt variabeltyp (till exempel en array, eller ett objekt, eller en array av objekt), eller en funktion. Script-språk som Javascript, Perl, PHP, Python brukar ha polymorfa variabler. Fördelen är större flexibilitet, nackdelen är att man inte har tillgång till strikt typkontroll som hjälpmedel vid avlusning. (sv)
rdfs:label
  • Πολυμορφισμός υποτύπων (el)
  • Sottotipo (informatica) (it)
  • サブタイピング (計算機科学) (ja)
  • Podtyp (programowanie) (pl)
  • Subtyping (en)
  • Polymorfism (programmering) (sv)
  • 子类型 (zh)
owl:sameAs
prov:wasDerivedFrom
foaf:depiction
foaf:isPrimaryTopicOf
is dbo:wikiPageRedirects of
is dbo:wikiPageWikiLink of
is rdfs:seeAlso of
is foaf:primaryTopic of
Powered by OpenLink Virtuoso    This material is Open Knowledge     W3C Semantic Web Technology     This material is Open Knowledge    Valid XHTML + RDFa
This content was extracted from Wikipedia and is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License