CommonBuiltins

The prolog.lang standard it.unibo.tuprolog.solve.library.Library: the ISO-mandated core built-in predicates, arithmetic functions, and control-construct rules every 2P-Kt solver is expected to ship with.

It merely assembles the other Common* singletons in this package: CommonRules.clauses as clauses, CommonPrimitives.primitives as primitives, and CommonFunctions.functions as functions, plus the default operator table (it.unibo.tuprolog.core.operators.OperatorSet.DEFAULT). It is what it.unibo.tuprolog.solve.SolverFactory.defaultBuiltins is expected to return, and what solverWithDefaultBuiltins(...)/mutableSolverWithDefaultBuiltins(...) add on top of any other it.unibo.tuprolog.solve.library.Runtime.

Properties

Link copied to clipboard
open override val alias: String

The alias identifying this library

Link copied to clipboard
open override val clauses: List<Clause>

Rules, facts, or directories to be loaded by a solver when the library is used

Link copied to clipboard
open override val functions: Map<Signature, LogicFunction>

LogicFunctions to be loaded by a solver when the library is used, indexed by their Signature in the eyes of the solver

Link copied to clipboard
open override val operators: OperatorSet

Operators to be loaded by a solver when the library is used

Link copied to clipboard
open override val primitives: Map<Signature, Primitive>

Primitives to be loaded by a solver when the library is used, indexed by their Signature in the eyes of the solver

Link copied to clipboard

The Signature of every Rule (i.e. non-fact clause) among clauses, deduplicated.

Functions

Link copied to clipboard
open operator fun contains(operator: Operator): Boolean

Checks whether this library contains the definition of provided operator

open operator fun contains(signature: Signature): Boolean

Checks whether this library contains the provided signature.

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard

Shorthand for this Library's declared Library.operators, as a Sequence.

Link copied to clipboard
open fun hasFunction(signature: Signature): Boolean

Checks whether this library has a LogicFunction with provided signature

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open fun hasPrimitive(signature: Signature): Boolean

Checks whether this library has a Primitive with provided signature

Link copied to clipboard
open fun hasProtected(signature: Signature): Boolean

Checks whether the provided signature, is protected in this library

Link copied to clipboard
open override fun hasRule(signature: Signature): Boolean

Checks whether this library has a Rule with provided signature

Link copied to clipboard
operator fun Library.plus(other: Library): Runtime

Combines this Library and other into a two-library Runtime, via Runtime.of. Note that, unlike Runtime.plus, this does not reject a clashing Library.alias: if both share the same alias, other silently wins.

Link copied to clipboard

Converts the current library into a Runtime containing a single library

Link copied to clipboard
open override fun toString(): String