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

commonMain.it.unibo.tuprolog.solve.streams.SolverExtensions.kt Maven / Gradle / Ivy

@file:JvmName("SolverExtensions")

package it.unibo.tuprolog.solve.streams

import it.unibo.tuprolog.solve.MutableSolver
import it.unibo.tuprolog.solve.Solver
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.flags.FlagStore
import it.unibo.tuprolog.solve.library.Libraries
import it.unibo.tuprolog.theory.Theory
import kotlin.jvm.JvmName

fun Solver.Companion.streams(
    libraries: Libraries = StreamsSolverFactory.defaultLibraries,
    flags: FlagStore = StreamsSolverFactory.defaultFlags,
    staticKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    dynamicKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    stdIn: InputChannel = StreamsSolverFactory.defaultInputChannel,
    stdOut: OutputChannel = StreamsSolverFactory.defaultOutputChannel,
    stdErr: OutputChannel = StreamsSolverFactory.defaultErrorChannel,
    warnings: OutputChannel = StreamsSolverFactory.defaultWarningsChannel
): Solver =
    StreamsSolverFactory.solverOf(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)

fun Solver.Companion.streamsWithDefaultBuiltins(
    libraries: Libraries = StreamsSolverFactory.defaultLibraries,
    flags: FlagStore = StreamsSolverFactory.defaultFlags,
    staticKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    dynamicKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    stdIn: InputChannel = StreamsSolverFactory.defaultInputChannel,
    stdOut: OutputChannel = StreamsSolverFactory.defaultOutputChannel,
    stdErr: OutputChannel = StreamsSolverFactory.defaultErrorChannel,
    warnings: OutputChannel = StreamsSolverFactory.defaultWarningsChannel
): Solver =
    StreamsSolverFactory.solverWithDefaultBuiltins(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)

fun MutableSolver.Companion.streams(
    libraries: Libraries = StreamsSolverFactory.defaultLibraries,
    flags: FlagStore = StreamsSolverFactory.defaultFlags,
    staticKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    dynamicKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    stdIn: InputChannel = StreamsSolverFactory.defaultInputChannel,
    stdOut: OutputChannel = StreamsSolverFactory.defaultOutputChannel,
    stdErr: OutputChannel = StreamsSolverFactory.defaultErrorChannel,
    warnings: OutputChannel = StreamsSolverFactory.defaultWarningsChannel
): MutableSolver =
    StreamsSolverFactory.mutableSolverOf(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)

fun MutableSolver.Companion.streamsWithDefaultBuiltins(
    libraries: Libraries = StreamsSolverFactory.defaultLibraries,
    flags: FlagStore = StreamsSolverFactory.defaultFlags,
    staticKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    dynamicKb: Theory = StreamsSolverFactory.defaultDynamicKb,
    stdIn: InputChannel = StreamsSolverFactory.defaultInputChannel,
    stdOut: OutputChannel = StreamsSolverFactory.defaultOutputChannel,
    stdErr: OutputChannel = StreamsSolverFactory.defaultErrorChannel,
    warnings: OutputChannel = StreamsSolverFactory.defaultWarningsChannel
): MutableSolver =
    StreamsSolverFactory.mutableSolverWithDefaultBuiltins(libraries, flags, staticKb, dynamicKb, stdIn, stdOut, stdErr, warnings)




© 2015 - 2025 Weber Informatics LLC | Privacy Policy