ClassicExecutionContext

data class ClassicExecutionContext: ExecutionContext, Any

Fields

Name Description
val isRoot: Boolean
val hasOpenAlternatives: Boolean
val isActivationRecord: Boolean
val pathToRoot: Sequence<ClassicExecutionContext>
val currentGoal: Term?
val interestingVariables: Set<Var>
val prologStackTrace: List<Struct>

The Prolog call stacktrace till this ExecutionContext

val procedure: Struct?

The current procedure being executed

val libraries: Libraries

Loaded libraries

val flags: PrologFlags

Enabled flags

val staticKb: Theory

Static Knowledge-base, that is a KB that can't change executing goals

val dynamicKb: Theory

Dynamic Knowledge-base, that is a KB that can change executing goals

val operators: OperatorSet

Loaded operators

val inputChannels: Map<String, InputChannel<*>>

The currently open input channels

val outputChannels: Map<String, OutputChannel<*>>

The currently open output channels

val substitution: Unifier

The set of current substitution till this context

val query: Struct
val goals: Cursor<Term>
val rules: Cursor<Rule>
val primitives: Cursor<Response>
val startTime: TimeInstant
val maxDuration: TimeDuration
val choicePoints: ChoicePointContext?
val parent: ClassicExecutionContext?
val depth: Int
val step: Long

Constructors

<init>

constructor(procedure: Struct?, libraries: Libraries, flags: PrologFlags, staticKb: Theory, dynamicKb: Theory, operators: OperatorSet, inputChannels: Map<String, InputChannel<*>>, outputChannels: Map<String, OutputChannel<*>>, substitution: Unifier, query: Struct, goals: Cursor<Term>, rules: Cursor<Rule>, primitives: Cursor<Response>, startTime: TimeInstant, maxDuration: TimeDuration, choicePoints: ChoicePointContext?, parent: ClassicExecutionContext?, depth: Int, step: Long)

Parameters

Name Description
procedure: Struct?
libraries: Libraries
flags: PrologFlags
staticKb: Theory
dynamicKb: Theory
operators: OperatorSet
inputChannels: Map<String, InputChannel<*>>
outputChannels: Map<String, OutputChannel<*>>
substitution: Unifier
query: Struct
goals: Cursor<Term>
rules: Cursor<Rule>
primitives: Cursor<Response>
startTime: TimeInstant
maxDuration: TimeDuration
choicePoints: ChoicePointContext?
parent: ClassicExecutionContext?
depth: Int
step: Long

Methods

createSolver

fun createSolver(libraries: Libraries, flags: PrologFlags, staticKb: Theory, dynamicKb: Theory, stdIn: InputChannel<String>, stdOut: OutputChannel<String>, stdErr: OutputChannel<String>, warnings: OutputChannel<PrologWarning>): Solver

Parameters

Name Description
libraries: Libraries
flags: PrologFlags
staticKb: Theory
dynamicKb: Theory
stdIn: InputChannel<String>
stdOut: OutputChannel<String>
stdErr: OutputChannel<String>
warnings: OutputChannel<PrologWarning>

ReturnValue

Name Description
Solver

update

fun update(libraries: Libraries, flags: PrologFlags, staticKb: Theory, dynamicKb: Theory, operators: OperatorSet, inputChannels: PrologInputChannels<*>, outputChannels: PrologOutputChannels<*>): ClassicExecutionContext

Parameters

Name Description
libraries: Libraries
flags: PrologFlags
staticKb: Theory
dynamicKb: Theory
operators: OperatorSet
inputChannels: PrologInputChannels<*>
outputChannels: PrologOutputChannels<*>

ReturnValue

Name Description
ClassicExecutionContext

apply

fun apply(sideEffect: SideEffect): ClassicExecutionContext

Parameters

Name Description
sideEffect: SideEffect

ReturnValue

Name Description
ClassicExecutionContext

apply

fun apply(sideEffects: Iterable<SideEffect>): ClassicExecutionContext

Parameters

Name Description
sideEffects: Iterable<SideEffect>

ReturnValue

Name Description
ClassicExecutionContext

apply

fun apply(sideEffects: Sequence<SideEffect>): ClassicExecutionContext

Parameters

Name Description
sideEffects: Sequence<SideEffect>

ReturnValue

Name Description
ClassicExecutionContext

toString

fun toString(): String

ReturnValue

Name Description
String

Extensions

createTempChild

fun ClassicExecutionContext.createTempChild(inferProcedureFromGoals: Boolean): ClassicExecutionContext

Receiver

Name Description
ClassicExecutionContext

Parameters

Name Description
inferProcedureFromGoals: Boolean

ReturnValue

Name Description
ClassicExecutionContext

appendRulesAndChoicePoints

fun ClassicExecutionContext.appendRulesAndChoicePoints(rules: Cursor<Rule>): ClassicExecutionContext

Receiver

Name Description
ClassicExecutionContext

Parameters

Name Description
rules: Cursor<Rule>

ReturnValue

Name Description
ClassicExecutionContext

appendPrimitivesAndChoicePoints

fun ClassicExecutionContext.appendPrimitivesAndChoicePoints(primitiveExecutions: Cursor<Response>): ClassicExecutionContext

Receiver

Name Description
ClassicExecutionContext

Parameters

Name Description
primitiveExecutions: Cursor<Response>

ReturnValue

Name Description
ClassicExecutionContext

createChildAppendingRulesAndChoicePoints

fun ClassicExecutionContext.createChildAppendingRulesAndChoicePoints(rules: Cursor<Rule>, inferProcedureFromGoals: Boolean): ClassicExecutionContext

Receiver

Name Description
ClassicExecutionContext

Parameters

Name Description
rules: Cursor<Rule>
inferProcedureFromGoals: Boolean

ReturnValue

Name Description
ClassicExecutionContext

createChildAppendingPrimitivesAndChoicePoints

fun ClassicExecutionContext.createChildAppendingPrimitivesAndChoicePoints(primitiveExecutions: Cursor<Response>, inferProcedureFromGoals: Boolean): ClassicExecutionContext

Receiver

Name Description
ClassicExecutionContext

Parameters

Name Description
primitiveExecutions: Cursor<Response>
inferProcedureFromGoals: Boolean

ReturnValue

Name Description
ClassicExecutionContext

toRequest

fun ClassicExecutionContext.toRequest(signature: Signature, arguments: List<Term>): Request<ClassicExecutionContext>

Receiver

Name Description
ClassicExecutionContext

Parameters

Name Description
signature: Signature
arguments: List<Term>

ReturnValue

Name Description
Request<ClassicExecutionContext>