Observational equivalence

From Wikipedia, the free encyclopedia

In the formal semantics of programming languages, two terms M and N are observationally equivalent if and only if, in all contexts C[...] where C[M] is a valid term, it is the case that C[N] is also a valid term with the same value. Thus it is not possible, within the system, to distinguish between the two terms. This definition can be made precise only with respect to a particular calculus, one that comes with its own specific definitions of term, context, and the value of a term.

This article was originally based on material from the Free On-line Dictionary of Computing, which is licensed under the GFDL.