Rules

data class Rules(val alternatives: Cursor<out Rule>, val executionContext: ClassicExecutionContext?, val parent: ChoicePointContext?, val depth: Int) : ChoicePointContext

A choice point recording the remaining candidate Rules of a clause resolution attempt.

Constructors

Link copied to clipboard
constructor(alternatives: Cursor<out Rule>, executionContext: ClassicExecutionContext?, parent: ChoicePointContext?, depth: Int)

Properties

Link copied to clipboard
open override val alternatives: Cursor<out Rule>
Link copied to clipboard
open override val depth: Int
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Whether this choice point, or any of its ancestors along pathToRoot, still has an alternative to try.

Link copied to clipboard

Whether this is the first choice point of a resolution (i.e. it has no parent).

Link copied to clipboard
open override val parent: ChoicePointContext?
Link copied to clipboard

This choice point and all its ancestors, from here up to (and including) the root, in that order.

Functions

Link copied to clipboard

Chains a new ChoicePointContext.Primitives recording alternatives onto this (null meaning "the root").

Link copied to clipboard
fun ChoicePointContext?.appendRules(alternatives: Cursor<out Rule>, executionContext: ClassicExecutionContext? = null): ChoicePointContext

Chains a new ChoicePointContext.Rules recording alternatives onto this (null meaning "the root").

Link copied to clipboard

Resumes this choice point: restores its saved executionContext (carrying over context's current step counter, flags and knowledge bases), advances alternatives to the next one, and returns the resulting ClassicExecutionContext, ready to be handed to it.unibo.tuprolog.solve.classic.fsm.StatePrimitiveExecution or it.unibo.tuprolog.solve.classic.fsm.StateRuleExecution depending on the concrete subtype.

Link copied to clipboard

The ChoicePointContext.depth a new choice point chained onto this one (or null, for the root) would have.

Link copied to clipboard
open override fun toString(): String