Package-level declarations

Functions

Link copied to clipboard

Appends toAddSideEffects to this list of side effects, first dropping from its front as many elements as this list has that also occur (by reference identity, not equality) somewhere in toAddSideEffects -- used when merging a child request's accumulated side effects back into its parent's, to avoid recording the same SideEffect instance twice when toAddSideEffects already carries this list's elements as a prefix.

Link copied to clipboard

Checks whether the receiver term is a well-formed predication, i.e. an it.unibo.tuprolog.core.Atom or Struct (see Clause.bodyWellFormedVisitor).

Link copied to clipboard
fun moreThanOne(elements: Sequence<*>): Boolean

Lazily checks whether elements holds more than one element, consuming at most two of them.

Link copied to clipboard
fun <E> Sequence<E>.orderWithStrategy(context: ExecutionContext, selectionStrategy: (Sequence<E>, ExecutionContext) -> E): Sequence<E>

Lazily reorders this sequence of candidates according to selectionStrategy: repeatedly asks selectionStrategy to pick one element out of what remains, yields it, then recurses on the rest -- so the first pick drives the order of the whole resulting sequence, one element at a time, without ever fully consuming the receiver upfront.

Link copied to clipboard

Prepares the receiver goal for execution, wrapping it into a call/1 when needed so it goes through the ISO callability check before being solved.

Link copied to clipboard

Builds a Solve.Response to this request that forwards otherResponse's Solve.Response.solution and Solve.Response.sideEffects, falling back to this request's own ExecutionContext's side-effect manager when otherResponse carries none.