Solver

interface Solver: ExecutionContextAware, Any

General type for logic solvers, i.e. any entity capable of solving some logic query -- provided as a Struct -- according to some logic, implementing one or more inference rule, via some resolution strategy.

Solvers are not immutable entities. Their state may mutate as an effect of solving queries.

Methods

solve

open fun solve(goal: Struct, timeout: TimeDuration): Sequence<Solution>

Parameters

Name Description
goal: Struct
timeout: TimeDuration

ReturnValue

Name Description
Sequence<Solution>

solve

open fun solve(goal: Struct): Sequence<Solution>

Parameters

Name Description
goal: Struct

ReturnValue

Name Description
Sequence<Solution>

solve

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

Parameters

Name Description
goal: Struct
options: SolveOptions

ReturnValue

Name Description
Sequence<Solution>

solveList

open fun solveList(goal: Struct, timeout: TimeDuration): List<Solution>

Parameters

Name Description
goal: Struct
timeout: TimeDuration

ReturnValue

Name Description
List<Solution>

solveList

open fun solveList(goal: Struct): List<Solution>

Parameters

Name Description
goal: Struct

ReturnValue

Name Description
List<Solution>

solveList

open fun solveList(goal: Struct, options: SolveOptions): List<Solution>

Parameters

Name Description
goal: Struct
options: SolveOptions

ReturnValue

Name Description
List<Solution>

solveOnce

open fun solveOnce(goal: Struct, timeout: TimeDuration): Solution

Parameters

Name Description
goal: Struct
timeout: TimeDuration

ReturnValue

Name Description
Solution

solveOnce

open fun solveOnce(goal: Struct): Solution

Parameters

Name Description
goal: Struct

ReturnValue

Name Description
Solution

solveOnce

open fun solveOnce(goal: Struct, options: SolveOptions): Solution

Parameters

Name Description
goal: Struct
options: SolveOptions

ReturnValue

Name Description
Solution

copy

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

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
Solver

clone

open fun clone(): Solver

ReturnValue

Name Description
Solver

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>

CompanionObject

Solver

interface Solver: ExecutionContextAware, Any

General type for logic solvers, i.e. any entity capable of solving some logic query -- provided as a Struct -- according to some logic, implementing one or more inference rule, via some resolution strategy.

Solvers are not immutable entities. Their state may mutate as an effect of solving queries.

Fields

Name Description
val classic: SolverFactory
val prolog: SolverFactory
val problog: SolverFactory
val streams: SolverFactory

Extensions

classic

fun Solver.Companion.classic(libraries: Libraries, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): Solver

Receiver

Name Description
Solver.Companion

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
Solver

classicWithDefaultBuiltins

fun Solver.Companion.classicWithDefaultBuiltins(libraries: Libraries, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): Solver

Receiver

Name Description
Solver.Companion

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
Solver

streams

fun Solver.Companion.streams(libraries: Libraries, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): Solver

Receiver

Name Description
Solver.Companion

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
Solver

streamsWithDefaultBuiltins

fun Solver.Companion.streamsWithDefaultBuiltins(libraries: Libraries, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): Solver

Receiver

Name Description
Solver.Companion

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
Solver