Downdate conditions¶
A downdate_condition is a child of a goal. When the goal's condition becomes true, TDM treats the goal as fulfilled and downdates it. Multiple conditions on one goal are alternatives: any one true condition is sufficient.
Syntax¶
<goal type="perform" action="book_room">
<plan>
<invoke_service_action name="BookRoom"/>
</plan>
<downdate_condition>
<in_beliefs_or_commitments>
<service_action_terminated name="BookRoom"/>
</in_beliefs_or_commitments>
</downdate_condition>
</goal>
The child of downdate_condition is a normal condition expression. It can be a predicate/value condition, an in_* proposition condition, a value test, or a Boolean composition. Each condition is evaluated against the active TIS.
Service actions: termination is not success¶
TDM records service_action_terminated whenever an invoked service action returns, including when its result is unsuccessful. With postconfirm, the termination proposition is stored in private beliefs; without it, it is stored in shared commitments. in_beliefs_or_commitments checks both locations. Therefore, this condition means “the service call ended,” not “the operation succeeded.”
The old invoke_service_action/@downdate_plan attribute does not create an implicit downdate condition in Tala/TDM 31.0.1. It is retained by the XML/JSON models for compatibility; author an explicit condition for current behavior.
Downdate and cleanup behavior¶
TDM also downdates a perform/resolve goal when the corresponding action or question status is committed. For explicit conditions, TDM evaluates each condition and clears the propositions named by in_* conditions from the corresponding TIS store when the goal is downdated. Boolean and/or conditions clean their satisfied branches. has_value checks predicate presence without identifying a specific proposition to remove, and not does not remove facts.
The XML schema retains <postcond> as a compatibility form. New DDDs should use <downdate_condition>.
Tala sources and examples¶
- Schema/compiler:
tala/ddd/schemas/domain.xsd,tala/ddd/ddd_xml_compiler.py - Goal-to-condition mapping:
tala/model/domain.py - Tala tests:
tala/ddd/test/test_ddd_xml_compiler.pyandtala/model/test/test_domain.py
See also Conditions.