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

commonMain.it.unibo.tuprolog.solve.classic.fsm.State.kt Maven / Gradle / Ivy

Go to download

Stable, state-machine-based implementation of Prolog's SLDNF resolution principle

There is a newer version: 1.0.4
Show newest version
package it.unibo.tuprolog.solve.classic.fsm

import it.unibo.tuprolog.solve.classic.ClassicExecutionContext
import kotlin.js.JsName

interface State {
    @JsName("isEndState")
    val isEndState: Boolean
        get() = false

    @JsName("asEndState")
    fun asEndState(): EndState? = null

    @JsName("castToEndState")
    fun castToEndState(): EndState =
        asEndState() ?: throw ClassCastException("Cannot cast $this to ${EndState::class.simpleName}")

    @JsName("context")
    val context: ClassicExecutionContext

    @JsName("next")
    fun next(): State

    @JsName("clone")
    fun clone(context: ClassicExecutionContext = this.context): State
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy