commonMain.it.unibo.tuprolog.solve.library.Runtime.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of solve-jvm Show documentation
Show all versions of solve-jvm Show documentation
Resolution-agnostic API for logic solvers
package it.unibo.tuprolog.solve.library
import it.unibo.tuprolog.solve.library.impl.RuntimeImpl
import it.unibo.tuprolog.theory.Theory
import it.unibo.tuprolog.unify.Unificator
import kotlin.js.JsName
import kotlin.jvm.JvmStatic
/** Represents a group of [Library] objects constituting the runtime a logic solver may leverage upon */
interface Runtime : Pluggable, Map {
@JsName("aliases")
val aliases: Set
/** All libraries composing this library group */
@JsName("libraries")
val libraries: Set
@JsName("asTheory")
fun asTheory(unificator: Unificator): Theory
@JsName("plusLibrary")
operator fun plus(other: Library): Runtime
/** Adds all libraries in provided libraryGroup to this libraryGroup */
@JsName("plusRuntime")
operator fun plus(runtime: Runtime): Runtime
/** Removes the library from this library group */
@JsName("minus")
operator fun minus(library: Library): Runtime
/** Updates an already contained library, with given library */
@JsName("update")
fun update(library: Library): Runtime
@JsName("minusAlias")
operator fun minus(alias: String): Runtime
@JsName("minusAliases")
operator fun minus(aliases: Iterable): Runtime
companion object {
@JsName("empty")
@JvmStatic
fun empty(): Runtime = RuntimeImpl(emptySequence())
@JsName("of")
@JvmStatic
fun of(vararg library: Library): Runtime = RuntimeImpl(sequenceOf(*library))
@JsName("ofIterable")
@JvmStatic
fun of(libraries: Iterable): Runtime = RuntimeImpl(libraries.asSequence())
@JsName("ofSequence")
@JvmStatic
fun of(libraries: Sequence): Runtime = RuntimeImpl(libraries)
}
}