PrimitiveWrapper

abstract class PrimitiveWrapper<C : ExecutionContext> : AbstractWrapper<Primitive>

Wrapper class for Primitive implementation

Fields

Name Description
val wrappedImplementation: Primitive

Checked primitive implementation

Constructors

<init>

constructor(signature: Signature)

Parameters

Name Description
signature: Signature

<init>

constructor(name: String, arity: Int, vararg: Boolean)

Parameters

Name Description
name: String
arity: Int
vararg: Boolean

Methods

uncheckedImplementation

protected abstract fun uncheckedImplementation(request: Request<C>): Sequence<Response>

The function expressing the implementation of the primitive, without any check for application to correct signature

Parameters

Name Description
request: Request<C>

ReturnValue

Name Description
Sequence<Response>

CompanionObject

PrimitiveWrapper

abstract class PrimitiveWrapper<C : ExecutionContext> : AbstractWrapper<Primitive>

Wrapper class for Primitive implementation

Methods

wrap

fun <C : ExecutionContext> wrap(signature: Signature, primitive: Primitive): PrimitiveWrapper<C>

Utility factory to build a PrimitiveWrapper out of a Signature and a Primitive function

Parameters

Name Description
signature: Signature
primitive: Primitive

ReturnValue

Name Description
PrimitiveWrapper<C>

wrap

fun <C : ExecutionContext> wrap(name: String, arity: Int, vararg: Boolean, primitive: Primitive): PrimitiveWrapper<C>

Utility factory to build a PrimitiveWrapper out of a Primitive function

Parameters

Name Description
name: String
arity: Int
vararg: Boolean
primitive: Primitive

ReturnValue

Name Description
PrimitiveWrapper<C>

wrap

fun <C : ExecutionContext> wrap(name: String, arity: Int, primitive: Primitive): PrimitiveWrapper<C>

Utility factory to build a PrimitiveWrapper out of a Primitive function

Parameters

Name Description
name: String
arity: Int
primitive: Primitive

ReturnValue

Name Description
PrimitiveWrapper<C>

ensuringAllArgumentsAreInstantiated

fun <C : ExecutionContext> Request<C>.ensuringAllArgumentsAreInstantiated(): Request<C>

Utility function to ensure that all arguments of Solve.Request are instantiated and not (still) Variables

Receiver

Name Description
Request<C>

ReturnValue

Name Description
Request<C>

ensuringArgumentIsInstantiated

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsInstantiated(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>

ensuringArgumentIsNumeric

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsNumeric(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>

ensuringArgumentIsStruct

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsStruct(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>

ensuringArgumentIsAtom

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsAtom(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>

ensuringArgumentIsSpecifier

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsSpecifier(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>

ensuringArgumentIsInteger

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsInteger(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>

ensuringArgumentIsNonNegativeInteger

fun <C : ExecutionContext> Request<C>.ensuringArgumentIsNonNegativeInteger(index: Int): Request<C>

Receiver

Name Description
Request<C>

Parameters

Name Description
index: Int

ReturnValue

Name Description
Request<C>