Send Close Add comments: (status displays here)
Got it!  This site "creationpie.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
Referential transparency
by RS  admin@creationpie.com : 1024 x 640


1. Referential transparency
Referential transparency Input-program-output

Mathematical functions can be considered black boxes that, given an input, provide an output. This is much like a computer program. In a black box function, you cannot see inside. You should not "judge" or "separate" based on the internal workings of the box - which you cannot see nor fully understand. Instead, you should "judge" or "separate" based on the external behavior of the box.

The principle of referential transparency can be stated as follows. That is, if f and g are provided input x and both produce output y, for the domain of concern they can be considered the same.

The Greek word for "judge" or "separate" is related to the Greek word for "barley".

Information sign More: Matthew 7:1-2 Here comes the judge, but just barley
The concept of referential transparency in mathematical and functional programming functions is an extension of ideas in analytical philosophy. The philosopher/mathematician Willard Quine introduced the concept of referential transparency. A function takes one or more arguments and returns one or more things.

Here, only mathematical functions or function in functional programming are considered. That is, there are no side effects in the function such that the function can be considered a black box. Consider the function f defined as follows.
f(x) = 2 * x + 1 , for integer x > 0

returns twice the argument x plus one. So the following hold.
f(0) = 1 f(1) = 3 f(2) = 5 f(3) = 7 ... and so on ...

For the domain of x being a nonnegative integer, the function f represents the set of odd whole numbers (or nonnegative integers). Consider the function g defined as follows.
g(x) = 3 * x - 1 , for integer x > 0

So the following hold.
g(0) = 1 g(1) = 3 g(2) = 5 g(3) = 7 ... and so on ...

In general, a function can act as a black box where one cannot see inside the box but con only observe inputs and outputs.

2. Referential transparency
This idea of referential transparency can be extended to more complex models in an intuitive manner.

This idea has applications in the testing of programs to find errors and improve effectiveness. Assume that one has a model A that explains the behavior of and individual to an acceptable level.

Assume that one has another model B that appears to be a quite different model than model A, but for each input to both models, one gets the same output, to an acceptable level, then one can reach the conclusion that, for this individual, by referential transparency, model A and model B are the same model and both models can be ascribed to the behavior of this individual.

3. End of page

by RS  admin@creationpie.com : 1024 x 640