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:

    An “unemployed” existence is a worse negation of life than death itself.
    José Ortega Y Gasset (1883–1955)

    I am dead against art’s being self-expression. I see an inherent failure in any story which fails to detach itself from the author—detach itself in the sense that a well-blown soap-bubble detaches itself from the bowl of the blower’s pipe and spherically takes off into the air as a new, whole, pure, iridescent world. Whereas the ill-blown bubble, as children know, timidly adheres to the bowl’s lip, then either bursts or sinks flatly back again.
    Elizabeth Bowen (1899–1973)