MutableSolutionIterator

A SolutionIterator that can hijack a state transition, i.e. substitute the State the machine actually moves into for the one it would otherwise have computed.

This exists for tooling built on top of :solve-classic -- step-by-step debuggers, tracers, or a REPL that wants to pause resolution -- that need to redirect the FSM (e.g. forcing early termination, or replaying a previously recorded state) without reimplementing resolution themselves.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val state: State

The state the machine is currently in (before the next call to next advances it).

Link copied to clipboard
abstract val step: Long

How many transitions the underlying state machine has performed so far.

Functions

Link copied to clipboard
abstract operator override fun hasNext(): Boolean
Link copied to clipboard
abstract fun hijackStateTransition(source: State, destination: State, index: Long): State

Called instead of onStateTransition before a transition from source to destination (the index-th overall) is committed; returns the State that should actually become the new current state (typically destination itself, unless the caller wants to hijack the transition).

Link copied to clipboard
abstract operator override fun next(): Solution
Link copied to clipboard
abstract fun onStateTransition(source: State, destination: State, index: Long)

Invoked after every transition from source to destination (the index-th transition overall).