StateEnd

data class StateEnd(val solution: Solution, val context: ConcurrentExecutionContext) : EndState

The EndState a branch reaches upon successfully proving the root ConcurrentExecutionContext.query (solution is a Solution.Yes) or exhausting every alternative without proving it (solution is a Solution.No).

Constructors

Link copied to clipboard
constructor(solution: Solution, context: ConcurrentExecutionContext)

Properties

Link copied to clipboard

The execution context this state operates on.

Link copied to clipboard
open override val isEndState: Boolean

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

Link copied to clipboard
open override val solution: Solution

The Solution produced by this branch of the search tree.

Functions

Link copied to clipboard
open override 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: ConcurrentExecutionContext = this.context): StateEnd

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(): Iterable<State>

Computes every state this branch may transition into from here, one per alternative (matching clause, disjunct, primitive solution, ...) available at this point; empty only for EndStates. Each element is meant to be explored independently (and, in :solve-concurrent's solver, concurrently) of the others.