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

commonMain.it.unibo.tuprolog.solve.SolverExtensions.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
@file:JvmName("SolverExtensions")
package it.unibo.tuprolog.solve

import it.unibo.tuprolog.solve.channel.InputChannel
import it.unibo.tuprolog.solve.channel.OutputChannel
import it.unibo.tuprolog.solve.exception.PrologWarning
import it.unibo.tuprolog.solve.library.Libraries
import it.unibo.tuprolog.theory.Theory
import kotlin.jvm.JvmName

fun Solver.Companion.streams(
    libraries: Libraries = Libraries(),
    flags: PrologFlags = emptyMap(),
    staticKb: Theory = Theory.empty(),
    dynamicKb: Theory = Theory.empty(),
    stdIn: InputChannel = InputChannel.stdIn(),
    stdOut: OutputChannel = OutputChannel.stdOut(),
    stdErr: OutputChannel = OutputChannel.stdOut(),
    warnings: OutputChannel = OutputChannel.stdOut()
): Solver =
    StreamsSolverFactory.solverOf(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)

fun Solver.Companion.streamsWithDefaultBuiltins(
    libraries: Libraries = Libraries(),
    flags: PrologFlags = emptyMap(),
    staticKb: Theory = Theory.empty(),
    dynamicKb: Theory = Theory.empty(),
    stdIn: InputChannel = InputChannel.stdIn(),
    stdOut: OutputChannel = OutputChannel.stdOut(),
    stdErr: OutputChannel = OutputChannel.stdOut(),
    warnings: OutputChannel = OutputChannel.stdOut()
): Solver =
    StreamsSolverFactory.solverWithDefaultBuiltins(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)

fun MutableSolver.Companion.streams(
    libraries: Libraries = Libraries(),
    flags: PrologFlags = emptyMap(),
    staticKb: Theory = Theory.empty(),
    dynamicKb: Theory = Theory.empty(),
    stdIn: InputChannel = InputChannel.stdIn(),
    stdOut: OutputChannel = OutputChannel.stdOut(),
    stdErr: OutputChannel = OutputChannel.stdOut(),
    warnings: OutputChannel = OutputChannel.stdOut()
): MutableSolver =
    StreamsSolverFactory.mutableSolverOf(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)

fun MutableSolver.Companion.streamsWithDefaultBuiltins(
    libraries: Libraries = Libraries(),
    flags: PrologFlags = emptyMap(),
    staticKb: Theory = Theory.empty(),
    dynamicKb: Theory = Theory.empty(),
    stdIn: InputChannel = InputChannel.stdIn(),
    stdOut: OutputChannel = OutputChannel.stdOut(),
    stdErr: OutputChannel = OutputChannel.stdOut(),
    warnings: OutputChannel = OutputChannel.stdOut()
): MutableSolver =
    StreamsSolverFactory.mutableSolverWithDefaultBuiltins(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy