World Description with First-Order Logic

6.1 World Description with First-Order Logic

In order to reason using theorem proving, we should describe an aspect of the world which is interesting to us with the help of First-Order Logic. For such a description the following elements, called terms, are used.

• Individual constant symbols , which correspond to objects such as human beings, animals, buildings, etc. Examples of individual constants include: John III Sobieski (King of Poland), W awel Castle in Cracow, Norcia (an individual constant cor- responding to an individual object, which is a dog of the Yorkshire Terrier breed and belongs to my daughter).

• Individual variable symbols , which range over individual objects, usually denoted by x, y, z, etc. • Function symbols , which ascribe objects to other objects, e.g., square-root(), length(), father().

Additionally, predicate symbols are added to the FOL language. We can treat them as functions defined over terms which give one of two values: True or False. Examples of predicates include is_less_than(), is_high(), is_brother_of (). For example, the value of the predicate is_less_than(4, 9), i.e., in standard arithmetic notation 4 < 9, is True and the value of the predicate is_less_than(3, 1), i.e., in standard arithmetic notation 3 < 1, is False. A predicate with fixed arguments is called an atomic formula.

Finally, we add logical symbols ¬ (it is not true that …), ∧ (… and …), ∨ (… or …), ⇒ (if …, then …), ⇔ (… is equivalent to …), and quantifiers ∀ (for each …), ∃ (there exists …such that). With the help of these symbols we can define formulas. For example, a formula which states that for every individual object x the following holds: “If x barks, then x is a dog.” can be defined as follows: ∀x [barks(x) ⇒ is_dog(x)].

A formula which states that there exist black cats, strictly speaking that there exists such an individual object y that y is black and y is a cat, can be defined as follows: ∃ y [black(y) ∧ is _cat(y)].

6.1 World Description with First-Order Logic 69 Quantifiers bind variables in formulas. In the formulas defined above, a variable

x is bound by a quantifier ∀ and a variable y is bound by a quantifier ∃. Variables which are not bound by quantifiers in a formula are called free variables. Formulas which do not contain free variables are called sentences of FOL.

After introducing the syntax of FOL, we will define its semantics. The semantics allows us to refer formulas to the world, which contains individual objects repre- sented by individual constant symbols. A set of individual objects is called a universe. Relations which hold among elements of the universe are described with predicate symbols. Functions defined in the universe are represented using function symbols. An assignment of individual objects, functions, and relations to individual constant symbols, function symbols, and predicate symbols, respectively, is called an inter- pretation . In other words, an interpretation is an assignment of meaning to elements of the FOL language. Let us explain these notions with the following example.

S ={ a, d} , a set of

2 ={ p L , p R } . Let us assume that they are all elements used for defining atomic formulas. Let us

determine a universe U as shown in Fig. 6.1 a. As we can see, the universe consists of a certain car and a certain tree. Then, let us define an interpretation I as follows:

I (c) = car, I(t) = tree, I(p L )= left_of, I(p R )= right_of (cf. Fig. 6.1 b) and the following holds: tree is right_of car and car is left_of tree (cf. Fig. 6.1 c). We can describe it by ( tree, car) ∈ right_of and (car, tree) ∈ left_of. A pair (U , I) is called

a structure and we denote it by A.

Fig. 6.1 An example of FOL semantics: a the

(a)

universe, b the interpretation, c the structure

(b)

(c)

70 6 Logic-Based Reasoning Before we discuss the semantics of formulas, we have to define an interpretation

(value) of a term. For variables 4 we introduce, firstly, an assignment (valuation), which is denoted by ̺. It assigns an element of the universe to a variable. Let us assume e.g., that ̺(x) = car, ̺(y) = tree. After determining the assignment ̺, we are able to define an interpretation for a term t, which in our case is a variable, in

a structure A. This is defined as follows: | A ⌊ ⌈ t |⌋⌉ ̺ = ̺(t). Thus, for our variables the

A following holds: | A ⌊ ⌈ x |⌋⌉ ̺ = ̺(x) = car, and | ⌊ ⌈ y |⌋⌉ ̺ = ̺(y) = tree. Now, we can discuss the issue of relating FOL formulas to an aspect of the

world they describe. First of all, we would like to know whether a certain formula ϕ describes a “part” of the world in an adequate way. If yes, we say that the formula is satisfied in the structure A under the assignment ̺, which is denoted (A, ̺) |= ϕ.

Let us consider the satisfaction of a formula, continuing our example of the uni- verse which consists of the car and the tree. We will consider a simple atomic formula of the form: p L ( x, y) . Thus, we ask whether:

(A, ̺) |= p L ( x, y).

(6.1) According to the definition of satisfaction of a formula, 5 for a predicate symbol p

A A it is assumed that: (A, ̺) |= p(t A

1 ,..., t n ) if and only if ( | ⌊ ⌈ t 1 ⌉ |⌋ ̺ ,...,| ⌊ ⌈ t n |⌋ ⌉ ̺ )∈ p . Thus, we can write ( 6.1 ) as:

(6.2) After applying the definition of an interpretation of a variable with the help of an

(| ⌊ ⌈ x |⌋⌉ ̺ ,| ⌊ ⌈ y |⌋⌉ ̺ )∈ left_of.

