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, PrologFunction>

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

unaliased

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

Creates an instance of Library with given parameters

Parameters

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

ReturnValue

Name Description
Library

aliased

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

Creates an instance of AliasedLibrary with given parameters

Parameters

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

ReturnValue

Name Description
AliasedLibrary

of

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

Creates an instance of AliasedLibrary starting from Library and an alias

Parameters

Name Description
library: Library
alias: String

ReturnValue

Name Description
AliasedLibrary