ClauseQueue

A ClauseCollection that preserves insertion order and exposes it through addFirst/addLast and FIFO/LIFO-ordered retrieval (getFifoOrdered/getLifoOrdered). This is the shape Theory uses to store its clauses, since Prolog's SLD resolution requires clauses to be tried in the order they were asserted; the ordering is what the isOrdered flag of the underlying it.unibo.tuprolog.collections.rete.custom.ReteTree controls.

See also

Inheritors

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
open override fun add(clause: Clause): ClauseQueue

Gives a freshly produced ClauseQueue including the given Clause and the content of this one. Analogous to addFirst

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

Gives a freshly produced ClauseQueue including all the given Clause and the content of this one

Link copied to clipboard
abstract fun addFirst(clause: Clause): ClauseQueue

Gives a freshly produced ClauseQueue including the given Clause in the first position and the content of this one

Link copied to clipboard
abstract fun addLast(clause: Clause): ClauseQueue

Gives a freshly produced ClauseQueue including the given Clause in the last position and the content of this one

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
open operator fun get(clause: Clause): Sequence<Clause>

Produces a Sequence of the clauses that would unify over the given Clause. Analogous to getFifoOrdered

Link copied to clipboard
abstract fun getFifoOrdered(clause: Clause): Sequence<Clause>

Produces a Sequence of the clauses that would unify over the given Clause, scanning from data structure from the first position to the last one

Link copied to clipboard
abstract fun getLifoOrdered(clause: Clause): Sequence<Clause>

Produces a Sequence of the clauses that would unify over the given Clause, scanning from data structure from the last position to the first

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
open override fun retrieve(clause: Clause): RetrieveResult<out ClauseQueue>

Retrieve the first Clause unifying the given one. Analogous to retrieveFirst

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

Retrieve all the Clause unifying the given one

Link copied to clipboard
abstract fun retrieveFirst(clause: Clause): RetrieveResult<out ClauseQueue>

Retrieve the first Clause unifying the given one, searching from the first position