族谱网 头条 人物百科

实化

2020-10-16
出处:族谱网
作者:阿族小谱
浏览:677
转发:0
评论:0
在程序设计语言中的实化与反射在程序设计语言中,把用户程序或者程序设计语言某一部分本来在编译期与运行期是隐式的,表示为语言自身,这一过程称为实化。这使得其对程序可当作普通数据来利用。在具有反射的程序设计语言中,实化的数据表示了相关的被实化的领域。实化的数据常被称作头等对象。C语言中,把内存地址的底层细节实化为指针。例如:char*buffer=(char*)0xB800000;基于λ演算的函数式程序设计语言,把过程抽象(procedureabstraction)与过程应用(procedureapplication)的概念实化为λ表达式。Scheme语言实化了延续性(粗略说近似于运行期上下文环境)。C#实化了参数多态为多态,成为语言的头等特征。Java中存在“可实化的类型”(reifiabletypes),其编译期信息在运行期保留并可完全利用。REBOL实化了代码与数据的相互转换。许多语言,如...

在程序设计语言中的实化与反射

在程序设计语言中,把用户程序或者程序设计语言某一部分本来在编译期与运行期是隐式的,表示为语言自身,这一过程称为实化。这使得其对程序可当作普通数据来利用。在具有反射的程序设计语言中,实化的数据表示了相关的被实化的领域。实化的数据常被称作头等对象。

C语言中,把内存地址的底层细节实化为指针。例如:char* buffer = (char*) 0xB800000;

基于λ演算的函数式程序设计语言,把过程抽象(procedure abstraction)与过程应用(procedure application)的概念实化为λ表达式。

Scheme语言实化了延续性(粗略说近似于运行期上下文环境)。

C#实化了参数多态为多态,成为语言的头等特征。

Java中存在“可实化的类型”(reifiable types),其编译期信息在运行期保留并可完全利用。

REBOL实化了代码与数据的相互转换。

许多语言,如Curl,JavaScript, 与Lisp等提供了eval或evaluate过程使其有解释器的功能。

Prolog语言的Logtalk(英语:Logtalk)框架提供了逻辑程序设计上下文的实化。

Smalltalk与参与者模式的语言实化了块(block)与messages。

Smalltalk-80把源代码编译为字节码,这是首例。

数据实化

数据实化涉及在形式规范(英语:formal specification)中找到抽象数据类型的更为具体的表示。 例如,抽象数据类型集合(set)可以用map或者array来实化。

概念建模中的实化

概念建模(英语:Conceptual model (computer science))中广泛使用了实化。实化一个关系(relationship)意味着把它视作一个实体。实化一个关系的目的是令其显式,必要时可以增加额外的信息。例如,关系IsMemberOf(member:Person, Committee)表示某人是某委员会的成员。下图左侧用表的形式列出了人P1是委员会C1与C2的成员;人P2是委员会C1成员。

实化

Example population of 关系IsMemberOf的实化。

这一关系,也可看作实体。见图示的右侧。称作该实体实化了这个关系。这个实体类型为Membership。现在,可以给这个关系实体增加新的信息,如某人属于某委员会是由谁来提名加入的,可表示为IsNominatedBy(Membership, Person)。

与其密切相关的用法见实化 (知识表示)(英语:Reification (knowledge representation))。

实化在UML中

实化

UML的类图表示Membership关系例子。

UML提供了关联类(association class)用于构建被实化的关系类型。关联类既是关联又是类。

