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:

    Better the rule of One, whom all obey,
    Than to let clamorous demagogues betray
    Our freedom with the kiss of anarchy.
    Oscar Wilde (1854–1900)

    The principle of majority rule is the mildest form in which the force of numbers can be exercised. It is a pacific substitute for civil war in which the opposing armies are counted and the victory is awarded to the larger before any blood is shed. Except in the sacred tests of democracy and in the incantations of the orators, we hardly take the trouble to pretend that the rule of the majority is not at bottom a rule of force.
    Walter Lippmann (1889–1974)

    Where mass opinion dominates the government, there is a morbid derangement of the true functions of power. The derangement brings about the enfeeblement, verging on paralysis, of the capacity to govern. This breakdown in the constitutional order is the cause of the precipitate and catastrophic decline of Western society. It may, if it cannot be arrested and reversed, bring about the fall of the West.
    Walter Lippmann (1889–1974)