Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Reification (computer science)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Formal methods terminology}} {{Other uses|Reification (disambiguation)}} In [[computer science]], '''reification''' is the process by which an abstract idea about a [[computer program|program]] is turned into an explicit [[data model]] or other object created in a [[programming language]]. A computable/addressable object—a ''resource''—is created in a system as a proxy for a non computable/addressable object. By means of reification, something that was previously implicit, unexpressed, and possibly inexpressible is explicitly formulated and made available to conceptual (logical or computational) manipulation. Informally, reification is often referred to as "making something a [[first-class citizen]]" within the scope of a particular system. Some aspect of a system can be reified at ''language design time'', which is related to [[Reflection (computer science)|reflection]] in programming languages. It can be applied as a [[stepwise refinement]] at ''system design time''. Reification is one of the most frequently used techniques of [[conceptual analysis]] and [[knowledge representation]]. == Reflective programming languages == In the context of [[programming language]]s, reification is the process by which a user program or any aspect of a programming language that was implicit in the translated program and the run-time system, are expressed in the language itself. This process makes it available to the program, which can inspect all these aspects as ordinary [[data]]. In [[Reflection (computer science)|reflective languages]], reification data is causally connected to the related reified aspect such that a modification to one of them affects the other. Therefore, the reification data is always a faithful representation of the related reified aspect {{clarification needed|date=April 2017}}. Reification data is often said to be made a [[first class object]]{{citation needed|date=April 2017}}. Reification, at least partially, has been experienced in many languages to date: in early [[Lisp (programming language)|Lisp dialects]] and in current [[Prolog| Prolog dialects]], programs have been treated as data, although the causal connection has often been left to the responsibility of the programmer. In [[Smalltalk]]-80, the compiler from the source text to bytecode has been part of the run-time system since the very first implementations of the language.<ref>J. Malenfant, M. Jacques and F.-N. Demers, [http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/ref96/ref96.html A Tutorial on Behavioral Reflection and its Implementation] {{webarchive|url=https://web.archive.org/web/20100528214857/http://www2.parc.com/csl/groups/sda/projects/reflection96/docs/malenfant/ref96/ref96.html |date=2010-05-28 }}</ref> * The [[C (programming language)|C programming language]] reifies the low-level detail of [[memory address]]es.{{paragraph break}}Many programming language designs encapsulate the details of memory allocation in the compiler and the run-time system. In the design of the C programming language, the memory address is reified and is available for direct manipulation by other language constructs. For example, the following code may be used when implementing a memory-mapped device driver. The buffer pointer is a proxy for the memory address 0xB8000000.{{paragraph break}}<syntaxhighlight lang="c"> char* buffer = (char*) 0xB8000000; buffer[0] = 10; </syntaxhighlight> * [[Functional programming languages]] based on [[lambda-calculus]] reify the concept of a procedure abstraction and procedure application in the form of the [[Lambda calculus#Lambda calculus and programming languages|Lambda expression]]. * The [[Scheme (programming language)|Scheme]] programming language reifies [[continuations]] (approximately, the call stack). * In [[C Sharp (programming language)|C#]], reification is used to make [[parametric polymorphism]] implemented in the form of generics as a first-class feature of the language. * In the [[Java (programming language)|Java]] programming language, there exist "reifiable types" that are "completely available at run time" (i.e. their information is not erased during compilation).<ref>[http://docs.oracle.com/javase/specs/jls/se7/html/jls-4.html#jls-4.7 The Java Language Specification, section 4.7], Java SE 7 Edition</ref> * [[REBOL]] reifies code as data and vice versa. * Many languages, such as [[Lisp (programming language)|Lisp]], [[JavaScript]], and [[Curl (programming language)|Curl]], provide an [[eval|<code>eval</code> or <code>evaluate</code> procedure]] that effectively reifies the language interpreter. * The [[Logtalk]] framework for [[Prolog]] offers a means to explore reification in the context of [[logic programming]]. * [[Smalltalk]] and [[Actor model|Actor languages]] permit the reification of blocks and [[message passing|messages]],<ref>{{cite web|url=http://c2.com/cgi/wiki?SmalltalkBlocksAndClosures |title=Smalltalk Blocks And Closures |publisher=C2.com |date=2009-10-15 |accessdate=2010-10-09}}</ref> which are equivalent of lambda expressions in Lisp, and <code>thisContext</code> in Smalltalk, which is a reification of the current executing block. * [[Homoiconicity|Homoiconic languages]] reify the syntax of the language as data that is understood by the language itself. This allows the user to write programs whose inputs and outputs are code (see [[Macro (computer science)|macros]], [[eval]]). Common representations of code include [[S-Expression|S-expressions]] (e.g. [[Clojure]], [[Lisp]]), and [[abstract syntax tree|abstract syntax trees]] (e.g [[Rust]]). == Data reification vs. data refinement == Data reification ([[stepwise refinement]]) involves finding a more concrete representation of the [[abstract data type]]s used in a [[formal specification]]. Data reification is the terminology of the [[Vienna Development Method]] (VDM) that most other people would call data refinement. An example is taking a step towards an implementation by replacing a data representation without a counterpart in the intended implementation language, such as sets, by one that does have a counterpart (such as maps with fixed domains that can be implemented by arrays), or at least one that is closer to having a counterpart, such as sequences. The VDM community prefers the word "reification" over "refinement", as the process has more to do with concretising an idea than with refining it.<ref>[https://www.cs.tcd.ie/FME/original/FAQ/vdm/part13.html Formal Methods Europe, Frequently Asked Questions, part 13] {{webarchive|url=https://web.archive.org/web/20050312031255/http://www.cs.tcd.ie/FME/original/FAQ/vdm/part13.html |date=2005-03-12 }}.</ref> For similar usages, see [[Reification (linguistics)]]. == In conceptual modeling == Reification is widely used in [[Conceptual model (computer science)|conceptual modeling]].<ref>Antoni Olivé, [http://www-pagines.fib.upc.es/~modeling/Preface.pdf Conceptual Modeling of Information Systems], Springer Verlag, 2007.</ref> Reifying a relationship means viewing it as an entity. The purpose of reifying a relationship is to make it explicit, when additional information needs to be added to it. Consider the relationship type ''<code>IsMemberOf(member:Person, Committee)</code>''. An instance of ''<code>IsMemberOf</code>'' is a relationship that represents the fact that a person is a member of a committee. The figure below shows an example population of ''<code>IsMemberOf</code>'' relationship in tabular form. Person ''P1'' is a member of committees ''C1'' and ''C2''. Person ''P2'' is a member of committee ''C1'' only. [[File:reification example1.png|500px|thumb|Example population of <code>IsMemberOf</code> relationship in tabular form. Person P1 is a member of committees C1 and C2. Person P2 is a member of committee C1 only.]] The same fact, however, could also be viewed as an entity. Viewing a relationship as an entity, one can say that the entity reifies the relationship. This is called reification of a relationship. Like any other entity, it must be an instance of an entity type. In the present example, the entity type has been named <code>Membership</code>. For each instance of ''<code>IsMemberOf</code>'', there is one and only one instance of ''<code>Membership</code>'', and vice versa. Now, it becomes possible to add more information to the original relationship. As an example, we can express the fact that "person p1 was nominated to be the member of committee c1 by person p2". Reified relationship ''<code>Membership</code>'' can be used as the source of a new relationship ''<code>IsNominatedBy(Membership, Person)</code>''. For related usages see [[Reification (knowledge representation)]]. == In Unified Modeling Language (UML) == [[File:reification example2.png|400px|thumb|The UML [[class diagram]] for the Membership example.]] [[Unified Modeling Language|UML]] provides an ''association class'' construct for defining reified relationship types. The association class is a single model element that is both a kind of association<ref>{{cite book |chapter=Associations |title=Unified Modeling Language 2.5.1 |series=[[Object Management Group |OMG]] Document Number formal/2017-12-05 |date=December 2017 |publisher=[[Object Management Group]] Standards Development Organization (OMG SDO) |page=199 |url=https://www.omg.org/spec/UML/2.5.1/PDF }} </ref> and a kind of class.<ref name=OMG>{{cite book |chapter=Classes |title=Unified Modeling Language 2.5.1 |series=[[Object Management Group |OMG]] Document Number formal/2017-12-05 |date=December 2017 |publisher=[[Object Management Group]] Standards Development Organization (OMG SDO) |page=194 |url=https://www.omg.org/spec/UML/2.5.1/PDF }} </ref> The association and the entity type that reifies are both the same model element. Note that attributes cannot be reified. == On Semantic Web == === RDF and OWL === In [[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 <code>URIref person:p1</code>, who is a member of the <code>committee:c1</code>. The RDF triple from that description is <syntaxhighlight lang="sparql"> person:p1 committee:isMemberOf committee:c1 . </syntaxhighlight> 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.: <syntaxhighlight lang="sparql"> committee:Membership rdf:type owl:Class . committee:membership12345 rdf:type committee:Membership . committee:membership12345 committee:ofPerson person:p1 . committee:membership12345 committee:inCommittee committee:c1 . person:p2 committee:nominated committee:membership12345 . </syntaxhighlight> 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 <code>rdf:Statement</code>, and the properties <code>rdf:subject</code>, <code>rdf:predicate</code>, and <code>rdf:object</code>.<ref name="rdf">{{cite web|url=http://www.w3.org/TR/2004/REC-rdf-primer-20040210/#reification |title=RDF Primer |publisher=W3.org |date= |accessdate=2010-10-09}}</ref> 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 <code>committee:membership12345</code> so that describing statements can be written as follows: <syntaxhighlight lang="sparql"> committee:membership12345Stat rdf:type rdf:Statement . committee:membership12345Stat rdf:subject person:p1 . committee:membership12345Stat rdf:predicate committee:isMemberOf . committee:membership12345Stat rdf:object committee:c1 . </syntaxhighlight> These statements say that the resource identified by the <code>URIref committee:membership12345Stat</code> is an RDF statement, that the subject of the statement refers to the resource identified by <code>person:p1</code>, the predicate of the statement refers to the resource identified by <code>committee:isMemberOf</code>, and the object of the statement refers to the resource <code>committee:c1</code>. Assuming that the original statement is actually identified by <code>committee:membership12345</code>, 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".<ref name="rdf"/> Using reification according to this convention, we could record the fact that <code>person:p3</code> added the statement to the database by <syntaxhighlight lang="sparql"> person:p3 committee:addedToDatabase committee:membership12345Stat . </syntaxhighlight> 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 <code>(subject predicate object)</code> 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.<ref name="rdf"/> === In Topic Maps === In an [[Topic Maps|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.<ref>[http://www.techquila.com/practical_intro.html Practical Introduction into Topic Maps] {{webarchive|url=https://web.archive.org/web/20090203202441/http://techquila.com/practical_intro.html |date=2009-02-03 }}.</ref> === ''n''-ary relations === In 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 {{var|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.<ref>{{cite web|url=http://www.w3.org/TR/swbp-n-aryRelations/ |title=W3C Defining N-ary relations on Semantic Web |publisher=W3.org |date= |accessdate=2010-10-09}}</ref> <syntaxhighlight lang="turtle"> :p1 a :Person ; :has_membership _:membership_12345 . _:membership_12345 a :Membership ; :committee :c1; :nominated_by :p2 . </syntaxhighlight> === Vs. quotation === It 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: <syntaxhighlight lang="sparql"> committee:membership12345 rdf:subject person:p1 . </syntaxhighlight> describing the <code>rdf:subject</code> of the original statement says that the subject of the statement is the resource (the person) identified by the URIref <code>person:p1</code>. 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. ==See also== {{Wiktionary|reification}} * [[Denotational semantics]] * [[Formal semantics of programming languages]] * [[Meta-circular evaluator]] * [[Metamodeling]] * [[Metaobject]] * [[Metaprogramming]] * [[Normalization by evaluation]] * [[Operational semantics]] * [[Reflection (computer science)]] * [[Resource Description Framework]] * [[Self-interpreter]] * [[Topic Maps]] ==References== {{reflist}} <!--Interwikies--> {{DEFAULTSORT:Reification (Computer Science)}} <!--Categories--> [[Category:Object-oriented programming]] [[Category:Formal methods terminology]] [[Category:Knowledge representation]] [[de:Reifikation#Informatik]] [[fr:Réification]]
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)
Pages transcluded onto the current version of this page
(
help
)
:
Template:Citation needed
(
edit
)
Template:Cite book
(
edit
)
Template:Cite web
(
edit
)
Template:Clarification needed
(
edit
)
Template:Other uses
(
edit
)
Template:Paragraph break
(
edit
)
Template:Reflist
(
edit
)
Template:Short description
(
edit
)
Template:Var
(
edit
)
Template:Webarchive
(
edit
)
Template:Wiktionary
(
edit
)