Findout¶
Tala 31.0.1 XML element: a question-raising plan item. A findout asks the user or invokes the configured question source to resolve its question. It differs from raise, which raises an issue without imposing the same findout plan behavior.
Syntax¶
| Attribute | Type | Default | Meaning |
|---|---|---|---|
type | question type | wh_question | One of goal, wh_question, kpq, alt_question, or yn_question. |
predicate | ontology predicate | — | Identifies a predicate-backed question when required by its type. |
allow_answer_from_pcom | Boolean | false | Allows compatible answers from the user's previous commitments to be considered. |
alts_predicate | ontology predicate | — | For a wh-question, supplies fact-backed alternatives from this predicate. |
findout can be used in a goal plan, postplan, or a conditional plan. Its question form depends on type:
| Type | Question content |
|---|---|
goal | Asks which goal/action is relevant; no predicate is needed. |
wh_question | Uses the named predicate, e.g. predicate="destination". |
yn_question | Uses a Boolean predicate or a proposition/goal child. |
alt_question | Contains one or more alt children, each naming an alternative proposition or goal. |
kpq | Contains an embedded_question describing the question whose answer is known. |
Parents and question children¶
findout may appear in a <plan>, <postplan>, or a <then>/<else> plan inside <if>. Its question content can be supplied by attributes or by child elements:
| Child | Use |
|---|---|
proposition | Predicate proposition, commonly the content of a yes/no question. |
perform | Perform-goal alternative, including a yes/no action question. |
resolve | Resolve-goal alternative. |
alt | Wraps an explicit alternative; repeat for each alternative. |
embedded_question | The embedded question of a KPQ. |
A KPQ embeds the question whose knowledge is being checked:
Behavior¶
The DME raises the question represented by the plan item. When the DDD has question parameters, the configured domain/service query and question parameters may determine the answers or wording. allow_answer_from_pcom allows a compatible answer in the user's previous commitments to be reused; TDM applies its confidence and grounding rules before integrating that answer.
For a wh-question with alts_predicate, TDM collects positive known facts for that predicate. A single fact can be posed as a yes/no question; multiple facts can be posed as an alternative question. Define the ontology predicate with multiple_instances="true" when the domain needs to retain several values for it. A configured max_spoken_alts can limit the alternatives that are presented.
XML compatibility caveat: Tala 31.0.1's XSD declares allow_answer_from_pcom as Boolean, but the XML compiler tests attribute presence rather than its value. Omit the attribute to disable reuse and use allow_answer_from_pcom="true" to enable it; do not write allow_answer_from_pcom="false" in XML. DDD JSON uses a Boolean and does not have this presence-only behavior.
Examples¶
WH and yes/no questions:
<findout type="wh_question" predicate="destination"/>
<findout type="yn_question" predicate="need_visa"/>
<findout type="goal"/>
Explicit alternatives, where each alternative is a question or goal proposition:
<findout type="alt_question">
<alt><resolve type="wh_question" predicate="monthly_payment"/></alt>
<alt><resolve type="wh_question" predicate="interest_rate"/></alt>
</findout>
An alternative may also be a perform goal:
KPQ in DDD JSON uses a nested question object:
Fact-backed alternatives and prior-commitment reuse:
<findout type="wh_question" predicate="animal"
alts_predicate="available_animal"
allow_answer_from_pcom="true"/>
DDD JSON equivalent for a basic wh-question:
See domain XML, DDD JSON, and Alternatives for additional alternative-question forms.
Tala reference and tests¶
- XML parsing/defaults:
tala/ddd/ddd_xml_compiler.py - JSON compilation:
tala/ddd/ddd_json_compiler.py - Plan item model:
tala/model/plan_item.py - Tala tests:
tala/ddd/test/test_ddd_xml_compiler.pyandtala/ddd/test/test_ddd_json_compiler.py