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

commonMain.it.unibo.tuprolog.collections.rete.custom.ReteNode.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: 0.17.4
Show newest version
package it.unibo.tuprolog.collections.rete.custom

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

/**A data structure to manage the basic behaviour of the [ReteTree]*/
internal interface ReteNode : Cacheable {

    /**Reads all the clauses matching the given [Clause]*/
    fun get(clause: Clause): Sequence

    /**Insert an [IndexedClause] at the beginning of the rightful place it should be stored in*/
    fun assertA(clause: IndexedClause)

    /**Insert an [IndexedClause] at the end of the rightful place it should be stored in*/
    fun assertZ(clause: IndexedClause)

    /**Removes all the clauses matching the given [Clause], returning all of them as a [Sequence] of [Clause]*/
    fun retractAll(clause: Clause): Sequence

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy