Termificator
Converts arbitrary Kotlin values into Prolog Terms, so that DSL builders (see MinimalLogicProgrammingScope and friends) can accept a plain Any — a String, a Number, a Boolean, a List, ... — wherever a Term is expected, instead of forcing callers to spell out atomOf/intOf/logicListOf everywhere.
Conversion is driven by the runtime type of the value being converted:
a Term is returned as-is;
a TermConvertible is converted via TermConvertible.toTerm;
any other type is looked up against a table of registered converters (exact type first, then the first registered supertype the value is an instance of) — see Termificator.default/Termificator.legacy for what is registered by default (numbers, strings, booleans, chars, collections, pairs, maps, ...).
All Terms produced by a given Termificator are created through its scope, so repeated conversions of the same variable name (e.g. "X" appearing twice while building a clause) resolve to the same it.unibo.tuprolog.core.Var.
Throws
if termify is given null, or a value whose runtime type — and none of its registered supertypes — has a registered conversion.
Inheritors
Properties
Functions
Creates a copy of this Termificator, backed by scope (defaulting to this one's own scope).