MinimalLogicProgrammingScope
Core term/clause-building mixin of the Prolog DSL: overloads it.unibo.tuprolog.core.Scope's own structOf/tupleOf/logicListOf/... factory methods to accept plain Any arguments (auto-toTerm-ed), adds the "calling a String" shorthand for building Structs, and adds scoped clause builders (rule/fact/directive/clause) that isolate each clause's variables in their own newScope.
Calling a String with one or more arguments builds a Struct with that string as functor:
logicProgramming {
"parent"("abraham", "isaac") // Struct: parent(abraham, isaac)
"ancestor"("X", "Y") // "X"/"Y" are termified to Vars, since they match a variable name pattern
}Inheritors
Properties
The Termificator used by toTerm to convert arbitrary values into Terms within this scope.
Functions
Overload of it.unibo.tuprolog.core.Scope.directiveOf accepting plain values, toTerm-ing term and each of terms.
Overload of it.unibo.tuprolog.core.Scope.logicListOf accepting plain values, toTerm-ing each of terms.
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.
Overload of it.unibo.tuprolog.core.Scope.structOf accepting plain values, toTerm-ing each of args.
Converts this value into a Term, via termificator. See Termificator.termify for the conversion rules.