SolverStrategies

The pluggable choice points of :solve-streams' resolution engine: given a Sequence of candidates, which one does the solver commit to first, and when is a goal considered proven?

Every StreamsExecutionContext carries one SolverStrategies instance (defaulting to prologStandard), and the internal state-machine states (StateGoalEvaluation, StateRuleSelection, ...) consult it -- together with it.unibo.tuprolog.solve.streams.solver.orderWithStrategy -- whenever they need to order candidate predications/clauses or decide whether a term counts as a successful demonstration.

Because :solve-streams currently exposes no public constructor parameter (on StreamsSolverFactory or elsewhere) to inject a custom SolverStrategies into a it.unibo.tuprolog.solve.Solver instance, this interface is, at present, effectively fixed to prologStandard from outside this module.

Author

Enrico

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
abstract fun <C : Clause> clauseChoiceStrategy(unifiableClauses: Sequence<C>, context: ExecutionContext): C

Selects, from unifiableClauses, the clause that should be expanded in place of the current predication.

Link copied to clipboard
abstract fun <P : Term> predicationChoiceStrategy(predicationSequence: Sequence<P>, context: ExecutionContext): P

Selects, from predicationSequence, the predication that should be solved first.

Link copied to clipboard
abstract fun successCheckStrategy(term: Term, context: ExecutionContext): Boolean

Determines whether term -- the result of a resolution step in context -- counts as a successful demonstration.