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

commonMain.it.unibo.tuprolog.solve.function.NullaryMathFunction.kt Maven / Gradle / Ivy

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

import it.unibo.tuprolog.core.Numeric
import it.unibo.tuprolog.solve.ExecutionContext

/**
 * Base class to implement nullary math functions (with no arguments)
 *
 * @param name the no arguments function name
 *
 * @author Enrico
 */
abstract class NullaryMathFunction(name: String) : MathFunction(name, 0) {
    override fun uncheckedImplementation(request: Compute.Request): Compute.Response =
        with(request) { replyWith(mathFunction(context)) }

    /** The actual function implementation */
    protected abstract fun mathFunction(context: ExecutionContext): Numeric
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy