Third edition of Artificial Intelligence: foundations of computational agents, Cambridge University Press, 2023 is now available (including the full text).

5.3.3.2 Why Did the System Ask a Question?

Another useful explanation is for why a question was asked. This is useful because

  • We want the system to appear intelligent. Knowing why a question was asked will increase a user's confidence that the system is working sensibly.
  • One of the main measures of complexity of an interactive system is the number of questions asked of a user; you want to keep this to a minimum. Knowing why a question was asked will help the knowledge designer reduce this complexity.
  • An irrelevant question is usually a symptom of a deeper problem.
  • The user may learn something from the system by knowing why the system is doing something. This learning is much like an apprentice asking a master why the master is doing something.

When the system asks the user a question (q), there must be a rule used by the system that contains q in the body. The user can ask

why.

This is read as "Why did you ask me that question?" The answer can be simply the rule that contains q in the body. If the user asks why again, the system should explain why the goal at the head of the rule was asked, and so forth. Repeatedly asking why will eventually give the path of goals to the top-level query. If all of these rules are reasonable, this justifies why the system's question to the user is reasonable.

Example 5.12: Consider the dialog of Example 5.10. The following shows how repeated use of why can repeatedly find higher-level goals. The following dialog is for the query ask lit_l1, with user asking the initial query, and responding with "why":
ailog: ask lit_l1.
Is up_s1 true? why.
up_s1 is used in the rule live_w1 ←live_w3 ∧up_s1: why.
live_w1 is used in the rule live_w0 ←live_w1 ∧up_s2: why.
live_w0 is used in the rule live_l1 ←live_w0: why.
live_l1 is used in the rule lit_l1 ←light_l1 ∧live_l1 ∧ok_l1: why.
Because that is what you asked me!

Typically, how and why are used together; how moves from higher-level to lower-level goals, and why moves from lower-level to higher-level goals. Together they let the user traverse a proof tree, where nodes are atoms, and a node together with its children corresponds to a clause in the knowledge base.

Example 5.13: As an example of the need to combine how and why, consider the previous example where the user asked why up_s1. The system gave the following rule:
live_w1 ←live_w3 ∧up_s1.

This means that up_s1 was asked because the system wants to know live_w1 and is using this rule to try to prove up_s1. The user may think it is reasonable that the system wants to know live_w1 but may think it is inappropriate that up_s1 be asked because the user may doubt that live_w3 should have succeeded. In this case it is useful for the user to ask how live_w3 was derived.