LogicProgrammingScopeWithPrologStandardLibrary
Adds one builder per predicate of (roughly) the ISO Prolog standard library — plus a handful of well-known de-facto standard ones (assert, findall, member, ...) — so common goals can be written as ordinary Kotlin function/property calls instead of structOf("member", item, list)-style boilerplate:
logicProgramming {
findall("X", call("member".invoke("X", "List")), "Bag") // findall(X, call(member(X, List)), Bag)
not(atom("X")) `if` (`var`("X")) // not(atom(X)) :- var(X)
}Each builder simply wraps its arguments (auto-toTerm-ed) into a Struct named after the predicate; none of them actually run the predicate — that is :dsl-solve's job, further up the DSL stack. A few predicates not representable as legal Kotlin identifiers as-is are escaped with backticks (` `catch` `, ` `throw` `, ` `var` `) or renamed (e.g. naf for \+/1).
Inheritors
Properties
The at_end_of_stream/0 Atom.
The Termificator used by toTerm to convert arbitrary values into Terms within this scope.
Functions
Builds an at_end_of_stream/1 Struct.
Builds an atom_chars/2 Struct.
Builds an atom_codes/2 Struct.
Builds an atom_length/2 Struct.
Builds a current_flag/2 Struct.
Builds a current_prolog_flag/2 Struct. Deprecated in favor of current_flag.
Builds an initialization/1 Struct.
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 a number_chars/2 Struct.
Builds a number_codes/2 Struct.
Builds a retractall/1 Struct.
Converts this value into a Term, via termificator. See Termificator.termify for the conversion rules.