foundations of computational agents
Queries are used to ask whether some statement is a logical consequence of a knowledge base. With propositional queries, a user can ask yes-or-no queries. Queries with variables allow the users to ask for the individuals that make the query true.
An instance of a query is obtained by substituting terms for the variables in the query. Each occurrence of a variable in a query must be replaced by the same term. Given a query with free variables, an answer is either an instance of the query that is a logical consequence of the knowledge base, or “”, meaning that no instances of the query logically follow from the knowledge base. Instances of the query are specified by providing values for the variables in the query. Determining which instances of a query follow from a knowledge base is known as answer extraction.
An answer of “no” does not mean that the query is false in the intended interpretation; it simply means that there is no instance of the query that is a logical consequence.
% is true if room is immediately west of room .
% is true if room is immediately east of room .
% is true if room is next door to room .
% is true if room is two doors east of room .
% is true if room is west of room .
Consider the clauses of Figure 13.2. The person who wrote these clauses presumably has some meaning associated with the symbols, and has written the clauses because they are true in some, perhaps imaginary, world. The computer knows nothing about rooms or directions. All it knows are the clauses it is given; and it can compute their logical consequences.
The user can ask the following query:
and the answer is yes. The user can ask the query
and the answer is, again, yes. The user can ask the query
and the answer is no. This means it is not a logical consequence, not that it is false. There is not enough information in the database to determine whether or not is immediately west of .
has two answers. One answer, with , means is a logical consequence of the clauses. The other answer is for . The query
has two answers: one for and one for . The query
has three answers: one for , one for , and one for . The query
has 16 answers, including