Bind¶
Tala 31.0.1 XML element: a plan item declaring a question that can be answered or accommodated from user input, but which the plan does not ask the user to answer. It is commonly used for optional parameters.
Syntax¶
type and predicate describe the question using the same question model as findout. The default type is wh_question. A bind can contain the same question children supported by the shared question XML structure, including alt and embedded_question where appropriate.
bind can appear in a goal plan, postplan, or an if branch. Its question content can be supplied by type/predicate attributes or by the question children described in Findout: proposition, perform, resolve, alt, or embedded_question.
| Attribute | Type | Default | Meaning |
|---|---|---|---|
allow_binding_yn_answers | Boolean | false | Allows relevant yes/no answers to bind to a yes/no question in the active plan. |
The compiler rejects allow_binding_yn_answers="true" unless the bind question is yes/no. DDD JSON has the same Boolean option; compilation rejects the flag on a non-yes/no question there as well.
Behavior and placement¶
A bind does not produce a question prompt. It lets TDM consider a relevant user answer for the bound question while the bind remains in the active plan. When the DME executes the bind plan item, it removes it from the plan. Place a bind after plan items that need it—usually at the end of the plan—or it can be removed before later steps can consume an answer.
The DME considers compatible user propositions for questions still present in the plan. Yes/no answers are excluded unless a matching yes/no bind explicitly sets allow_binding_yn_answers="true".
Examples¶
Optional WH parameter:
<plan>
<findout type="wh_question" predicate="destination"/>
<bind type="wh_question" predicate="price_class"/>
</plan>
Yes/no bind:
DDD JSON:
See domain XML and DDD JSON.
Tala reference and tests¶
- XML compiler validation:
tala/ddd/ddd_xml_compiler.py - Model and JSON form:
tala/model/plan_item.py,tala/ddd/json_parser.py - Tala tests:
tala/ddd/test/test_ddd_xml_compiler.pyandtala/ddd/test/test_ddd_json_compiler.py