Switch Statement - History

History

In his 1952 text Introduction to Metamathematics, Stephen Kleene formally proved that the CASE function (the IF-THEN-ELSE function being its simplest form) is a primitive recursive function, where he defines the notion definition by cases in the following manner:

"#F. The function φ defined thus
φ(x1, ..., xn ) =
  • φ1(x1, ..., xn ) if Q1(x1, ..., xn ),
  • . . . . . . . . . . . .
  • φm(x1, ..., xn ) if Qm(x1, ..., xn ),
  • φm+1(x1, ..., xn ) otherwise,
where Q1, ..., Qm are mutually exclusive predicates (or φ(x1, ..., xn) shall have the value given by the first clause which applies) is primitive recursive in φ1, ..., φm+1, Q1, ..., Qm+1.

Kleene provides a proof of this in terms of the Boolean-like recursive functions "sign-of" sg( ) and "not sign of" ~sg( ) (Kleene 1952:222-223); the first returns 1 if its input is positive and −1 if its input is negative.

Boolos-Burgess-Jeffrey make the additional observation that "definition by cases" must be both mutually exclusive and collectively exhaustive. They too offer a proof of the primitive recursiveness of this function (Boolos-Burgess-Jeffrey 2002:74-75).

The IF-THEN-ELSE is the basis of the McCarthy formalism: its usage replaces both primitive recursion and the mu-operator.

Read more about this topic:  Switch Statement

Famous quotes containing the word history:

    We don’t know when our name came into being or how some distant ancestor acquired it. We don’t understand our name at all, we don’t know its history and yet we bear it with exalted fidelity, we merge with it, we like it, we are ridiculously proud of it as if we had thought it up ourselves in a moment of brilliant inspiration.
    Milan Kundera (b. 1929)

    Modern Western thought will pass into history and be incorporated in it, will have its influence and its place, just as our body will pass into the composition of grass, of sheep, of cutlets, and of men. We do not like that kind of immortality, but what is to be done about it?
    Alexander Herzen (1812–1870)

    America is the only nation in history which miraculously has gone directly from barbarism to degeneration without the usual interval of civilization.
    Georges Clemenceau (1841–1929)