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

commonMain.it.unibo.tuprolog.solve.streams.stdlib.primitive.Cut.kt Maven / Gradle / Ivy

Go to download

Experimental, functional-programming-based implementation of Prolog's SLDNF resolution principle

There is a newer version: 1.0.4
Show newest version
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()
                )
            )
        }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy