AbstractLibrary

Base Library implementation defaulting every contribution (operators, clauses, primitives, functions) to empty, and providing structural equals/hashCode/toString; subclasses only need to override Library.alias plus whichever contributions they actually provide.

Inheritors

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
abstract 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