Concept Programming - Rule of Equivalence, Equivalence Breakdown

Rule of Equivalence, Equivalence Breakdown

The rule of equivalence is verified when the code behavior matches the original concept. This equivalence may break down in many cases. Integer overflow breaks the equivalence between the mathematical integer concept and the computerized approximation of the concept.

Many ways to break the equivalence have been given specific names, because they are very common:

  • A domain error is a condition where code executes outside of the domain of equivalence, which is the domain where the concept and the implementation match. An integer overflow is an example of domain error.
  • A concept cast is a rewrite of a concept as a different concept because the original concept cannot be represented by the tools. In C, using pointers for output arguments because C doesn't support output arguments explicitly is an example of concept cast.
  • A priority inversion is a form of syntactic or semantic noise introduced by some language-enforced general rule. It is called a priority inversion because the language takes precedence over the concept. In Smalltalk, everything is an object, and that rule leads to the undesirable consequence that an expression like 2+3*5 doesn't obey the usual order of operations (Smalltalk interprets this as sending the message * to the number resulting from 2+3, which yields result 25 instead of 17).

Read more about this topic:  Concept Programming

Famous quotes containing the words rule of, rule and/or breakdown:

    For all of us Frenchmen, the guiding rule of our epoch is to be faithful to France.
    Charles De Gaulle (1890–1970)

    When any practice has become the fixed rule of the society in which we live, it is always wise to adhere to that rule, unless it call upon us to do something that is actually wrong. One should not offend the prejudices of the world, even if one is quite sure that they are prejudices.
    Anthony Trollope (1815–1882)

    The ideal of brotherhood of man, the building of the Just City, is one that cannot be discarded without lifelong feelings of disappointment and loss. But, if we are to live in the real world, discard it we must. Its very nobility makes the results of its breakdown doubly horrifying, and it breaks down, as it always will, not by some external agency but because it cannot work.
    Kingsley Amis (1922–1995)