An opaque context or referentially opaque context is a linguistic context in which it is not always possible to substitute "co-referential" expressions (expressions referring to the same object) without altering the truth of sentences.[1] The expressions involved are usually grammatically singular terms. So, substitution of co-referential expressions into an opaque context does not always preserve truth. For example, "Lois believes x is a hero" is an opaque context because "Lois believes Superman is a hero" is true while "Lois believes Clark Kent is a hero" is false, even though 'Superman' and 'Clark Kent' are co-referential expressions.

## Usage

The term is used in philosophical theories of reference, and is to be contrasted with referentially transparent context. In rough outline:

• Opacity: "Mary believes that Cicero is a great orator" gives rise to an opaque context; although Cicero was also called 'Tully',[2] we can't simply substitute 'Tully' for 'Cicero' in this context ("Mary believes that Tully is a great orator") and guarantee the same truth value, for Mary might not know that the names 'Tully' and 'Cicero' refer to one and the same thing. Of course, if Mary does believe that Cicero is a great orator, then there is a sense in which Mary believes that Tully is a great orator, even if she does not know that 'Tully' and 'Cicero' corefer. It is the sense forced on us by "direct reference" theories of proper names, i.e. those that maintain that the meaning of a proper name just is its referent.
• Transparency: "Cicero was a Roman orator" gives rise to a transparent context; there is no problem substituting 'Tully' for 'Cicero' here: "Tully was a Roman orator". Both sentences necessarily express the same thing if 'Cicero' and 'Tully' refer to the same person. Note that this element is missing in the opaque contexts, where a shift in the name can result in a sentence that expresses something different from the original.

Similar usage of the term applies for artificial languages such as programming languages and logics. The Cicero–Tully example above can be easily adapted. Use the notation ${\displaystyle [t]}$ as a quotation that mentions a term ${\displaystyle t}$. Define a predicate ${\displaystyle L}$ which is true for terms six letters long. Then ${\displaystyle [x]}$ induces an opaque context, or is referentially opaque, because ${\displaystyle L([Cicero])}$ is true while ${\displaystyle L([Tully])}$ is false. Programming languages often have richer semantics than logics' semantics of truth and falsity, and so an operator such as ${\displaystyle [x]}$ may fail to be referentially transparent for other reasons as well.