StatePrimitiveSelection

"Primitive Selection": looks up a Primitive for the current goal's (functor, arity) signature among the loaded libraries. If found, builds a child ClassicExecutionContext, invokes the primitive, and moves to StatePrimitiveExecution with the resulting response cursor already attached as a choice point; if not found, falls through to StateRuleSelection. A malformed goal -- an unbound variable, or a term that isn't callable (not a it.unibo.tuprolog.core.Struct) -- short-circuits straight to StateException here, before any lookup is attempted.

Constructors

Link copied to clipboard
constructor(context: ClassicExecutionContext)

Properties

Link copied to clipboard
open override val context: ClassicExecutionContext

The execution context this state operates on.

Link copied to clipboard

Whether this state is a terminal one for the current resolution step, i.e. an EndState.

Functions

Link copied to clipboard
open fun asEndState(): EndState?

This state as an EndState, or null if isEndState is false.

Link copied to clipboard

This state as an EndState.

Link copied to clipboard
open override fun clone(context: ClassicExecutionContext = this.context): StatePrimitiveSelection

Returns a copy of this state, replacing context with the given one (defaulting to the current context).

Link copied to clipboard
open override fun next(): State

Computes the state the machine transitions into from here -- a pure function of context.