commonMain.it.unibo.tuprolog.solve.channel.Channel.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.channel
import it.unibo.tuprolog.core.Atom
import it.unibo.tuprolog.core.Struct
import it.unibo.tuprolog.core.Var
import kotlin.js.JsName
import kotlin.jvm.JvmStatic
interface Channel {
@JsName("addListener")
fun addListener(listener: Listener)
@JsName("removeListener")
fun removeListener(listener: Listener)
@JsName("clearListeners")
fun clearListeners()
@JsName("close")
fun close()
@JsName("isClosed")
val isClosed: Boolean
@JsName("streamTerm")
val streamTerm: Struct
companion object {
@JvmStatic
@JsName("streamTerm")
fun streamTerm(
input: Boolean? = null,
id: String? = null,
): Struct =
Struct.of(
"\$stream",
input?.let { if (it) "in" else "out" }?.let { Atom.of(it) } ?: Var.anonymous(),
id?.let { Atom.of(it) } ?: Var.anonymous(),
)
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy