NegationAsFailure

A rule-based, two-clause implementation of negation as failure (\+/1): Fail tries X and, if it succeeds, cuts and fails; Success is the fallback clause that succeeds when Fail didn't. This is the same encoding :solve-classic uses, but here it is shadowed by the primitive it.unibo.tuprolog.solve.concurrent.stdlib.primitive.Naf registered under the same \+/1 signature in it.unibo.tuprolog.solve.concurrent.stdlib.DefaultBuiltins: primitives are looked up before rules (see it.unibo.tuprolog.solve.concurrent.fsm.StatePrimitiveSelection), so Fail/Success never actually run as long as that primitive stays registered.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

\+(X) :- ensure_executable(X), call(X), !, fail. -- fails if X succeeds at least once.

Link copied to clipboard

\+(X) :- true. -- the fallback clause, reached only if Fail didn't cut resolution short.

Properties

Link copied to clipboard
abstract override val Scope.body: Term
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val Scope.head: List<Term>
Link copied to clipboard
override val implementation: Rule
Link copied to clipboard

Functions

Link copied to clipboard
override fun toString(): String