Companion

object Companion

Functions

Link copied to clipboard

Shorthand for of with every parameter defaulted, i.e. a scope backed by a brand-new, empty Scope, the defaultUnificator unification strategy and an IndexedTheoryFactory built on it.

Link copied to clipboard
fun of(scope: Scope = Scope.empty(), termificator: Termificator = Termificator.default(scope), variablesProvider: VariablesProvider = VariablesProvider.of(scope), unificator: Unificator = defaultUnificator, theoryFactory: TheoryFactory = IndexedTheoryFactory(unificator)): LogicProgrammingScope

Creates a new LogicProgrammingScope backed by scope (a fresh, empty one by default), using termificator to convert plain values into it.unibo.tuprolog.core.Terms, variablesProvider to create fresh variables, unificator (the defaultUnificator strategy unless stated otherwise) to unify them, and theoryFactory (an IndexedTheoryFactory over unificator by default) to build it.unibo.tuprolog.theory.Theory/it.unibo.tuprolog.theory.MutableTheory instances. If termificator or variablesProvider is not already backed by scope, it is Termificator.copy/VariablesProvider.copy-ed onto it first; if theoryFactory is not already using unificator, it is TheoryFactory.copy-ed onto it first — so all four end up agreeing on the same Scope/Unificator (a requirement of the returned scope's implementation).

fun of(unificator: Unificator, theoryFactory: TheoryFactory = IndexedTheoryFactory(unificator), scope: Scope = Scope.empty(), termificator: Termificator = Termificator.default(scope), variablesProvider: VariablesProvider = VariablesProvider.of(scope)): LogicProgrammingScope

Overload of of taking unificator and theoryFactory as its first parameters (rather than last), so a non-default Unificator/TheoryFactory can be supplied positionally without naming the argument — as logicProgramming and lp do.