AbstractSolver

abstract class AbstractSolver<E : ExecutionContext> : Solver, Any

Fields

Name Description
protected abstract var currentContext: E
val libraries: Libraries

Loaded libraries

val flags: FlagStore

Enabled flags

val staticKb: Theory

Static Knowledge-base, that is a KB that can't change executing goals

val dynamicKb: Theory

Dynamic Knowledge-base, that is a KB that can change executing goals

val inputChannels: InputStore

The currently open input channels

val outputChannels: OutputStore

The currently open output channels

val operators: OperatorSet

Loaded operators

Constructors

<init>

constructor(libraries: Libraries, flags: FlagStore, initialStaticKb: Theory, initialDynamicKb: Theory, inputChannels: InputStore, outputChannels: OutputStore, trustKb: Boolean)

Parameters

Name Description
libraries: Libraries
flags: FlagStore
initialStaticKb: Theory
initialDynamicKb: Theory
inputChannels: InputStore
outputChannels: OutputStore
trustKb: Boolean

Methods

onInitialize

protected open fun onInitialize()

ReturnValue

Name Description
Unit

initializeContext

protected abstract fun initializeContext(libraries: Libraries, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, operators: OperatorSet, inputChannels: InputStore, outputChannels: OutputStore, trustKb: Boolean): E

Parameters

Name Description
libraries: Libraries
flags: FlagStore
staticKb: Theory
dynamicKb: Theory
operators: OperatorSet
inputChannels: InputStore
outputChannels: OutputStore
trustKb: Boolean

ReturnValue

Name Description
E

updateContext

protected fun updateContext(operator: E.()->ExecutionContext)

Parameters

Name Description
operator: E.()->ExecutionContext

ReturnValue

Name Description
Unit

loadGoal

protected fun loadGoal(theory: Atom): Struct

Parameters

Name Description
theory: Atom

ReturnValue

Name Description
Struct

initializeKb

protected fun initializeKb(staticKb: Theory?, dynamicKb: Theory?, appendStatic: Boolean, appendDynamic: Boolean)

Parameters

Name Description
staticKb: Theory?
dynamicKb: Theory?
appendStatic: Boolean
appendDynamic: Boolean

ReturnValue

Name Description
Unit

solve

fun solve(goal: Struct, options: SolveOptions): Sequence<Solution>

Parameters

Name Description
goal: Struct
options: SolveOptions

ReturnValue

Name Description
Sequence<Solution>

solveImpl

protected abstract fun solveImpl(goal: Struct, options: SolveOptions): Sequence<Solution>

Parameters

Name Description
goal: Struct
options: SolveOptions

ReturnValue

Name Description
Sequence<Solution>

equals

open fun equals(other: Any?): Boolean

Parameters

Name Description
other: Any?

ReturnValue

Name Description
Boolean

hashCode

open fun hashCode(): Int

ReturnValue

Name Description
Int

copy

abstract fun copy(libraries: Libraries, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): AbstractSolver<E>

Parameters

Name Description
libraries: Libraries
flags: FlagStore
staticKb: Theory
dynamicKb: Theory
stdIn: InputChannel<String>
stdOut: OutputChannel<String>
stdErr: OutputChannel<String>
warnings: OutputChannel<Warning>

ReturnValue

Name Description
AbstractSolver<E>

clone

abstract fun clone(): AbstractSolver<E>

ReturnValue

Name Description
AbstractSolver<E>

toString

open fun toString(): String

ReturnValue

Name Description
String

Extensions

solve

fun Solver.solve(maxDuration: TimeDuration, scopedContext: Scope.()->Struct): Sequence<Solution>

Receiver

Name Description
Solver

Parameters

Name Description
maxDuration: TimeDuration
scopedContext: Scope.()->Struct

ReturnValue

Name Description
Sequence<Solution>