Library

interface Library: Any

Represents a Prolog library

Fields

Name Description
abstract operators: OperatorSet

Library defined operators

abstract theory: Theory

The library theory clauses

abstract primitives: Map<Signature, Primitive>

The library primitives, identified by their signatures

abstract functions: Map<Signature, LogicFunction>

The library prolog functions, identified by their signature

Methods

contains

open operator fun contains(signature: Signature): Boolean

Checks whether this library contains the provided signature.

The default implementation, checks for signature presence among primitives and theory clauses by indicator-like search

Parameters

Name Description
signature: Signature

ReturnValue

Name Description
Boolean

contains

open operator fun contains(operator: Operator): Boolean

Checks whether this library contains the definition of provided operator

Parameters

Name Description
operator: Operator

ReturnValue

Name Description
Boolean

hasPrimitive

open fun hasPrimitive(signature: Signature): Boolean

Checks whether this library has a Primitive with provided signature

Parameters

Name Description
signature: Signature

ReturnValue

Name Description
Boolean

hasProtected

open fun hasProtected(signature: Signature): Boolean

Checks whether the provided signature, is protected in this library

Parameters

Name Description
signature: Signature

ReturnValue

Name Description
Boolean

Extensions

getAllOperators

fun Library.getAllOperators(): Sequence<Operator>

Receiver

Name Description
Library

ReturnValue

Name Description
Sequence<Operator>

CompanionObject

Library

interface Library: Any

Represents a Prolog library

Methods

toMapEnsuringNoDuplicates

fun <T> Sequence><Pair<Signature, T>>.toMapEnsuringNoDuplicates(): Map<Signature, T>

Receiver

Name Description
Sequence><Pair<Signature, T>>

ReturnValue

Name Description
Map<Signature, T>

toMapEnsuringNoDuplicates

fun <T> Iterable<Pair<Signature, T>>.toMapEnsuringNoDuplicates(): Map<Signature, T>

Receiver

Name Description
Iterable<Pair<Signature, T>>

ReturnValue

Name Description
Map<Signature, T>

unaliased

fun unaliased(primitives: Map<Signature, Primitive>, theory: Theory, operatorSet: OperatorSet, functions: Map<Signature, LogicFunction>): Library

Creates an instance of Library with given parameters

Parameters

Name Description
primitives: Map<Signature, Primitive>
theory: Theory
operatorSet: OperatorSet
functions: Map<Signature, LogicFunction>

ReturnValue

Name Description
Library

aliased

fun aliased(alias: String, primitives: Map<Signature, Primitive>, theory: Theory, operatorSet: OperatorSet, functions: Map<Signature, LogicFunction>): AliasedLibrary

Creates an instance of AliasedLibrary with given parameters

Parameters

Name Description
alias: String
primitives: Map<Signature, Primitive>
theory: Theory
operatorSet: OperatorSet
functions: Map<Signature, LogicFunction>

ReturnValue

Name Description
AliasedLibrary

of

fun of(alias: String, library: Library): AliasedLibrary

Creates an instance of AliasedLibrary starting from Library and an alias

Parameters

Name Description
alias: String
library: Library

ReturnValue

Name Description
AliasedLibrary