LogicProgrammingScopeImpl
Default, stateless implementation of LogicProgrammingScope: forwards VariablesProvider, Unificator and TheoryFactory operations to variablesProvider, unificator and theoryFactory respectively (via Kotlin delegation), and every other scope operation up its supertypes' default implementations. Obtained through LogicProgrammingScope.of/LogicProgrammingScope.empty rather than constructed directly in typical usage.
Throws
if scope is not the same object as both termificator's and variablesProvider's scope, or if unificator is not equal to theoryFactory's.
Constructors
Properties
The TheoryFactory this scope's TheoryFactory implementation (and theory/mutableTheory) forward to.
Functions
Copies this scope onto scope, propagating it to termificator and variablesProvider as well.
Copies this scope onto unificator, propagating it to theoryFactory as well.
Builds a MutableTheory out of clauseFunctions, one per clause. Otherwise identical to theory, down to how each lambda is run and its result converted via toClause; delegates to TheoryFactory.mutableTheoryOf (via theoryFactory).
Overload of TheoryFactory.mutableTheoryOf concatenating clauses and otherClauses into one MutableTheory.
Creates a fresh LogicProgrammingScope, backed by a brand-new, empty Scope; see copy.
Builds a Theory out of clauseFunctions, one per clause: each lambda runs with a fresh newScope as its receiver, and its result is coerced into a Clause via toClause — so it may return an already-built Clause (from it.unibo.tuprolog.core.Scope.factOf/it.unibo.tuprolog.core.Scope.ruleOf/ it.unibo.tuprolog.core.Scope.directiveOf) or a plain it.unibo.tuprolog.core.Struct, as shown in this interface's example. Delegates to TheoryFactory.theoryOf (via theoryFactory) for the actual construction.
Overload of TheoryFactory.theoryOf concatenating clauses and otherClauses into a single Theory.
Converts this value into a Clause: returned as-is if it.unibo.tuprolog.dsl.BaseLogicProgrammingScope.toTerm already yields a Clause (e.g. a it.unibo.tuprolog.core.Rule, it.unibo.tuprolog.core.Fact or it.unibo.tuprolog.core.Directive), or wrapped into a headless-body Clause via it.unibo.tuprolog.core.Scope.clauseOf if it is a plain it.unibo.tuprolog.core.Struct (mirroring how it.unibo.tuprolog.dsl.MinimalLogicProgrammingScope.fact wraps a bare it.unibo.tuprolog.core.Struct via it.unibo.tuprolog.core.Scope.factOf).