commonMain.it.unibo.tuprolog.solve.streams.stdlib.primitive.Cut.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of solve-streams-jvm Show documentation
Show all versions of solve-streams-jvm Show documentation
Experimental, functional-programming-based implementation of Prolog's SLDNF resolution principle
package it.unibo.tuprolog.solve.streams.stdlib.primitive
import it.unibo.tuprolog.solve.primitive.PrimitiveWrapper
import it.unibo.tuprolog.solve.primitive.Solve
import it.unibo.tuprolog.solve.streams.solver.StreamsExecutionContext
/**
* Implementation of primitive handling `'!'/0` behaviour
*
* @author Enrico
*/
internal object Cut : PrimitiveWrapper("!", 0) {
override fun uncheckedImplementation(request: Solve.Request): Sequence =
with(request) {
sequenceOf(
replySuccess(
context.substitution,
sideEffectManager = context.sideEffectManager.cut(),
),
)
}
}