commonMain.it.unibo.tuprolog.solve.function.NullaryMathFunction.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.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