Request

data class Request<out C : ExecutionContext>(val signature: Signature, val arguments: List<Term>, val context: C, val startTime: TimeInstant = currentTimeInstant(), val maxDuration: TimeDuration = context.endTime - startTime) : Solve, Durable

Class representing a Request to be full-filled by the Solver

Constructors

Link copied to clipboard
constructor(signature: Signature, arguments: List<Term>, context: C, startTime: TimeInstant = currentTimeInstant(), maxDuration: TimeDuration = context.endTime - startTime)

Properties

Link copied to clipboard

Arguments with which the goal is invoked in this Request

Link copied to clipboard
val context: C

The context that's current at Request making

Link copied to clipboard

How much time elapsed since startTime, computed against the current time instant.

Link copied to clipboard

The time instant by which this entity's execution should be over, computed as startTime (saturating to TimeInstant.MAX_VALUE on overflow).

Link copied to clipboard
open override val maxDuration: TimeDuration

The execution max duration after which the computation should end, because no more useful

Link copied to clipboard

The current query Struct of this request

Link copied to clipboard

How much time is left before endTime, computed against the current time instant.

Link copied to clipboard

Signature of the goal to be solved in this Request

Link copied to clipboard
open override val startTime: TimeInstant

The time instant when the request was submitted for resolution

Link copied to clipboard

Functions

Link copied to clipboard
open override fun Solve.Request<ExecutionContext>.ensureType(context: ExecutionContext, term: Term)

Template method expected to throw if term does not have the expected type, and return normally otherwise.

Link copied to clipboard

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun replyException(exception: ResolutionException, sideEffectManager: SideEffectManager? = null, buildSideEffects: SideEffectsBuilder.() -> Unit): Solve.Response
fun replyException(exception: ResolutionException, sideEffectManager: SideEffectManager? = null, vararg sideEffects: SideEffect): Solve.Response

Creates a new halt Response to this Request, with cause exception

Link copied to clipboard
fun replyFail(sideEffectManager: SideEffectManager? = null, buildSideEffects: SideEffectsBuilder.() -> Unit): Solve.Response
fun replyFail(sideEffectManager: SideEffectManager? = null, vararg sideEffects: SideEffect): Solve.Response

Creates a new failed Response to this Request

Link copied to clipboard
fun replySuccess(substitution: Substitution.Unifier = Substitution.empty(), sideEffectManager: SideEffectManager? = null, buildSideEffects: SideEffectsBuilder.() -> Unit): Solve.Response
fun replySuccess(substitution: Substitution.Unifier = Substitution.empty(), sideEffectManager: SideEffectManager? = null, vararg sideEffects: SideEffect): Solve.Response

Creates a new successful Response to this Request, with substitution

Link copied to clipboard
fun replyWith(substitution: Substitution, sideEffectManager: SideEffectManager? = null, buildSideEffects: SideEffectsBuilder.() -> Unit): Solve.Response
fun replyWith(substitution: Substitution, sideEffectManager: SideEffectManager? = null, vararg sideEffects: SideEffect): Solve.Response
fun replyWith(solution: Solution, sideEffectManager: SideEffectManager? = null, buildSideEffects: SideEffectsBuilder.() -> Unit): Solve.Response
fun replyWith(solution: Solution, sideEffectManager: SideEffectManager? = null, vararg sideEffects: SideEffect): Solve.Response

Creates a new Response to this Request

fun replyWith(condition: Boolean, sideEffectManager: SideEffectManager? = null, buildSideEffects: SideEffectsBuilder.() -> Unit): Solve.Response
fun replyWith(condition: Boolean, sideEffectManager: SideEffectManager? = null, vararg sideEffects: SideEffect): Solve.Response

Creates a new successful or failed Response depending on condition; to be used when the substitution doesn't change

Link copied to clipboard
fun solve(goal: Struct, maxDuration: TimeDuration = this.maxDuration): Sequence<Solution>
Link copied to clipboard
Link copied to clipboard