Solver

interface Solver : ExecutionContextAware

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.

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open fun clone(): Solver
Link copied to clipboard
abstract fun copy(    libraries: Libraries = Libraries.empty(),     flags: FlagStore = FlagStore.empty(),     staticKb: <ERROR CLASS> = Theory.empty(),     dynamicKb: <ERROR CLASS> = MutableTheory.empty(),     stdIn: InputChannel<String> = InputChannel.stdIn(),     stdOut: OutputChannel<String> = OutputChannel.stdOut(),     stdErr: OutputChannel<String> = OutputChannel.stdErr(),     warnings: OutputChannel<Warning> = OutputChannel.warn()): Solver
Link copied to clipboard
open fun solve(goal: <ERROR CLASS>): Sequence<Solution>
abstract fun solve(goal: <ERROR CLASS>, options: SolveOptions): Sequence<Solution>
open fun solve(goal: <ERROR CLASS>, timeout: TimeDuration): Sequence<Solution>
Link copied to clipboard
open fun solveList(goal: <ERROR CLASS>): List<Solution>
open fun solveList(goal: <ERROR CLASS>, options: SolveOptions): List<Solution>
open fun solveList(goal: <ERROR CLASS>, timeout: TimeDuration): List<Solution>
Link copied to clipboard
open fun solveOnce(goal: <ERROR CLASS>): Solution
open fun solveOnce(goal: <ERROR CLASS>, options: SolveOptions): Solution
open fun solveOnce(goal: <ERROR CLASS>, timeout: TimeDuration): Solution

Properties

Link copied to clipboard
abstract val dynamicKb: <ERROR CLASS>

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

Link copied to clipboard
abstract val flags: FlagStore

Enabled flags

Link copied to clipboard
abstract val inputChannels: InputStore

The currently open input channels

Link copied to clipboard
abstract val libraries: Libraries

Loaded libraries

Link copied to clipboard
abstract val operators: <ERROR CLASS>

Loaded operators

Link copied to clipboard
abstract val outputChannels: OutputStore

The currently open output channels

Link copied to clipboard
open val standardError: OutputChannel<String>

Shortcut for the standard error channel defined in outputChannels. Returns null if the channel is closed

Link copied to clipboard
open val standardInput: InputChannel<String>

Shortcut for the standard input channel defined in inputChannels. Returns null if the channel is closed

Link copied to clipboard
open val standardOutput: OutputChannel<String>

Shortcut for the standard output channel defined in outputChannels. Returns null if the channel is closed

Link copied to clipboard
abstract val staticKb: <ERROR CLASS>

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

Link copied to clipboard
open val warnings: OutputChannel<Warning>

Shortcut for the warnings channel defined in outputChannels. Returns null if the channel is closed

Inheritors

Link copied to clipboard
Link copied to clipboard

Extensions

Link copied to clipboard
fun Solver.solve(maxDuration: TimeDuration = TimeDuration.MAX_VALUE, scopedContext: <ERROR CLASS>.() -> <ERROR CLASS>): Sequence<Solution>