LogicProgrammingScopeWithSubstitutions
Adds builders and accessors for Substitutions, so a Var to value pair can be written directly ("X" to 1, mirroring Kotlin's own kotlin.to for Pairs) and a built Substitution can be queried by a plain Var-like value instead of a variable name/Var pair:
logicProgramming {
val subst = "X" to 1 // Substitution.Unifier {X = 1}
subst["X"] // 1, looked up by variable name instead of by Var instance
"X" in subst // true
}Inheritors
Properties
The Termificator used by toTerm to convert arbitrary values into Terms within this scope.
Functions
Checks whether this Substitution binds term.
Checks whether term (auto-toTerm-ed) occurs as a bound value in this Substitution.
Creates a fresh scope of type S, backed by a brand-new, empty Scope — so that it.unibo.tuprolog.core.Vars created within it are unrelated to the ones created through this scope. Used by builders such as MinimalLogicProgrammingScope.rule/MinimalLogicProgrammingScope.fact to isolate each clause's variables.
Builds the Substitution.Unifier binding this Var to termObject (auto-toTerm-ed).
Builds the Substitution.Unifier binding the Var named by this String (via varOf) to termObject.
Converts this value into a Term, via termificator. See Termificator.termify for the conversion rules.