eta.core.reasoning

The core process responsible for inferring new facts and possible actions to take from previous facts/observations.

Functions

infer_bottom_up

Infer new facts in a "bottom-up" manner, using relevant facts in memory.

infer_top_down

Infer new facts in a "top-down" manner, using the current expected/intended plan step as context.

reasoning_loop

Infer new facts and possible actions from previous facts/observations.

suggest_possible_actions

Suggest possible actions to take in reaction to a list of observations.

reasoning_loop(ds)[source]

Infer new facts and possible actions from previous facts/observations.

First, all recent inferences are popped from the inferences buffer, and from these inferences, the system attempts to infer new facts in both a top down and a bottom up manner.

A depth limit is imposed, such that only facts which are below some number of inference steps away from a direct observation are considered for further inference. Any inferred facts are added back to the inferences buffer, with a depth that is one greater than the minimum depth of the facts used to infer them.

In the top down approach, the current state of the dialogue plan is used as the context for making inferences from each fact.

In the bottom up approach, a set of relevant facts are retrieved from memory and used to make inferences from each fact.

Second, all direct observations are popped from the observations buffer, and used to suggest possible actions that the system can take in reaction to those observations.

Parameters:

ds (DialogueState) –

infer_top_down(facts, ds)[source]

Infer new facts in a “top-down” manner, using the current expected/intended plan step as context.

Parameters:
Returns:

A list of inferred facts.

Return type:

list[Eventuality]

infer_bottom_up(facts, ds)[source]

Infer new facts in a “bottom-up” manner, using relevant facts in memory.

Parameters:
Returns:

A list of inferred facts.

Return type:

list[Eventuality]

Notes

TODO: still need to implement retrieval of relevant facts from memory (and generic knowledge?).

suggest_possible_actions(observations, ds)[source]

Suggest possible actions to take in reaction to a list of observations.

Parameters:
Returns:

A list of possible actions (as natural language strings or LISP-formatted S-expression strings).

Return type:

list[str]

Notes

TODO: some possible future improvements:
  1. Reconsider previous failed plan steps as possible actions to retry.

  2. Consider the system’s desires, and/or obligations placed on the system, as well as observations, in considering possible actions.

  3. Allow urgency scores to be included in the transducer results, allowing for differential priority for different kinds of possible actions (e.g., even in a simple chit-chat domain, we may wish for answering a question to have a higher urgency than responding to a statement.)