m Open access bot: url-access updated in citation with #oabot.
(One intermediate revision by one other user not shown)
Line 2:
{{About|referential transparency in programming language theory|its use in linguistics and philosophy|Opaque context}}
In [[analytic philosophy]] and [[computer science]], '''referential transparency''' and '''referential opacity''' are properties of linguistic constructions,<ref>{{efn|A linguistic construction (also called mode of containment, context, or operator) is an expression with holes.</ref>}} and by extension of languages. A linguistic construction is called ''referentially transparent'' when for any expression built from it, [[Rewriting|replacing]] a subexpression with another one that [[Denotation|denotes]] the same value<ref>{{efn|Here a value is the denotation (also called meaning, object, or referent) of an expression, not the [[Expression (computer science)|result]] of the evaluation process.</ref>}} does not change the value of the expression.<ref name="quine1960">{{cite book |last=Quine |first=Willard Van Orman |author-link=Willard Van Orman Quine |date=1960 |title=Word and Object |edition=1st |url=https://archive.org/details/in.ernet.dli.2015.529086 |___location=Cambridge, Massachusetts |publisher=MIT Press |page=144 |isbn=978-0-262-17001-7}}</ref><ref name="strachey1967">{{cite tech report |last1=Strachey |first1=Christopher |date=1967 |title=Fundamental Concepts in Programming Languages |url= |institution=Lecture notes for the International Summer School in Computer Programming at Copenhagen |number=}} Also: {{cite journal |last1=Strachey |first1=Christopher |date=2000 |title=Fundamental Concepts in Programming Languages |url=https://link.springer.com/article/10.1023%2FA%3A1010000313106 |journal=Higher-Order and Symbolic Computation |volume=13 |issue=1–2 |pages=11–49 |doi=10.1023/A:1010000313106 |s2cid=14124601 |doi-access=|url-access=subscription }}</ref> Otherwise, it is called ''referentially opaque''. Each expression built from a referentially opaque linguistic construction states something about a subexpression, whereas each expression built from a referentially transparent linguistic construction states something not about a subexpression, meaning that the subexpressions are ‘transparent’ to the expression, acting merely as ‘references’ to something else.<ref name="whitehead1927">{{cite book |last1=Whitehead |first1=Alfred North |last2=Russell |first2=Bertrand |author-link1=Alfred North Whitehead |author-link2=Bertrand Russell |date=1927 |title=Principia Mathematica |volume=1 |edition=2nd |url=https://archive.org/details/dli.ernet.247278 |___location=Cambridge |publisher=Cambridge University Press |page=665 |isbn=978-0-521-06791-1}}</ref> For example, the linguistic construction ‘_ was wise’ is referentially transparent (e.g., ''Socrates was wise'' is equivalent to ''The founder of Western philosophy was wise'') but ‘_ said _’ is referentially opaque (e.g., ''Xenophon said ‘Socrates was wise’'' is not equivalent to ''Xenophon said ‘The founder of Western philosophy was wise’'').
Referential transparency, in programming languages, depends on semantic equivalences among denotations of expressions, or on [[contextual equivalence]] of expressions themselves. That is, referential transparency depends on the semantics of the language. So, both [[declarative language]]s and [[imperative language]]s can have referentially transparent positions, referentially opaque positions, or (usually) both, according to the semantics they are given.