LogicProgrammingScope
Full-fledged Prolog DSL scope: assembles every dsl-core/dsl-unify/dsl-theory mixin (MinimalLogicProgrammingScope term/clause builders, LogicProgrammingScopeWithSubstitutions, LogicProgrammingScopeWithPrologStandardLibrary, LogicProgrammingScopeWithOperators, LogicProgrammingScopeWithVariables, LogicProgrammingScopeWithUnification, it.unibo.tuprolog.dsl.theory.LogicProgrammingScopeWithTheories) plus LogicProgrammingScopeWithResolution, the resolution-driving sugar added by this module (solve/staticKb/dynamicKb, and every it.unibo.tuprolog.solve.MutableSolver operation). This is the receiver type of logicProgramming/prolog:
prolog {
staticKb(fact { "parent"("abraham", "isaac") })
solve("parent"("abraham", "X")).forEach { println(it) }
}Obtain an instance via logicProgramming/lp/prolog (typical client code) or directly via of (e.g. to reuse an existing Scope/Termificator/VariablesProvider).
Inheritors
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
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.
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.