← 学习库 Speech and Language Processing 本册目录

17.4.2 The Semantics of First Order Logic

The various objects, properties, and relations represented in a FOPC knowledge base acquire their meanings by virtue of their correspondence to objects, properties, and relations out in the external world being modeled by the knowledge base. FOPC sentences can, therefore, be assigned a value of True or False based on whether the propositions they encode are in accord with the world or not.

Consider the following example:

(17.22) Ay Caramba is near ICSI.

Capturing the meaning of this example in FOPC involves identifying the Terms and Predicates that correspond to the various grammatical elements in the sentence, and creating logical formulas that capture the relations implied by the words and syntax of the sentence. For this example, such an effort might yield something like the following:

$$ Near(LocationOf(AyCaramba),LocationOf(ICSI)) $$

The meaning of this logical formula then arises from the relationship between the terms $ \text{LocationOf}(Ay\text{Caramba}) $, $ \text{LocationOf}(ICSI) $, the predicate $ \text{Near} $, and the objects and relation they correspond to in the world being modeled. Specifically, this sentence can be assigned a value of $ \text{True} $ or $ \text{False} $ based on whether or not the real Ay Caramba is actually close to ICSI or not. Of course, since our computers rarely have direct access to the outside world we have to rely on some other means to determine the truth of formulas like this one.

For our current purposes, we will adopt what is known as a database semantics for determining the truth of our logical formulas. Operationally, atomic formulas are taken to be true if they are literally present in the knowledge base or if they can be inferred from other formula that are in the knowledge base. The interpretations of formulas involving logical connectives is based on the meaning of the components in the formulas combined with the meanings of the connectives they contain. Fig. 17.4 gives interpretations for each of the logical operators shown in Figure 17.3.

原书第 632 页

| P | Q | $ \neg P $ | $ P \land Q $ | $ P \lor Q $ | $ P \Rightarrow Q $ |

| --- | --- | --- | --- | --- | --- |

| False | False | True | False | False | True |

| False | True | True | False | True | True |

| True | False | False | False | True | False |

| True | True | False | True | True | True |

Figure 17.4 Truth table giving the semantics of the various logical connectives.

The semantics of the $ \land $ (and), and $ \neg $ (not) operators are fairly straightforward, and are correlated with at least some of the senses of their corresponding English terms. However, it is worth pointing out that the $ \lor $ (or) operator is not disjunctive in the same way that the corresponding English word is, and that the $ \Rightarrow $ (implies) operator is only loosely based on any commonsense notions of implication or causation. As we will see in more detail in Section 17.5, in most cases it is safest to rely directly on the entries in the truth table, rather than on intuitions arising from the names of the operators.

← 17.4.1 Elements of First Order Logic17.4.3 Variables and Quantifiers →