Package-level declarations

Types

Link copied to clipboard

A general-purpose, immutable container of Clauses, matched by unification rather than by equality: this is the low-level storage abstraction that a it.unibo.tuprolog.theory.Theory builds its Prolog-flavoured API (assertA/assertZ/retract) on top of. Every mutating operation (add, addAll, retrieve, retrieveAll) returns a new collection, leaving this untouched — see MutableClauseCollection for the in-place counterpart.

Link copied to clipboard

A ClauseCollection that drops ordering guarantees in exchange for a slightly cheaper count/get when many clauses can match a single query shape and their relative order does not matter. Used internally as the storage for index buckets of the RETE tree that also backs ClauseQueue; Theory itself always uses ClauseQueue, since Prolog's SLD resolution needs clause order preserved.

Link copied to clipboard

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.

Link copied to clipboard

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.

Link copied to clipboard

A ClauseMultiSet that mutates itself in place; see MutableClauseCollection for why this trades away immutability.

Link copied to clipboard

A ClauseQueue that mutates itself in place; see MutableClauseCollection for why this trades away immutability.

Link copied to clipboard

The outcome of a ClauseCollection.retrieve/ClauseCollection.retrieveAll (or ClauseQueue.retrieveFirst) operation: either Success, carrying the resulting collection and the clauses that were actually removed from it, or Failure, carrying the collection unchanged because no clause matched. This is the ClauseCollection-level counterpart of it.unibo.tuprolog.theory.RetractResult, which wraps it to implement it.unibo.tuprolog.theory.Theory.retract.