LogicProgrammingScopeImpl
Default LogicProgrammingScope implementation: forwards VariablesProvider, Unificator, TheoryFactory and MutableSolver operations to its respective collaborator (variablesProvider, unificator, theoryFactory, defaultSolver), and requires (in its init block) that they all share the same Scope/Unificator consistently. Built by LogicProgrammingScope.of (and transitively by logicProgramming/lp/prolog) rather than instantiated directly by client code.
Throws
if scope is not the same object backing both termificator and variablesProvider, or if unificator is not the same object used by theoryFactory, solverFactory and defaultSolver.
Constructors
Builds defaultSolver from solverFactory/unificator via SolverFactory.mutableSolverOf.
Properties
The MutableSolver this scope forwards MutableSolver/it.unibo.tuprolog.solve.Solver operations (solve, staticKb, dynamicKb, assertZ, ...) to. Built once when the scope is created (see LogicProgrammingScopeImpl's secondary constructor) via SolverFactory.mutableSolverOf.
The SolverFactory this scope's defaultSolver was created from, and that solverOf builds further solvers from by default.
Functions
Returns a copy of this scope backed by scope instead, keeping unificator, theoryFactory and solverFactory as-is.
Returns a copy of this scope using unificator instead of the current one, propagating it to theoryFactory and solverFactory (rebuilding solverFactory only if its own default Unificator differs from unificator) — note this rebuilds defaultSolver too, so any static/dynamic KB or configuration already loaded into it is lost.
Replaces defaultSolver's dynamic knowledge base with theory; see MutableSolver.loadDynamicKb.
Replaces defaultSolver's dynamic knowledge base with a Theory indexing clauses; see MutableSolver.loadDynamicClauses.
Returns a fresh scope sharing this one's unificator, theoryFactory and solverFactory but a brand-new, empty Scope.
Builds a brand-new MutableSolver from solverFactory (defaulting every argument to solverFactory's default* values, except unificator which defaults to this scope's own), including solverFactory's standard-library builtins — see SolverFactory.mutableSolverWithDefaultBuiltins. Unlike defaultSolver, this returns an independent solver each time it's called, not the one backing this scope's solve/staticKb calls.
Replaces defaultSolver's static knowledge base with theory; see MutableSolver.loadStaticKb.
Replaces defaultSolver's static knowledge base with a Theory indexing clauses; see MutableSolver.loadStaticClauses.