commonMain.it.unibo.tuprolog.dsl.theory.DSL.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dsl-theory-jvm Show documentation
Show all versions of dsl-theory-jvm Show documentation
Kotlin DSL for logic programming, enriched with unification and clause storage facilities
@file:JvmName("DSL")
package it.unibo.tuprolog.dsl.theory
import it.unibo.tuprolog.theory.IndexedTheoryFactory
import it.unibo.tuprolog.theory.TheoryFactory
import it.unibo.tuprolog.unify.Unificator
import kotlin.js.JsName
import kotlin.jvm.JvmName
import it.unibo.tuprolog.dsl.LogicProgrammingScope as CoreLogicProgrammingScope
import it.unibo.tuprolog.dsl.unify.LogicProgrammingScope as UnifyLogicProgrammingScope
@JsName("logicProgramming")
fun logicProgramming(
unificator: Unificator = LogicProgrammingScope.defaultUnificator,
function: LogicProgrammingScope.() -> R,
): R = LogicProgrammingScope.of(unificator).function()
@JsName("lp")
fun lp(
unificator: Unificator = LogicProgrammingScope.defaultUnificator,
function: LogicProgrammingScope.() -> R,
): R = logicProgramming(unificator, function)
@Deprecated("Use `lp` or `logicProgramming` instead", ReplaceWith("lp(function)"))
@JsName("prolog")
fun prolog(
unificator: Unificator = LogicProgrammingScope.defaultUnificator,
function: LogicProgrammingScope.() -> R,
): R = logicProgramming(unificator, function)
fun CoreLogicProgrammingScope.withTheories(unificator: Unificator = LogicProgrammingScope.defaultUnificator) =
LogicProgrammingScope.of(unificator, IndexedTheoryFactory(unificator), scope, termificator, variablesProvider)
fun UnifyLogicProgrammingScope.withTheories(
unificator: Unificator = LogicProgrammingScope.defaultUnificator,
theoryFactory: TheoryFactory = IndexedTheoryFactory(unificator),
) = LogicProgrammingScope.of(unificator, theoryFactory, scope, termificator, variablesProvider)
© 2015 - 2025 Weber Informatics LLC | Privacy Policy