一些未翻译的非现代汉语已进行隐藏,欢迎参与翻译。Reification on Semantic WebRDF and OWLIn Semantic Web languages, such as Resource Description Framework (RDF) and Web Ontology Language (OWL), a statement is a binary relation. It is used to link two individuals or an individual and a value. Applications sometimes need to describe other RDF statements, for instance, to record information like when statements were made, or who made them, which is sometimes called "provenance" information. As an example, we may want to represent properties of a relation, such as our certainty about it, severity or strength of a relation, relevance of a relation, and so on.The example from the conceptual modeling section describes a particular person with URIref person:p1, who is a member of the committee:c1. The RDF triple from that description isperson:p1committee:isMemberOfcommittee:c1.Consider to store two further facts: (i) to record who nominated this particular person to this committee (a statement about the membership itself), and (ii) to record who added the fact to the database (a statement about the statement).The first case is a case of classical reification like above in UML: reify the membership and store its attributes and roles etc.:committee:Membershiprdf:typeowl:Class.committee:membership12345rdf:typecommittee:Membership.committee:membership12345committee:ofPersonperson:p1.committee:membership12345committee:inCommitteecommittee:c1.person:p2committee:nominatedcommittee:membership12345.Additionally, RDF provides a built-in vocabulary intended for describing RDF statements. A description of a statement using this vocabulary is called a reification of the statement. The RDF reification vocabulary consists of the type rdf:Statement, and the properties rdf:subject, rdf:predicate, and rdf:object.Using the reification vocabulary, a reification of the statement about the person"s membership would be given by assigning the statement a URIref such as committee:membership12345 so that describing statements can be written as follows:committee:membership12345Statrdf:typerdf:Statement.committee:membership12345Statrdf:subjectperson:p1.committee:membership12345Statrdf:predicatecommittee:isMemberOf.committee:membership12345Statrdf:objectcommittee:c1.These statements say that the resource identified by the URIref committee:membership12345Stat is an RDF statement, that the subject of the statement refers to the resource identified by person:p1, the predicate of the statement refers to the resource identified by committee:isMemberOf, and the object of the statement refers to the resource committee:c1. Assuming that the original statement is actually identified by committee:membership12345, it should be clear by comparing the original statement with the reification that the reification actually does describe it. The conventional use of the RDF reification vocabulary always involves describing a statement using four statements in this pattern. Therefore, they are sometimes referred to as the "reification quad".Using reification according to this convention, we could record the fact that person:p3 added the statement to the database byperson:p3committee:addedToDatabasecommittee:membership12345Stat.It is important to note that in the conventional use of reification, the subject of the reification triples is assumed to identify a particular instance of a triple in a particular RDF document, rather than some arbitrary triple having the same subject, predicate, and object. This particular convention is used because reification is intended for expressing properties such as dates of composition and source information, as in the examples given already, and these properties need to be applied to specific instances of triples. Note that the described triple (subject predicate object) itself is not implied by such a reification quad (and it is not necessary that it actually exists in the database). This allows also to use this mechanism to express which triples do not hold.The power of the reification vocabulary in RDF is restricted by the lack of a built-in means for assigning URIrefs to statements, so in order to express "provenance" information of this kind in RDF, one has to use some mechanism (outside of RDF) to assign URIs to individual RDF statements, then make further statements about those individual statements, using their URIs to identify them.Reification in Topic MapsIn an XML Topic Map (XTM), only a topic can have a name or play a role in an association. One may use an association to make an assertion about a topic, but one cannot directly make assertions about that assertion. However, it is possible to create a topic that reifies a non-topic construct in a map, thus enabling the association to be named and treated as a topic itself.Reification and n-ary relationsIn Semantic Web languages, such as RDF and OWL, a property is a binary relation used to link two individuals or an individual and a value. However, in some cases, the natural and convenient way to represent certain concepts is to use relations to link an individual to more than just one individual or value. These relations are called n-ary relations. Examples are representing relations among multiple individuals, such as a committee, a person who is a committee member and another person who has nominated the first person to become the committee member, or a buyer, a seller, and an object that was bought when describing a purchase of a book.A more general approach to reification is to create an explicit new class and n new properties to represent an n-ary relation, making an instance of the relation linking the n individuals an instance of this class. This approach can also be used to represent provenance information and other properties for an individual relation instance. :p1 a :Person ; :has_membership _:membership_12345 . _:membership_12345 a :Membership ; :committee :c1; :nominated_by :p2 . Reification vs. quotationIt is also important to note that the reification described here is not the same as "quotation" found in other languages. Instead, the reification describes the relationship between a particular instance of a triple and the resources the triple refers to. The reification can be read intuitively as saying "this RDF triple talks about these things", rather than (as in quotation) "this RDF triple has this form." For instance, in the reification example used in this section, the triple:committee:membership12345rdf:subjectperson:p1.describing the rdf:subject of the original statement says that the subject of the statement is the resource (the person) identified by the URIref person:p1. It does not state that the subject of the statement is the URIref itself (i.e., a string beginning with certain characters), as quotation would.

参见

指称语义

形式语义学

操作语义学


免责声明:以上内容版权归原作者所有,如有侵犯您的原创版权请告知,我们将尽快删除相关内容。感谢每一位辛勤著写的作者,感谢每一位的分享。

——— 没有了 ———
编辑:阿族小谱
发表评论
写好了,提交
{{item.label}}
{{commentTotal}}条评论
{{item.userName}}
发布时间:{{item.time}}
{{item.content}}
回复
举报
点击加载更多
打赏作者
“感谢您的打赏,我会更努力的创作”
— 请选择您要打赏的金额 —
{{item.label}}
{{item.label}}
打赏成功!
“感谢您的打赏,我会更努力的创作”
返回