assignment, expression ( 6.2 ) can be written in the form:

(6.3) Finally, after applying the assignment defined previously we obtain:

( ̺(x), ̺(y)) ∈ left_of.

(6.4) This is consistent with the definition of the structure A. Thus, the formula p L ( x, y)

( car, tree) ∈ left_of.

is satisfied in the structure A under the assignment ̺.

A hierarchy of characteristics of formulas from the semantic point of view is presented in Appendix C.1. A valid formula (tautology) is at the top of the hierarchy. Such a formula is satisfied in every structure under every assignment.

In AI systems we do not verify formulas in the way presented above for practical reasons. Systems used for the verification of unknown formulas infer on the basis of

4 We do not discuss here all definitions related to the FOL semantics. They are included in Appendix C.1.

5 See Definition C.12 in Appendix C.1.

6.1 World Description with First-Order Logic 71 formulas which are considered to be true. 6 These systems consist of at least the two

following components. • Axioms are formulas which are considered to be true. They constitute the basic

knowledge base in a reasoning system. • Rules of inference are patterns which are used to derive new formulas from

ϕ 1 , ϕ 2 ,..., ϕ n known formulas. A rule of inference is written in the form

, where ψ 1 , ψ 2 ,..., ψ k

ϕ 1 , ϕ 2 ,..., ϕ n are input formulas and ψ 1 , ψ 2 ,..., ψ k are the resulting formulas. The modus ponendo ponens rule is one of the fundamental rules of inference. It

is formulated as follows:

The rule says that if there are two formulas and the first formula is of the form of an implication and the second formula is an antecedent of this implication, then we can generate the formula which is the consequent of this implication.

The universal instantiation rule is also a very useful rule:

(∀ x ∈ X) ϕ(x)

ϕ(a), a ∈ X

where a is an individual constant symbol. Intuitively, the rule says that if something is true for each element of a class of individuals, then it is true for a particular element of this class.

In our further considerations we will also use the material implication rule: ϕ⇒ψ

The rule allows us to replace an implication with a disjunction. Now, we present a simple example of processing in a reasoning system. Let us assume that a knowledge base contains the axiom:

(6.8) Let us assume that we can add our new axiom to the knowledge base after making

∀ x[barks(x) ⇒ is _dog(x)].

some observation:

(6.9) (We have observed that an individual Norcia is barking.)

barks(Norcia).

6 Formal notions, which concern reasoning in logic are contained in Appendix F.2.

72 6 Logic-Based Reasoning Now, we can ask the question “Is Norcia a dog?” to the reasoning system:

is _dog(Norcia) (???).

(6.10) In other words, we would like to ask the system to “prove” theorem ( 6.10 ) on the

basis of its axioms and with the help of rules of inference. First of all, the system applies the universal instantiation rule ( 6.6 ) to the axiom ( 6.8 ):

∀ x[barks(x) ⇒ is _dog(x)]

barks(Norcia) ⇒ is _dog(Norcia)

which results in generating the formula:

barks(Norcia) ⇒ is _dog(Norcia).

(6.12) Then, the system applies the modus ponendo ponens rule ( 6.5 ) to formulas ( 6.12 )

and ( 6.9 ):

barks(Norcia) ⇒ is _dog(Norcia), barks(Norcia)

is _dog(Norcia)

which results in generating the formula:

is _dog(Norcia).

Thus, the system answers “Yes” to our question ( 6.10 ).

Dokumen yang terkait

Hubungan pH dan Viskositas Saliva terhadap Indeks DMF-T pada Siswa-siswi Sekolah Dasar Baletbaru I dan Baletbaru II Sukowono Jember (Relationship between Salivary pH and Viscosity to DMF-T Index of Pupils in Baletbaru I and Baletbaru II Elementary School)

0 46 5

Institutional Change and its Effect to Performance of Water Usage Assocition in Irrigation Water Managements

0 21 7

The Effectiveness of Computer-Assisted Language Learning in Teaching Past Tense to the Tenth Grade Students of SMAN 5 Tangerang Selatan

4 116 138

the Effectiveness of songs to increase students' vocabuloary at second grade students' of SMP Al Huda JAkarta

3 29 100

The effectiveness of classroom debate to improve students' speaking skilll (a quasi-experimental study at the elevent year student of SMAN 3 south Tangerang)

1 33 122

Kerjasama ASEAN-China melalui ASEAN-China cooperative response to dangerous drugs (ACCORD) dalam menanggulangi perdagangan di Segitiga Emas

2 36 164

The Effect of 95% Ethanol Extract of Javanese Long Pepper (Piper retrofractum Vahl.) to Total Cholesterol and Triglyceride Levels in Male Sprague Dawley Rats (Rattus novergicus) Administrated by High Fat Diet

2 21 50

Factors Related to Somatosensory Amplification of Patients with Epigas- tric Pain

0 0 15

The Concept and Value of the Teaching of Karma Yoga According to the Bhagavadgita Book

0 0 9

Pemanfaatan Permainan Tradisional sebagai Media Pembelajaran Anak Usia Dini untuk Mengembangkan Aspek Moral dan Bahasa Anak Utilization of Traditional Games as Media Learning Early Childhood to Develop Aspects of Moral and Language Children Irfan Haris

0 0 11