LogicProgrammingScope
Full term-construction scope of :dsl-core's Prolog DSL: composes every mixin this module defines — MinimalLogicProgrammingScope (structs, lists, clauses), LogicProgrammingScopeWithSubstitutions, LogicProgrammingScopeWithPrologStandardLibrary, LogicProgrammingScopeWithOperators and LogicProgrammingScopeWithVariables — into a single receiver type, self-referential (each mixin's own BaseLogicProgrammingScope type parameter is bound back to LogicProgrammingScope itself) so that BaseLogicProgrammingScope.newScope/scope/rule/fact/... all keep resolving to this same, richest type.
logicProgramming/lp are the idiomatic way to obtain and use one; of and empty exist for callers that need to plug in a custom Termificator or VariablesProvider (or build a scope without immediately entering it). Further modules in the DSL stack (:dsl-unify, :dsl-theory, :dsl-solve) each define their own LogicProgrammingScope extending this one with more mixins (unification, theories, resolution).
See also
Properties
The at_end_of_stream/0 Atom.
The Termificator used by toTerm to convert arbitrary values into Terms within this scope.
The VariablesProvider this scope's own VariablesProvider methods delegate to.
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 clause/2 Struct; not to be confused with MinimalLogicProgrammingScope.clause.
Checks whether this Substitution binds term.
Checks whether term (auto-toTerm-ed) occurs as a bound value in this Substitution.
Creates a copy of this scope, backed by scope (see VariablesProvider.copy).
Builds a current_flag/2 Struct.
Builds a current_prolog_flag/2 Struct. Deprecated in favor of current_flag.
Runs function with a newScope as its receiver and coerces its result to a Directive via directiveOf.
Overload of it.unibo.tuprolog.core.Scope.directiveOf accepting plain values, toTerm-ing term and each of terms.
Builds a >/2 Struct (arithmetic greater-than).
Builds a >=/2 Struct (arithmetic greater-than-or-equal).
Builds the Rule this :- other, i.e. other implies (is the body of a rule whose head is) this value.
Vararg overload of impliedBy: wraps other into a single conjunction (via Tuple.wrapIfNeeded) before building the Rule, so a multi-goal body can be listed as separate arguments instead of chained with and.
Builds an initialization/1 Struct.
Overload of it.unibo.tuprolog.core.Scope.logicListOf accepting plain values, toTerm-ing each of terms.
Builds an =</2 Struct (arithmetic lower-than-or-equal).
Builds a -/2 Struct, e.g. "X" - 1.
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.
Alias of lowerThanOrEqualsTo.
Alias of greaterThanOrEqualsTo.
Builds a \=/2 Struct (term non-unifiability).
Builds a number_chars/2 Struct.
Builds a number_codes/2 Struct.
Builds a +/2 Struct, e.g. 1 + "X".
Builds a rem/2 Struct (integer remainder).
Builds a retractall/1 Struct.
Runs function with a newScope as its receiver and coerces its result to a Rule — typically built via the head ifbody / head impliedBybody infix builders from LogicProgrammingScopeWithOperators.
Runs function with a newScope as its receiver, isolating any it.unibo.tuprolog.core.Var it creates.
Overload of it.unibo.tuprolog.core.Scope.structOf accepting plain values, toTerm-ing each of args.
Builds a */2 Struct, e.g. "X" * 2.
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.