MutableClauseCollection

A ClauseCollection that mutates itself in place: add/addAll/retrieve/retrieveAll change and return this, instead of building a fresh collection. Preferred over the immutable ClauseCollection when clauses are inserted/removed very frequently and the cost of copying (or of the underlying RETE tree's deepCopy) would otherwise dominate.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Only the clauses in this collection that are Directives.

Link copied to clipboard
abstract val rules: Iterable<Rule>

Only the clauses in this collection that are Rules.

Link copied to clipboard
abstract val size: Int

Computes the size of the ClauseCollection

Link copied to clipboard
abstract val unificator: Unificator

The Unificator used to match clauses against each other in this collection.

Functions

Link copied to clipboard
abstract override fun add(clause: Clause): MutableClauseCollection

Adds the given Clause to this MutableClauseCollection.

Link copied to clipboard
abstract override fun addAll(clauses: Iterable<Clause>): MutableClauseCollection

Adds all the given Clause to this MutableClauseCollection

Link copied to clipboard
abstract operator fun contains(element: Clause): Boolean

Tells if the ClauseCollection contains a clause unifying against the given element

Link copied to clipboard
abstract fun containsAll(elements: Iterable<Clause>): Boolean

Tells if, for each of the given elements, the ClauseCollection contains a unifying clause

Link copied to clipboard
abstract fun isEmpty(): Boolean

Tells if the ClauseCollection contains any Clause

Link copied to clipboard
abstract fun isNonEmpty(): Boolean

Tells if the ClauseCollection contains at least one Clause; the negation of isEmpty.

Link copied to clipboard
abstract operator override fun iterator(): Iterator<Clause>

Iterates over all the clauses in this collection, in an order that depends on the concrete implementation (e.g. insertion order for a ClauseQueue, unspecified for a ClauseMultiSet).

Link copied to clipboard
abstract override fun retrieve(clause: Clause): RetrieveResult<out MutableClauseCollection>

Retrieves the first occurrence of the given Clause from this MutableClauseCollection as a RetrieveResult

Link copied to clipboard
abstract override fun retrieveAll(clause: Clause): RetrieveResult<out MutableClauseCollection>

Retrieves all the occurrences of the given Clause from this MutableClauseCollection as a RetrieveResult