foundations of computational agents
A proposition is a sentence, written in a language, that has a truth value (i.e., it is true or false) in a world. A proposition is built from atomic propositions and logical connectives.
An atomic proposition, or just an atom, is a symbol. Atoms are written as sequences of letters, digits, and the underscore (_) and start with a lower-case letter. For example, , , , , , and are all atoms.
Propositions can be built from simpler propositions using logical connectives. A proposition or logical formula is either
an atomic proposition or
a compound proposition of the form
“not ” | negation of | |
---|---|---|
“ and ” | conjunction of and | |
“ or ” | disjunction of and | |
“ implies ” | implication of from | |
“ if ” | implication of from | |
“ if and only if ” | equivalence of and | |
“ XOR ” | exclusive-or of and |
where and are propositions.
The operators , , , , , , and are logical connectives.
Parentheses can be used to make logical formulas unambiguous. When parentheses are omitted, the precedence of the operators is in the order they are given above. Thus, a compound proposition can be disambiguated by adding parentheses to the subexpressions in the order the operations are defined above. For example, is an abbreviation for
Semantics defines the meaning of the sentences of a language. The semantics of propositional calculus is defined below. Intuitively, propositions have meaning to someone who specifies propositions they claim are true, and then queries about what else must also be true. An interpretation is a way that the world could be. All that the system knows about the world is that the propositions specified are true, so the world must correspond to an interpretation in which those propositions hold.
An interpretation consists of a function that maps atoms to , . If , atom is true in the interpretation. If , atom is false in the interpretation. Sometimes it is useful to think of as the set of the atoms that map to , and the rest of the atoms map to .
Whether a compound proposition is true in an interpretation is inferred using the truth table of Figure 5.1 from the truth values of the components of the proposition.
Truth values are only defined with respect to interpretations; propositions may have different truth values in different interpretations.
Suppose there are three atoms: , , and .
Suppose interpretation assigns to , to , and to . That is, is defined by the function :
Then
is true in
is false in
is false in
is true in
is true in
is true in
is false in
is true in .
Suppose interpretation assigns to , to , and to :
is false in
is true in
is true in
is false in
is true in
is false in
is true in
is true in .
A knowledge base is a set of propositions that are stated to be true. An element of the knowledge base is an axiom. The elements of a knowledge base are implicitly conjoined, so that a knowledge base is true when all of the axioms in it are true.
A model of knowledge base is an interpretation in which all the propositions in are true.
If is a knowledge base and is a proposition, is a logical consequence of , or logically follows from , or entails , written
if is true in every model of . Thus, is not a logical consequence of , written , when there is a model of in which is false.
Suppose is the following knowledge base:
Given this knowledge base:
does not entail as there is a model of the knowledge base where is false. The atom must be false in that interpretation.
The description of semantics does not tell us why semantics is interesting or how it can be used as a basis to build intelligent systems. The basic idea behind the use of logic is that, when a knowledge base designer has a particular world to characterize, the designer can choose that world as an intended interpretation, choose meanings for the symbols with respect to that world, and write propositions about what is true in that world. When the system computes a logical consequence of a knowledge base, the designer can interpret this answer with respect to the intended interpretation.
The methodology used by a knowledge base designer to represent a world can be expressed as follows:
A knowledge base designer chooses a task domain or world to represent, which is the intended interpretation. This could be some aspect of the real world (for example, the structure of courses and students at a university, or a laboratory environment at a particular point in time), some imaginary world (such as the world of Alice in Wonderland, or the state of the electrical environment if a switch breaks), or an abstract world (for example, the world of numbers and sets).
The knowledge base designer selects atoms to represent propositions of interest. Each atom has a precise meaning to the designer with respect to the intended interpretation. This meaning of the symbols forms an intended interpretation or conceptualization.
The knowledge base designer tells the system propositions that are true in the intended interpretation. This is often called axiomatizing the domain, where the given propositions are the axioms of the domain.
A user can now ask questions about the intended interpretation. The system can answer these questions. A user who knows the intended interpretation is able to interpret the answers using the meaning assigned to the symbols.
Within this methodology, the designer does not actually tell the computer anything until step 3.
A computer does not have access to the intended interpretation. All the computer knows about the intended interpretation is the knowledge base . If , then must be true in the intended interpretation, because it is true in all models of the knowledge base. If , meaning is not a logical consequence of , there is a model of in which is false. As far as the computer is concerned, the intended interpretation may be the model of in which is false, and so it does not know whether is true in the intended interpretation.
Given a knowledge base, the models of the knowledge base correspond to all of the ways that the world could be, given that the knowledge base is true.
Consider the knowledge base of Example 5.2. The user could interpret these symbols as having some meaning. The computer does not know the meaning of the symbols, but it can still draw conclusions based on what it has been told. It can conclude that is true in the intended interpretation. It cannot conclude because it does not know if is true or false in the intended interpretation.
If the knowledge base designer tells lies – some axioms are false in the intended interpretation – the computer’s answers are not guaranteed to be true in the intended interpretation.