更多文章

更多精彩文章
打赏
私信

推荐阅读

· 浙江省-衢州-开化金实
金实(1371~1439),字用诚,明代开化华埠镇庄埠人(今昌谷)。因-论治国之道,甚得明成祖赞赏,即入文渊阁,并参与《太祖实录》和《永乐大典》的编修。因编撰有功被选为东宫太子讲官,升左春坊司直。不久授卫王府左长史,入西掖,负责辅导诸王子。为仁宗、宣宗、英宗三代皇帝之师。
· 崔实
东汉政论家、农学家崔实简介,崔寔撰写的著作有哪些?崔实(又名崔寔),字子真,冀州(今河北安平一带人)。东汉后期政论家、农学家,著有《四民月令》、《政论》等,系东汉著名文学家崔瑗之后,与蔡邕(yong,一声)齐名,号称“崔蔡”。持家治黑暗,世家地主累世贵盛。他们除了拥有田园、苑囿外,还将西汉时少见的坞壁、营堑作为自家的庄园形式。庄园内聚族而居,宗族首脑、长者是庄园的统治核心。崔实就出生在这样一个名门高第的庄园主家庭。“崔氏有美才,兼以沉沦典籍,遂为儒家文林。”《后汉书·崔实列传》)崔实是继祖父崔之后崔氏在文林中最享有盛名的一个,他的父亲崔瑗虽然对农业生产十分重视,一次曾“为人开稻田数百顷”,但性格豪迈,不关心家中生计,偌大的庄园全由崔实母亲一人操持。崔实是个孝顺的孩子,看母亲辛苦,就学着帮助料理,他处处留心经营管理的经验,逐渐学得不少按照时令来安排耕织操作时间的知识。崔瑗去世后,崔家庄园经济...
· 我国姓氏文化中的“虚与实”
一、对远古史以虚论按一般历史时代划分,三皇五帝时代称远古时代;夏、西、周时期称上古时代;秦、汉至清末称中古时代;辛亥革命以后称近代。史书上,一般习惯将三皇五帝时代称为“传说时代”,“传说时期”,说明记载并不是很实在的,仅仅是口头“传说”而已。事实上,在远古时期,尚没有文字,对当时的人物与事件,也只能是“传说”。从今天严谨的角度看,许多这类历史传说是经不起推敲的。比如:传说伏羲与女娲创造了人类,可根据现代人整理的《三皇五帝年表》看,伏羲氏生于约公元前7724年,在位118年,女娲氏生于约公元前7000年,在位130年,二人岁数相差720年,可能是夫妻吗?又比如:史书上说少典生炎帝与黄帝,根据年表,炎帝神农氏生活于公元前3216—3077年,在位120年;黄帝生活在公元前2697—2597年,在位101年。二人年龄相差519年,可能是兄弟吗?炎、黄有可能联手与蚩尤逐鹿中原吗?而生于公元前237...
· 原博实
日本国家足球队从1978年到1988年,他共为日本国家足球队出场75次,打进37球。成绩外部链接
· 严实
生平严实幼警悟,略识诗书,为人好施与,志气豪放,喜与人结交。早年曾犯罪入狱,却被“侠少辈”救出。蒙古、金、宋争夺山东过程,严实展露头角。1213年,蒙古军队攻掠山东北还后,金东平行台调民为兵,严实被任命百夫长。次年击败张汝楫,升任长清尉。1218年六月权长清令,八月南宋攻益都,严实因外出长清失陷,但旋及收复。金朝东平行台疑严实与宋勾结,于是发兵围长清,严实降宋,任济南治中。严实四掠地,太行以东均为其所节制。1220年三月,金朝河南军攻彰德(今河南安阳),宋守将单仲求救,严实往救不及,单仲兵败被俘。严实从此役知南宋已不可靠,此后又拒绝金朝招抚。蒙古遣木华黎攻金,成吉思汗要求木华黎采取“招集豪杰,戡定未下之城”的战略,广泛招降各地官僚、土豪,并利用他们去扩大占领区。凡纳土归降、扩地有功者皆按其实力和地盘授与官职,并允许其世袭,管领原有地区及新占区,军民兼领,僚属自辟。这些掌控一方,享有较大自主...

关于我们

关注族谱网 微信公众号,每日及时查看相关推荐,订阅互动等。

APP下载

下载族谱APP 微信公众号,每日及时查看
扫一扫添加客服微信