AbstractSolver
Base Solver implementation, factoring out the state-management concerns common to every resolution strategy (initializing and updating the current ExecutionContext, loading/partitioning the initial static and dynamic knowledge bases and running their directives, honouring SolveOptions.limit/SolveOptions.isEager) so that concrete solver modules (:solve-classic, :solve-streams, :solve-concurrent) only have to implement solveImpl (the actual resolution algorithm), initializeContext (to produce their own E subtype), and copy/clone.
Parameters
if true, initialStaticKb/initialDynamicKb are assumed to have already been partitioned and their directives already run, skipping initializeKb.
Type Parameters
the concrete ExecutionContext subtype used by the resolution strategy.
Constructors
Properties
The currently open input channels
Loaded operators
The currently open output channels
Shortcut for the standard error channel defined in outputChannels. Returns null if the channel is closed
Shortcut for the standard input channel defined in inputChannels. Returns null if the channel is closed
Shortcut for the standard output channel defined in outputChannels. Returns null if the channel is closed
Shortcut for the warnings channel defined in outputChannels. Returns null if the channel is closed
Functions
Creates a new Solver, sharing the same resolution strategy as this one, but with every explicitly-provided argument replacing the corresponding piece of state; arguments left unspecified default to this solver's current value. Useful to derive variants of a solver overriding just a few "mutable aspects" (e.g. redirecting stdOut while keeping everything else identical).
Shorthand for solve with SolveOptions.DEFAULT (i.e. all solutions, lazily, without a timeout).
Shorthand for solve with options set to SolveOptions.allLazilyWithTimeout of timeout.
Solves the goal built by scopedContext within a fresh, empty Scope (useful to build the goal Struct using scoped variables inline), capping resolution to maxDuration.
Shorthand for solveList with SolveOptions.DEFAULT.
Eagerly solves goal and collects every produced Solution into a List. Unlike solve, this always computes solutions eagerly regardless of SolveOptions.isLazy -- be mindful of goals with infinite (or very large) solution sets, which will make this method never return (or exhaust memory).
Shorthand for solveList with options set to SolveOptions.allLazilyWithTimeout of timeout.
Shorthand for solveOnce with SolveOptions.someLazily of 1.
Solves goal and eagerly returns its first Solution only, regardless of options' SolveOptions.limit (which is overridden to 1 via SolveOptions.setLimit).
Shorthand for solveOnce with a timeout, and a limit of 1 solution.