IndexedTheoryFactory

A TheoryFactory that produces Theory/MutableTheory instances backed by an indexed data structure (see it.unibo.tuprolog.collections.rete.custom.ReteTree): clauses are discriminated by directive-vs-rule, functor, arity and first-argument shape, so retrieval only re-checks the (typically small) subset of clauses that could actually unify with a goal, at the cost of extra bookkeeping on every insertion/removal. This is the right choice for knowledge bases that are built once (or rarely changed) and queried many times — e.g. a solver's static knowledge base.

See also

Constructors

Link copied to clipboard
constructor(unificator: Unificator)

Types

Link copied to clipboard

Properties

Link copied to clipboard
open override val unificator: Unificator

Functions

Link copied to clipboard
open override fun copy(unificator: Unificator): TheoryFactory

Returns a factory equivalent to this one, but using the given unificator as its default.

Link copied to clipboard
open override fun emptyMutableTheory(unificator: Unificator): MutableTheory

Creates an empty MutableTheory using the given unificator.

Creates an empty MutableTheory using this factory's unificator.

Link copied to clipboard
open override fun emptyTheory(unificator: Unificator): Theory

Creates an empty Theory using the given unificator.

open fun emptyTheory(): Theory

Creates an empty Theory using this factory's unificator.

Link copied to clipboard
open override fun mutableTheoryOf(unificator: Unificator, vararg clauses: Clause): MutableTheory
open override fun mutableTheoryOf(clauses: Iterable<Clause>, unificator: Unificator): MutableTheory
open override fun mutableTheoryOf(clauses: Sequence<Clause>, unificator: Unificator): MutableTheory

Creates a MutableTheory containing the given clauses, using the given unificator.

open fun mutableTheoryOf(vararg clauses: Clause): MutableTheory

Creates a MutableTheory containing the given clauses, using this factory's unificator.

Link copied to clipboard
open override fun theoryOf(unificator: Unificator, vararg clauses: Clause): Theory
open override fun theoryOf(clauses: Iterable<Clause>, unificator: Unificator): Theory
open override fun theoryOf(clauses: Sequence<Clause>, unificator: Unificator): Theory

Creates a Theory containing the given clauses, using the given unificator.

open fun theoryOf(clauses: Iterable<Clause>): Theory
open fun theoryOf(clauses: Sequence<Clause>): Theory
open fun theoryOf(vararg clauses: Clause): Theory

Creates a Theory containing the given clauses, using this factory's unificator.