Also found in: Dictionary, Thesaurus, Wikipedia.
Related to quine: quinine


Willard van Orman. 1908--2000, US philosopher. His works include Word and Object (1960), Philosophy of Logic (1970), The Roots of Reference (1973), and The Logic of Sequences (1990)
Collins Discovery Encyclopedia, 1st edition © HarperCollins Publishers 2005


/kwi:n/ (After the logician Willard V. Quine, via Douglas Hofstadter) A program that generates a copy of its own source text as its complete output. Devising the shortest possible quine in some given programming language is a common hackish amusement.

In most interpreted languages, any constant, e.g. 42, is a quine because it "evaluates to itself". In certain Lisp dialects (e.g. Emacs Lisp), the symbols "nil" and "t" are "self-quoting", i.e. they are both a symbol and also the value of that symbol. In some dialects, the function-forming function symbol, "lambda" is self-quoting so that, when applied to some arguments, it returns itself applied to those arguments. Here is a quine in Lisp using this idea:

((lambda (x) (list x x)) (lambda (x) (list x x)))

Compare this to the lambda expression:

(\ x . x x) (\ x . x x)

which reproduces itself after one step of beta reduction. This is simply the result of applying the combinator fix to the identity function. In fact any quine can be considered as a fixed point of the language's evaluation mechanism.

We can write this in Lisp:

((lambda (x) (funcall x x)) (lambda (x) (funcall x x)))

where "funcall" applies its first argument to the rest of its arguments, but evaluation of this expression will never terminate so it cannot be called a quine.

Here is a more complex version of the above Lisp quine, which will work in Scheme and other Lisps where "lambda" is not self-quoting:

((lambda (x) (list x (list (quote quote) x))) (quote (lambda (x) (list x (list (quote quote) x)))))

It's relatively easy to write quines in other languages such as PostScript which readily handle programs as data; much harder (and thus more challenging!) in languages like C which do not. Here is a classic C quine for ASCII machines:

char*f="char*f=%c%s%c;main() printf%c"; main()printf

For excruciatingly exact quinishness, remove the interior line break. Some infamous Obfuscated C Contest entries have been quines that reproduced in exotic ways.

Ken Thompson's back door involved an interesting variant of a quine - a compiler which reproduced part of itself when compiling (a version of) itself.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)
References in periodicals archive ?
Chomsky adds that even if we leave aside the purported disanalogy between the law of falling bodies and linguistic competence, Quine's formulation would still fail because he is guilty of treating physics and linguistics inconsistently.
Quine is equally well known for his attack on Carnap's analytic/synthetic distinction.
The officer quickly parked behind Quine's vehicle as he was attempting to back it up in an apparent attempt to flee, police said.
QUINE SINTETIZA SU NATURALISMO en distintos esloganes: "no hay filosofia primera", "no hay exilio cosmico", "la epistemologia es un capitulo de la psicologia", "no existe un punto arquimedico del conocimiento", etc.
The murder of Owen Quine was done exactly like his last would-be book, Bombyx Mori, or Silkworm, ends, and so the murderer must have read the manuscript.
"At first, Mrs Quine just thinks her husband has gone off by himself for a few days - as he has done before - and she wants Strike to find him and bring him home," runs the newly released description of The Silkworm.
Bryn's GP referred him to the University Hospital of Wales where Mr Quine saw him and found an 8cm lump in his lower neck with fixation of the overlying skin.
The book begins with an introduction that sketches the historical context of Quine's emerging philosophy, briefly discussing 19th-century scientific advances, the waning of idealism and rise of realism in American philosophy, developments in modern logic, and the views of the Vienna Circle.
Becker points out that Quine's view treats the statements of logic and mathematics as differing only in degree, not in kind, from other statements.
Gibson argues that Quine's ontological physicalism countenances physical states and the abstract objects of applied mathematics, namely, classes.