eta.core.execution

The core process responsible for executing primitive actions and matching expected events.

Functions

execute_forget_from_STM

Execute a store-in-STM step.

execute_say_bye

Execute a say-bye step.

execute_say_to

Execute a say-to step.

execute_store_in_STM

Execute a store-in-STM step.

execution_loop

Either execute the current intended step of the plan or attempt to match an expectation.

fail_curr_step

Characterize the current step as a failure using a special 'no-op' predicate.

forget_from_stm_step

get_action

inquire_truth_of_curr_step

Attempt to match an expected event to a fact in context.

me_pred

process_condition_step

Process a condition step by advancing only if none of the condition are true.

process_expected_step

Process an expected step by failing it if the waiting period has elapsed, or matching it to a fact in context.

process_intended_step

Process an intended step by attempting to map it to a primitive action to execute.

process_repetition_step

Process a repetition step by advancing only if the condition is satisfied.

say_bye_step

say_to_step

store_in_stm_step

you_pred

execution_loop(ds)[source]

Either execute the current intended step of the plan or attempt to match an expectation.

This will do one of several things depending on the class of the currently pending step:

  1. If a condition or repetition step, advance the plan once none of the conditions are true.

  2. If an expected step, attempt to match the step to a fact in context, until a time period based on the certainty of that step has elapsed, in which case the step is characterized as a failure and the plan is advanced.

  3. If an intended step that contains a primitive action, attempt to execute that action, and advance the plan if successful.

In any the case where an execution or match is successful, the plan is advanced, and a list of variable bindings obtained from the execution or match is applied throughout the dialogue state. Additionally, if the plan was advanced, the contents of the ‘plans’ buffer is replaced with the modified plan.

Note that, if the plan wasn’t advanced but the step is a condition or repetition step, the plan is still added to the ‘plans’ buffer, but only if currently empty. This is because the condition may change with any observation, so the planning loop must constantly check for possible expansions of that step.

Parameters:

ds (DialogueState) –

process_condition_step(event, ds)[source]

Process a condition step by advancing only if none of the condition are true.

Parameters:
Returns:

Whether to advance the plan.

Return type:

bool

process_repetition_step(event, ds)[source]

Process a repetition step by advancing only if the condition is satisfied.

Parameters:
Returns:

Whether to advance the plan.

Return type:

bool

process_expected_step(event, ds)[source]

Process an expected step by failing it if the waiting period has elapsed, or matching it to a fact in context.

Since an expected user step indicates the user’s dialogue turn, we also write the current output buffer at this point.

The dialogue context is flushed of “telic” predicates, i.e., those assumed to be essentially instantaneous, after a successful match (we assume that such predicates may only be used once in a match before becoming outdated).

Parameters:
Returns:

Whether to advance the plan.

Return type:

bool

inquire_truth_of_curr_step(event, ds)[source]

Attempt to match an expected event to a fact in context.

If a match is successful, this will bind all variables unified in the match throughout the dialogue state.

Parameters:
Returns:

Whether the match was successful.

Return type:

bool

fail_curr_step(event, ds)[source]

Characterize the current step as a failure using a special ‘no-op’ predicate.

Parameters:
Returns:

Whether to advance the plan.

Return type:

bool

process_intended_step(event, ds)[source]

Process an intended step by attempting to map it to a primitive action to execute.

If an action was successfully executed, the action returns variable bindings that are then applied throughout the dialogue state.

Parameters:
Returns:

Whether to advance the plan.

Return type:

bool

execute_say_to(step, ds)[source]

Execute a say-to step.

This will create a response and affect using the corresponding transducers, as well as potentially deriving a gist clause and semantic interpretation from the response. Any obligations are retrieved from the step as well. The resulting dialogue turn is added to the conversation log and pushed onto the output buffer.

Parameters:
Returns:

Dict of variable bindings obtained in the course of execution.

Return type:

dict

execute_say_bye(step, ds)[source]

Execute a say-bye step.

This will signal that the conversation should be ended immediately, setting the quit_conversation flag to True in the dialogue state and writing the remaining output buffer.

Parameters:
Returns:

Dict of variable bindings obtained in the course of execution.

Return type:

dict

execute_store_in_STM(step, ds)[source]

Execute a store-in-STM step.

This will store a given fact in short-term memory (i.e., context).

Parameters:
Returns:

Dict of variable bindings obtained in the course of execution.

Return type:

dict

execute_forget_from_STM(step, ds)[source]

Execute a store-in-STM step.

This will remove a given fact in short-term memory (i.e., context).

Parameters:
Returns:

Dict of variable bindings obtained in the course of execution.

Return type:

dict