foundations of computational agents
The rest of this chapter considers some restricted languages and reasoning tasks that are useful and can be efficiently implemented.
The language of propositional definite clauses is a sublanguage of propositional calculus that does not allow uncertainty or ambiguity. In this language, propositions have the same meaning as in propositional calculus, but not all compound propositions are allowed in a knowledge base.
The syntax of propositional definite clauses is defined as follows:
An atomic proposition or atom is the same as in propositional calculus.
A definite clause is of the form
where is an atom, the head of the clause, and each is an atom. It can be read “ if and …and ”.
If , the clause is called a rule, where is the body of the clause.
If the arrow can be omitted and the clause is called an atomic clause or fact. The clause has an empty body.
A knowledge base is a set of definite clauses.
The elements of the knowledge base in Example 5.2 are all definite clauses.
The following are not definite clauses:
The fourth statement is not a definite clause because an atom must start with a lower-case letter.
A definite clause is false in interpretation if are all true in and is false in ; otherwise the definite clause is true in .
Note that a definite clause is a restricted form of a clause. For example, the definite clause
is equivalent to the clause
In general, a definite clause is equivalent to a clause with exactly one positive literal (non-negated atom). Propositional definite clauses cannot represent disjunctions of atoms (e.g., ) or disjunctions of negated atoms (e.g., ).
Consider how to axiomatize the electrical environment of Figure 5.2 following the methodology for the user’s view of semantics. This axiomatization will allow us to simulate the electrical system. It will be expanded in later sections to let us diagnose faults based on observed symptoms.
The representation will be used to determine whether lights are on or off, based on switch positions and the status of circuit breakers. The agent is not concerned here with the color of the wires, the design of the switches, the length or weight of the wire, the date of manufacture of the lights and the wires, or any of the other myriad details one could imagine about the domain.
We must choose a level of abstraction. The aim is to represent the domain at the most general level that will enable the agent to solve the problems it must solve. We also want to represent the domain at a level that the agent will have information about. For example, we could represent the actual voltages and currents, but exactly the same reasoning would be done if this were a 12-volt DC system or a 120-volt AC system; the voltages and frequencies are irrelevant for questions about how switches affect whether lights are on. Instead, we represent this domain at a commonsense level that non-electricians may use to describe the domain, in terms of wires being live and currents flowing from the outside through wires to the lights, and that circuit breakers and light switches connect wires if they are turned on and working.
We have to choose what to represent. Suppose we want to represent propositions about whether lights are lit, whether wires are live, whether switches are up or down, and whether components are broken.
We then choose atoms with a specific meaning in the world. We can use descriptive names for these, such as to represent whether switch is up and to represent whether light is live (i.e., has power coming into it). The computer does not know the meaning of these names and does not have access to the components of the atom’s name.
At this stage, we have not told the computer anything. It does not know what the atoms are, let alone what they mean.
Once we have decided which symbols to use and what they mean, we tell the system, using definite clauses, background knowledge about what is true in the world. The simplest forms of definite clauses are those without bodies – the atomic clauses – such as
The designer may look at part of the domain and know that light is live if wire is live, because they are connected together, but may not know whether is live. Such knowledge is expressible in terms of rules:
At run time, the user is able to input the observations of the current switch positions, such as
The knowledge base consists of all of the definite clauses, whether specified as background knowledge or as observations.