RetrieveResult

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.

Inheritors

Types

Link copied to clipboard
data class Failure<C : ClauseCollection>(val collection: C) : RetrieveResult<C>

A failed retrieval result, carrying the unchanged collection.

Link copied to clipboard
data class Success<C : ClauseCollection>(val collection: C, val clauses: List<Clause>) : RetrieveResult<C>

A successful retrieval result, carrying the resulting collection and removed clauses.

Properties

Link copied to clipboard
abstract val clauses: List<Clause>?

The clauses that were actually removed, in removal order; null if the operation isFailure.

Link copied to clipboard
abstract val collection: C

The clause collection resulting from the operation (unchanged, if it isFailure).

Link copied to clipboard
abstract val firstClause: Clause?

The first successfully removed clause; null if the operation isFailure.

Link copied to clipboard
open val isFailure: Boolean

Whether the operation removed no clause at all.

Link copied to clipboard
open val isSuccess: Boolean

Whether the operation removed at least one clause.