Negation as failure

Negation as failure

Negation as failure (NAF, for short) is a non-monotonic inference rule in logic programming, used to derive \mathrm{not}~p (i.e. that ~p is assumed not to hold) from failure to derive ~p. Note that \mathrm{not} ~p can be different from the statement \neg p of the logical negation of ~p, depending on the completeness of the inference algorithm and thus also on the formal logic system.

Negation as failure has been an important feature of logic programming since the earliest days of both Planner and Prolog. In Prolog, it is usually implemented using Prolog's extralogical constructs.

Contents

Planner semantics

In Planner, negation as failure could be implemented as follows:

if (not (goal p)), then (assert ¬p)

which says that if the goal to prove p fails, then assert ¬p. Note that the above example uses true mathematical negation, which cannot be expressed in Prolog.

Prolog semantics

In pure Prolog, NAF literals of the form not~p can occur in the body of clauses and can be used to derive other NAF literals. For example, given only the four clauses

p \leftarrow q \and \mathrm{not}~r
q \leftarrow s
q \leftarrow t
t \leftarrow

NAF derives \mathrm{not}~s, \mathrm{not}~r and ~p.

Completion semantics

The semantics of NAF remained an open issue until Keith Clark [1978] showed that it is correct with respect to the completion of the logic program, where, loosely speaking, "only" and \leftarrow are interpreted as "if and only if", written as "iff" or "\equiv".

For example, the completion of the four clauses above is

p \equiv q \and \mathrm{not}~r
q \equiv s \or t
t \equiv \mathrm{true}
r \equiv \mathrm{false}
s \equiv \mathrm{false}

The NAF inference rule simulates reasoning explicitly with the completion, where both sides of the equivalence are negated and negation on the right-hand side is distributed down to atomic formulae. For example, to show \mathrm{not}~p, NAF simulates reasoning with the equivalences

\mathrm{not}~p \equiv \mathrm{not}~q \or r
\mathrm{not}~q \equiv \mathrm{not}~s \and \mathrm{not}~t
\mathrm{not}~t \equiv \mathrm{false}
\mathrm{not}~r \equiv \mathrm{true}
\mathrm{not}~s \equiv \mathrm{true}

In the non-propositional case, the completion needs to be augmented with equality axioms, to formalise the assumption that individuals with distinct names are distinct. NAF simulates this by failure of unification. For example, given only the two clauses

p(a) \leftarrow
p(b) \leftarrow t

NAF derives \mathrm{not}~p(c).

The completion of the program is

p(X) \equiv X=a \or X=b

augmented with unique names axioms and domain closure axioms.

The completion semantics is closely related both to circumscription and to the closed world assumption.

Autoepistemic semantics

The completion semantics justifies interpreting the result \mathrm{not}~p of a NAF inference as the classical negation \neg p of p. However, Michael Gelfond [1987] showed that it is also possible to interpret \mathrm{not}~p literally as "p can not be shown", "p is not known" or "p is not believed", as in autoepistemic logic. The autoepistemic interpretation was developed further by Gelfond and Lifschitz [1988] and is the basis of answer set programming.

The autoepistemics semantics of a pure Prolog program P with NAF literals is obtained by "expanding" P with a set of ground (variable-free) NAF literals Δ that is stable in the sense that

Δ = {\mathrm{not}~p | p is not implied by P ∪ Δ}

In other words, a set of assumptions Δ about what can not be shown is stable if and only if Δ is the set of all sentences that truly can not be shown from the program P expanded by Δ. Here, because of the simple syntax of pure Prolog programs, "implied by" can be understood very simply as derivability using modus ponens and universal instantiation alone.

A program can have zero, one or more stable expansions. For example

p \leftarrow \mathrm{not}~p

has no stable expansions.

p \leftarrow \mathrm{not}~q

has exactly one stable expansion Δ = {\mathrm{not}~q}

p \leftarrow \mathrm{not}~q
q \leftarrow \mathrm{not}~p

has exactly two stable expansions Δ1 = {\mathrm{not}~p} and Δ2 = {\mathrm{not}~q}.

The autoepistemic interpretation of NAF can be combined with classical negation, as in extended logic programming and answer set programming. Combining the two negations, it is possible to express, for example

\neg p \leftarrow \mathrm{not}~p (the closed world assumption) and
p \leftarrow \mathrm{not}~\neg p (p holds by default).

References

  • K. Clark [1978, 1987]. Negation as failure. Readings in nonmonotonic reasoning, Morgan Kaufmann Publishers, pages 311 - 325.

External links

  • Report from the W3C Workshop on Rule Languages for Interoperability. Includes notes on NAF and SNAF (scoped negation as failure).

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Negation as failure — Négation par l échec La négation par l échec (en anglais NAF pour negation as failure, ou NBF pour negation by failure) est une règle d inférence non monotone en programmation logique, utilisée pour la dérivation de à partir de l échec de la… …   Wikipédia en Français

  • Negation by failure — Négation par l échec La négation par l échec (en anglais NAF pour negation as failure, ou NBF pour negation by failure) est une règle d inférence non monotone en programmation logique, utilisée pour la dérivation de à partir de l échec de la… …   Wikipédia en Français

  • Negation par l'echec — Négation par l échec La négation par l échec (en anglais NAF pour negation as failure, ou NBF pour negation by failure) est une règle d inférence non monotone en programmation logique, utilisée pour la dérivation de à partir de l échec de la… …   Wikipédia en Français

  • Négation par l'échec — La négation par l échec (en anglais NAF pour negation as failure, ou NBF pour negation by failure) est une règle d inférence non monotone en programmation logique, utilisée pour la dérivation de à partir de l échec de la dérivation de p. C est… …   Wikipédia en Français

  • Negation — For other uses, see Negation (disambiguation). In logic and mathematics, negation, also called logical complement, is an operation on propositions, truth values, or semantic values more generally. Intuitively, the negation of a proposition is… …   Wikipedia

  • Of Fracture and Failure — Studio album by Ulcerate Released 2007 …   Wikipedia

  • Logic programming — is, in its broadest sense, the use of mathematical logic for computer programming. In this view of logic programming, which can be traced at least as far back as John McCarthy s [1958] advice taker proposal, logic is used as a purely declarative… …   Wikipedia

  • Stable model semantics — The concept of a stable model, or answer set, is used to define a declarative semantics for logic programs with negation as failure. This is one of several standard approaches to the meaning of negation in logic programming, along with program… …   Wikipedia

  • Planner (programming language) — Planner (often seen in publications as PLANNER although it is not an acronym) is a programming language designed by Carl Hewitt at MIT, and first published in 1969. First, subsets such as Micro Planner and Pico Planner were implemented, and then… …   Wikipedia

  • Closed world assumption — The closed world assumption (CWA) is the presumption that what is not currently known to be true, is false. The same name also refers to a logical formalization of this assumption by Raymond Reiter. The opposite of the closed world assumption is… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”