Narcissist

From Esolang
Jump to: navigation, search

A narcissist (or Narcissus program) is the decision-problem version of a quine.

A quine, when run, takes no input, but produces a copy of its own source code at its output. In contrast, a narcissist reads a string of symbols from its input, and produces no output except a "1" or "accept" if that string matches its own source code, or a "0" or "reject" if it does not.

Chris Pressey independently came up with the concept of a narcissist in July or August of 2007. An almost identical (differing only in its accept/reject method) concept of an "inequ" was described by Jasvir Nagra in March 2005. It is not known if the idea is even older.

The concept was intended to simplify reasoning about User:Smjg's idea of a Quineless language (discussed on User talk:Smjg.) Defining a quine requires the definition of programs (as strings over some alphabet) in a programming language which is capable of producing strings (over the same alphabet) as output. Defining a narcissist, however, requires a definition of programs (as strings over some alphabet) which produce an "accept" or "reject" when given some input string (over the same alphabet.) This is much closer to the classical definition of Turing machines as they are studied in computability and complexity theory, as solvers of decision problems. It is hoped that the narcissist concept will allow results from computability to be more easily brought to bear on the idea of a Quineless language.

See Also

External resources