You are on page 1of 6

FIRST ORDER LOGIC

1- Models in FOL have objects; the domain of a model is the set of


objects that it contains.

2- Relation: set of couples that is organized in specific order. It is a


set of tuples of object that are related.

Tuple is a collection of objects that are arranged in a fixed order

Example: brotherhood = {<john, Richard>, <Richard, john>}

On head= {<crown, john>}

3- two types of relation

a- Binary relation: a tuple contains two objects.

b- Unary relation: contain one object.

Example: person (john),King (john), person (Richard)

Unary relation: sometime it named as property, some relations


are best considered as functions in this case a given object must
be related to exactly one object in the model

Example: instead of refer to left leg of Richard by:

Left-leg-of-Richard-namewe use leftleg (Richard)

4- Symbols: the basic elements of the syntax in FOL are the


symbols, these symbols stand for:

 Objects

 Relations

 Functions

There are three kinds of symbols:

a- Constant symbol: stand for objects (uppercase)

Example: John, Richard, etc... {Capital letter}

b- Predicate symbols: stand for relations (uppercase)


Function (true or false)

Example: Brother, on head, person, king… (Properties)

c- Function symbols: stand for functions (uppercase)

Example: Leftleg…

5- Terms: logical expressions that refer to objects

Example: constant symbols are terms, but it is not convenient to


give each object a specific name!!!

That’s why we use function symbol general format of a term: f


(term1, t2, t3….Tn) or f (g (t1, t2), h (t3, t4)…)

Example: body (car (Jeff)) complex term, term is a complex


name it is another way to name things!!

6- Syntax:

a- Terms: objects

b- Predicate symbols for relations.

7- Sentences:

a- Atomic sentences: state facts, formed by a predicate


symbols followed by a list of termsexpress objects.

Example: brother (Richard, john)

Father (William, Richard); this means

Father predicate symbols

( )list of terms.

This state under a given of interpretation that William is


the father of Richard.

One atomic sentence could be more complex

Example: married (father (Richard), mother (john))


This states that under a given interpretation that the
real father of Richard and mother of john are related
with the relation married.

An atomic sentence is true in a given model and with a


given interpretation if the relation expressed by the
predicate symbol exist among objects expressed by a
list of terms

b- Complex sentences: it is composed by atomic sentences


and connectives (logical: not, and, or, implies,
equivalence). These connectives has same semantic as
propositional logic

Example:

1-Not brother (left leg (john), Richard) true

2-brother (Richard, john) and brother (john,


Richard)true

3-king (Richard) or king (john)true

4-Not king (Richard)  king (john) true

8- Quantifiers: permit of express the properties of set of object


(without enumerating them all)

1- Universal quantifiers: ∀

Example: ∀ x, king(x)  person (x); it means that for all x, if x


is a king, then x is a variable which is lowercase.

In general, ∀ x, P: it means that P (logical expression) is true


for every object x

i.e.: P is true for any possible interpretation of x.

i.e.: if replace x with any possible object in our models, the


sentence P is true!!

2- Existential quantifier: ∃

To state properties for some object in our model, without naming


them.
Example: to state that john has a crown on his head, we write

∃ x, crown(x) and on head ( x, john)

To state that Fatima has a car, we write

∃ x, car(x) and have(Fatima , x)

NOTE:

Mother(x): x is a mother

Mother (Fatima): relates to a mother of Fatima or it is another name

∃ x : could be pronounciated

1-there exist at least x, such that…

2- For some x…

∃x, P: states that P is true for at least one object x.( quantified
sentence)

9- Nested sentences: sometimes we need to express some complex


quantified sentences using multiple quantifiers, we have two
possibilities.

a- Same type of quantifiers: two quantifiers of the same type

∀ x ∀y , brother(x,y) sibling(x,y)

We can rewrite it in another way:

∀x, y brother(x, y) sibling (x,y)

b- Mixture of different quantifiers:

Example: to state that “everybody loves somebody”

∀x ∃y, loves(x, y)

Note: in this case, the order of quantifiers is important.


Example: if we change the order of quantifiers in the previous

∃y ∀x, loves(x,y) : that means there is somebody who is loved by


everybody(there is a person that is loved by everybody)

Note: sometimes the parentheses could be used for more clarity

Example: ∀x (∃y loves(x, y)): that means, everybody has a


particular property which is that it has someone to love.

10-Connections between quantifiers: ∃ and ∀

Example1: ∀x Not likes(x, eggs): states that everybody Dislikes eggs

Not ∃x likes(x, eggs) :states that everybody Dislikes eggs

Example2: to state that everybody likes chocolate

∀x likes(x, chocolate)

Note ∃ x not likes(x, chocolate)

In general:

∀ x P = Not ∃ x Not P  A and B = Not(Not A or Not B)

∀ x Not P = Not ∃ x P  Not A and Not B = Not ( A or B)

NOT ∀ x P = ∃x Not P  Not (A and B) = Not A or Not B

∃x P = Not ∀x Not P  A or B = Not ( Not A and Not B)

Relations: ∀  and

∃  Or

Quantifiers are connected through negations, conclusion quantifiers are


connected through de-Morgan rules, which means that they obey de-Morgan
rules

Properties in PL:

1- P or Q or P = P or Q

2- P and Q and P = P and Q

3- True and P = P
4- True or P = true

5- False or P = P

6- False and P = False

11-Equality symbol (=): used to express or make atomic sentences to


make the fact that two terms refer to the same object.

Example: father (john) = Edward, to state that the object referred by


father (john) and the object referred by Edward are the same.

It can be used also with negation to state that two objects are
different.

Example: to express that Richard has at least two brothers:

∃ x, y brother(x,Richard) and brother(y,Richard) and Not (x=y)

You might also like