commonMain.it.unibo.tuprolog.solve.stdlib.primitive.Halt1.kt Maven / Gradle / Ivy
package it.unibo.tuprolog.solve.stdlib.primitive
import it.unibo.tuprolog.core.Term
import it.unibo.tuprolog.solve.ExecutionContext
import it.unibo.tuprolog.solve.exception.HaltException
import it.unibo.tuprolog.solve.primitive.Solve
import it.unibo.tuprolog.solve.primitive.UnaryPredicate
object Halt1 : UnaryPredicate.NonBacktrackable("halt") {
override fun Solve.Request.computeOne(first: Term): Solve.Response {
ensuringArgumentIsNonNegativeInteger(0)
throw HaltException(context = context, exitStatus = (first.castToInteger()).intValue.toInt())
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy