All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.it.unibo.tuprolog.collections.rete.custom.IndexingLeaf.kt Maven / Gradle / Ivy

Go to download

In-memory storage and indexing facilities for ordered and unordered knowledge bases composed by logic clauses

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog.collections.rete.custom

import it.unibo.tuprolog.collections.rete.custom.clause.SituatedIndexedClause
import it.unibo.tuprolog.core.Clause

/**Denotes a [ReteNode] capable of managing intermediate operation upon its children,
 * so that the results these will provide can be more fine grained elaborated*/
internal interface IndexingLeaf : ReteNode {
    /**Read the single first [SituatedIndexedClause] matching the given [Clause], returning null if
     * such a condition is never met. The concept of "first" may vary between implementations */
    fun getFirstIndexed(clause: Clause): SituatedIndexedClause?

    /** Returns a [Sequence] of [SituatedIndexedClause] based on the union of all the matching claues
     * available to this node
     * */
    fun getIndexed(clause: Clause): Sequence

    /**Retracts all the clauses matching the given [Clause] as a [Sequence] of [SituatedIndexedClause]*/
    fun retractAllIndexed(clause: Clause): Sequence

    /**Variant of [getIndexed] aimed at preventing a proper traversal of the children of this node,
     * retrieving all the clauses matching the given [Clause] without performing any branch selection*/
    fun extractGlobalIndexedSequence(clause: Clause): Sequence
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy