ProblogSolverFactory

The SolverFactory for :solve-problog, a ProbLog-style probabilistic logic programming engine built on top of ClassicSolverFactory's SLD-NF resolution.

ProbLog extends plain Prolog with annotated disjunctions -- clauses and facts whose head is prefixed by a probability, using the :: operator declared in ANNOTATION_OPERATOR (e.g. 0.3::burglary., read as "burglary holds with probability 0.3"), and with evidence/1/evidence/2 clauses stating facts known for certain. Every Solver produced by this factory rewrites such a theory into a plain, Prolog-compliant one (see the internal it.unibo.tuprolog.solve.problog.lib.knowledge.impl clause mappers) in which each probabilistic clause carries along a Boolean "explanation" term; when a query is solved with it.unibo.tuprolog.solve.isProbabilistic turned on (see it.unibo.tuprolog.solve.SolveOptions), those per-solution explanations are compiled into a :bdd BinaryDecisionDiagram and weighted-model-counted to compute the solution's overall probability -- exposed on each it.unibo.tuprolog.solve.Solution via it.unibo.tuprolog.solve.probability and, when requested, the diagram itself via it.unibo.tuprolog.solve.binaryDecisionDiagram. With probabilistic mode turned off, resolution behaves like plain Prolog and annotations are ignored (every solution is treated as certain, i.e. probability 1.0).

Solvers built by this factory always load ProblogLib (adding it to libraries if not already present) and force the TrackVariables flag ON, because variable tracking is required to compute explanations correctly.

See also

Properties

Link copied to clipboard
open override val defaultBuiltins: Library

The standard library of this factory: ProblogLib's builtins, contributing the :: operator, the probabilistic resolution primitives and rules, and (transitively) the classic Prolog builtins.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override val defaultFlags: FlagStore

Same as SolverFactory.defaultFlags, but with TrackVariables forced ON, since ProbLog resolution relies on variable substitutions being tracked to build correct explanations.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open override fun mutableSolverOf(unificator: Unificator, libraries: Runtime, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, inputs: InputStore, outputs: OutputStore): MutableSolver
open override fun mutableSolverOf(unificator: Unificator, libraries: Runtime, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): MutableSolver

Same as mutableSolverOf (the InputStore/OutputStore overload), but takes individual channels.

Link copied to clipboard
open fun mutableSolverWithDefaultBuiltins(unificator: Unificator, otherLibraries: Runtime, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): MutableSolver
Link copied to clipboard
Link copied to clipboard
open override fun solverOf(unificator: Unificator, libraries: Runtime, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, inputs: InputStore, outputs: OutputStore): Solver

Same as SolverFactory.solverOf, but ensures ProblogLib is loaded (see fixLibraries), forces TrackVariables ON, and rewrites staticKb/dynamicKb into a it.unibo.tuprolog.solve.problog.lib.knowledge.ProblogTheory before handing everything to ClassicSolverFactory.

open override fun solverOf(unificator: Unificator, libraries: Runtime, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): Solver

Same as solverOf (the InputStore/OutputStore overload), but takes individual channels.

Link copied to clipboard
open fun solverWithDefaultBuiltins(unificator: Unificator, otherLibraries: Runtime, flags: FlagStore, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<Warning>): Solver