LogicError

abstract class LogicError: ResolutionException

Base class for errors which may occur during resolution, possibly because of Primitives execution

Fields

Name Description
val errorStruct: Struct

The error Struct as described in Prolog standard: error(error_type, error_extra)

open type: Struct

The error type structure

open extraData: Term?

The possible extra data to be carried with the error

Constructors

<init>

constructor(message: String?, cause: Throwable?, context: ExecutionContext, type: Struct, extraData: Term?)

Parameters

Name Description
message: String?
cause: Throwable?
context: ExecutionContext
type: Struct
extraData: Term?

<init>

constructor(cause: Throwable?, context: ExecutionContext, type: Struct, extraData: Term?)

Parameters

Name Description
cause: Throwable?
context: ExecutionContext
type: Struct
extraData: Term?

<init>

constructor(message: String?, cause: Throwable?, contexts: Array<ExecutionContext>, type: Struct, extraData: Term?)

Base class for errors which may occur during resolution, possibly because of Primitives execution

Parameters

Name Description
message: String?

the detail message string.

cause: Throwable?

the cause of this exception.

contexts: Array<ExecutionContext>

a stack of contexts localising the exception

type: Struct

The error type structure

extraData: Term?

The possible extra data to be carried with the error

Methods

updateContext

abstract fun updateContext(newContext: ExecutionContext, index: Int): LogicError

Creates a new exception instance with the context with in position index updated to newContext. Subclasses should override this method and return the correct instance.

Parameters

Name Description
newContext: ExecutionContext
index: Int

ReturnValue

Name Description
LogicError

updateLastContext

abstract fun updateLastContext(newContext: ExecutionContext): LogicError

Parameters

Name Description
newContext: ExecutionContext

ReturnValue

Name Description
LogicError

pushContext

abstract fun pushContext(newContext: ExecutionContext): LogicError

Parameters

Name Description
newContext: ExecutionContext

ReturnValue

Name Description
LogicError

toString

open fun toString(): String

ReturnValue

Name Description
String

CompanionObject

LogicError

abstract class LogicError: ResolutionException

Base class for errors which may occur during resolution, possibly because of Primitives execution

Methods

of

fun of(message: String?, cause: Throwable?, context: ExecutionContext, type: Struct, extraData: Term?): LogicError

Factory method for LogicErrors

It creates correct subclass instance if type detected, otherwise defaulting to a LogicError instance

Parameters

Name Description
message: String?
cause: Throwable?
context: ExecutionContext
type: Struct
extraData: Term?

ReturnValue

Name Description
LogicError

of

fun of(message: String?, cause: Throwable?, contexts: Array<ExecutionContext>, type: Struct, extraData: Term?): LogicError

Parameters

Name Description
message: String?
cause: Throwable?
contexts: Array<ExecutionContext>
type: Struct
extraData: Term?

ReturnValue

Name Description
LogicError