SolutionIterator
Drives the :solve-classic finite-state machine, one State.next step at a time, and turns every visited end-state (see it.unibo.tuprolog.solve.classic.fsm.EndState) into an emitted Solution.
This is the piece AbstractClassicSolver.solveImpl wraps into a lazy Sequence: hasNext answers whether the current state is (or can, via backtracking, resume being) an end-state, and next steps the machine forward until it reaches one, returning its it.unibo.tuprolog.solve.classic.fsm.EndState.solution. Because this is a genuine Iterator over an explicit state value rather than host-language recursion, resolution can be driven incrementally -- one solution, or even one FSM transition, at a time -- without unwinding a call stack, and onStateTransition gives a hook to observe (e.g. log, trace, or count) every step as it happens.
See also
for a variant that can additionally hijack which state comes next.
Inheritors
Properties
Functions
Invoked after every transition from source to destination (the index-th transition overall).