Logic Programming - Negation As Failure

Negation As Failure

Micro-Planner had a construct, called "thnot", which when applied to an expression returns the value true if (and only if) the evaluation of the expression fails. An equivalent operator is normally built-in in modern Prolog's implementations and has been called "negation as failure". It is normally written as not(p), where p is an atom whose variables normally have been instantiated by the time not(p) is invoked. A more cryptic (but standard) syntax is \+ p . Negation as failure literals can occur as conditions not(Bi) in the body of program clauses.

The logical status of negation as failure was unresolved until Keith Clark showed that, under certain natural conditions, it is a correct (and sometimes complete) implementation of classical negation with respect to the completion of the program. Completion amounts roughly to regarding the set of all the program clauses with the same predicate on the left hand side, say

H :- Body1.
H :- Bodyk.

as a definition of the predicate

H iff (Body1 or … or Bodyk)

where "iff" means "if and only if". Writing the completion also requires explicit use of the equality predicate and the inclusion of a set of appropriate axioms for equality. However, the implementation of negation by failure needs only the if-halves of the definitions without the axioms of equality.

The notion of completion is closely related to McCarthy's circumscription semantics for default reasoning, and to the closed world assumption.

As an alternative to the completion semantics, negation as failure can also be interpreted epistemically, as in the stable model semantics of answer set programming. In this interpretation not(Bi) means literally that Bi is not known or not believed. The epistemic interpretation has the advantage that it can be combined very simply with classical negation, as in "extended logic programming", to formalise such phrases as "the contrary can not be shown", where "contrary" is classical negation and "can not be shown" is the epistemic interpretation of negation as failure.

Read more about this topic:  Logic Programming

Famous quotes containing the words negation and/or failure:

    Michelangelo said to Pope Julius II, “Self negation is noble, self-culture is beneficent, self-possession is manly, but to the truly great and inspiring soul they are poor and tame compared to self-abuse.” Mr. Brown, here, in one of his latest and most graceful poems refers to it in an eloquent line which is destined to live to the end of time—”None know it but to love it, None name it but to praise.”
    Mark Twain [Samuel Langhorne Clemens] (1835–1910)

    The moment a mere numerical superiority by either states or voters in this country proceeds to ignore the needs and desires of the minority, and for their own selfish purpose or advancement, hamper or oppress that minority, or debar them in any way from equal privileges and equal rights—that moment will mark the failure of our constitutional system.
    Franklin D. Roosevelt (1882–1945)