eta.plan.PlanStep
- class PlanStep(event=None)[source]
Bases:
object
A plan step containing an eventuality, related to other plan steps through a tree structure.
- Parameters:
event (Eventuality) – The eventuality corresponding to this step.
- event
The eventuality corresponding to this step.
- Type:
- supersteps
A list of more abstract plan steps which this step (partially) realizes.
- obligations
A list of dialogue obligations associated with this plan step.
- Type:
- schemas
A list of schemas that this expected/intended step arises from (if any).
Methods
Add bidirectional subplan/superplan links between this step and a given superstep.
Bind the given variable symbol to the given value throughout the entire plan step tree (and associated schemas).
Format a string representing this plan step as an S-expression.
Get any dialogue obligations associated with a particular step in the plan.
Format a string representing a serialized version of the subtree rooted at this step.
Unbind the given variable symbol throughout the entire plan step tree (and associated schemas).
- get_obligations()[source]
Get any dialogue obligations associated with a particular step in the plan.
Notes
TODO: this is currently a bit of a hack, in that it involves looking at the superstep as well if no obligations are found. This is because say-to.v actions may need to access the parent paraphrase-to.v actions in order to inherit relevant obligations of the latter. It may be possible to instead modify the plan expansion method so that obligations are inherited upon expansion.
- add_superstep(superstep)[source]
Add bidirectional subplan/superplan links between this step and a given superstep.
The schemas of the superstep also become the schemas associated with this step, but only in the case where this step doesn’t already have associated schemas (e.g., if it was created from an episode list in expanding an action).
- Parameters:
superstep (PlanStep) – The superstep to add to this step.
Notes
TODO: it’s not clear whether the above is the sensible behavior, or if instead we should always append the schemas of the superstep to this step.
- bind(var, val)[source]
Bind the given variable symbol to the given value throughout the entire plan step tree (and associated schemas).
- unbind(var)[source]
Unbind the given variable symbol throughout the entire plan step tree (and associated schemas).
- serialize(reverse=False, schemas=False)[source]
Format a string representing a serialized version of the subtree rooted at this step.
This is generated using a DFS, maintaining a record of recurring plan steps so that numerical references can be inserted in place of nodes that appear more than once in the tree.
- format(schemas=False)[source]
Format a string representing this plan step as an S-expression.
- Parameters:
schemas (bool, default=False) – Whether to also display schema predicates for each step.
- Returns:
The step formatted as one of the following S-expression string representations: -
((<ep-name> <wff>) <certainty>)
-((<ep-name> <wff>) <certainty>) (:schemas <schema-preds>)
- Return type: