0% found this document useful (0 votes)
15 views

Artificial Intelligence Chapter8

This document provides an overview of first-order logic (FOL). FOL extends propositional logic by adding objects, relations, and functions. It represents relationships between objects using predicates, functions, constants, and variables. Sentences in FOL can be atomic, using a single predicate, or complex, combining multiple atomic sentences with logical connectives. Quantifiers like universal ("for all") and existential ("there exists") are used to specify the scope and range of variables. Inference rules like universal generalization and instantiation and existential introduction and instantiation allow deducing new sentences from existing ones in a valid way.

Uploaded by

Osman Addawe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Artificial Intelligence Chapter8

This document provides an overview of first-order logic (FOL). FOL extends propositional logic by adding objects, relations, and functions. It represents relationships between objects using predicates, functions, constants, and variables. Sentences in FOL can be atomic, using a single predicate, or complex, combining multiple atomic sentences with logical connectives. Quantifiers like universal ("for all") and existential ("there exists") are used to specify the scope and range of variables. Inference rules like universal generalization and instantiation and existential introduction and instantiation allow deducing new sentences from existing ones in a valid way.

Uploaded by

Osman Addawe
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

FIRST ORDER Logic

Chapter EIGHT
1
OUTLINE
 FIRST ORDER LOGIC
 SYNTAX OF FOL: BASIC ELEMENT
 ATOMIC SENTENCE
 COMPLEX SENTENCE
 QUANTIFIES IN FOL
 UNIVERSAL QUANTIFIES
 EXISTENTIAL QUANTIFIES
 EXAMPLES
2
FIRST ORDER LOGIC

 FOL is another way of knowledge representation


in AI. It is an extension of PL(Propositional Logic).
 FOL is also known as Predicate Logic. It is a
powerful language that develop information
about the objects in a more easy way and can
also express the relationship between those
objects
 FOL does not only assume that the world contain
fact like PL but also assume
 OBJECT, RELATIONS AND FUNCTIONS
3
Conti…

 Objects: people, houses, numbers, theories, colors,


baseball games, wars, centuries…..
 Relations: brother of, bigger than, inside of , part
of, has color, occurred after, owns, comes between,
….
 Functions: father of, best friend, one more than,
end of ……..
 As a natural language , FOL has two main parts
 SYNTAX
 SEMANTICS
4
SYNTAX OF FOL: BASIC ELEMENT

 Constant:
 Variable:
 Predicate:
 Function:
 Connective:
 Equity:
 Quantities :
5
Atomic Sentence

 Atomic sentence are the most basic


sentence of FOL. These sentence are formed
from a predicate symbol followed by
parenthesis with a sequence of terms
 We can represent atomic sentence as
 Predicate(term1, term2,…..,term n)
 A sentence expresses a claim that is either
true or false
6
Example: Atomic Sentence

 A sentence formed by a single predicate


followed by one or more names
 Predicate(term1, term2,…..,term n)
 Max is tall Tall(max)
 e is larger than b Larger(e, b)
 e is identical to a e(a)
 Ali and Ahmed are brothers brother( Ali , Ahmed)

N.B. Blue Color  Predicate , Black Color  Term


7
Complex sentence
 Complex sentence are made by combining atomic
sentence using connective
 P, PQ, PQ, PQ, PQ where P and Q are
sentences
 In complex of FOL statement divided into two
part:
 Subject: It is the main part of the statement
 Predicate: can be defined as a relation,
which binds two atoms together in a
statement 8
Example: Complex sentence

Consider the Statement:


 “x is an integer”
 It consist of two part
 First part: “x” is the subject of
statement
 Second part: “is an integer ” is
known as predicate
9
Quantifies in FOL
 A Quantifies is a long element which
generate quantification
 These are the symbols that permit to
determine or identify the range and scope of
the variable in logic expression
 There are two types of quantifies
 Universal quantifies: deal about the range ( For
all , Everyone, Everything)
 Existential quantifies: deal about the scope (
For some , at least one, )
10
Universal quantifies

 It is a symbol of logical representation which


specifies that the statement within its range is
true for everything or every instance of particular
thing.
 It is represented by a symbol “Ɐ”
 It Universal quantifies we use implication “”.
 For example if x is a variable, the “Ɐx” is read as
 For all x
 For each x
 For every x
11
Existential quantifies
 It is a type of quantifies, which express that the
statement within its scope is true for at least one
instance of something
 It is denoted by “ꓱ”
 In existential quantifies, we always use AND or
conjunction symbols “”
 For example, If x is variable, then existential
quantifies will be x is read as
 For some x
 For at least one x
12
EXAMPLE(Universal quantifies)

 All man drink coffee


 Let x us variable
 X1 drink coffee  X2 drink coffee …  Xn
drink coffee
 So we can write this as,
 Ɐx man (x)  drink(x, coffee)
 There are all x where x is a man who drink
coffee
13
EXAMPLE(Universal quantifies)

 All birds fly


 Predicate is “fly bird”
 Ɐx bird(x)  fly(x)
 Every man respects his parent
 Predicate is “respect(man, parent)”
 Ɐy man(x)  respect(x, parent)
 The every man , so we use Ɐ
N.B.
1. x = Bird and
2. x= man y=parent
14
EXAMPLE(Existential quantifies)

 Some boys are intelligent


 x1 is intelligent  x2 is intelligent ….  xn is
intelligent
 ꓱx boy(x)  intelligent(x)
 There are some x where x is a boy who is
intelligent
The main connective for Ɐ is ‘’.
The main connective for ꓱ is ‘’.

15
INFERENCE IN FIRST ORDER LOGIC

 Inference in FOL is used to deduce new fact


sentence form existing sentence
 Before understanding FOL inference rule, let’s
understand some terminologies used in FOL
1. SUBSTITUTION
 It is a fundamental operation performed on
terms and formulas. It occur in all inference
system in FOL  F(a|x)
 Substitute a constant “a” in place of variable “x”
16
2. EQUALITY

 FOL logic does not only use predicate and term


for making atomic sentence but also uses
another way, which is equality in FOL
 E.g. Brother(John) = smith
 The object referred by brother (John) is similar to
object referred by smith.
 The equality symbol can also be used with
negation to represent that two terms are not the
same objects
 E.g.  (x=y) which is equivalent to x≠y
17
FOL inference rules for quantifies

Inference rules in first order logic


(FOL)
 Universal Generalization
 Universal Instantiation
 Existential Instantiation
 Existential Introduction
18
Universal Generalization
 It is a valid inference rule which states that if
premise p(c) is true for any arbitrary
element c in universe of discourse,
 then we can have conclusion Ɐx p(x)
p(c)
 It can be represented as
Ɐx p(x)
 E.g. Let’s represent, p(c): “A byte contains 8 bits”
 so, for Ɐx p(x) : “all bytes contain 8 bits” it will
also be trues

19
Universal Instantiation
 It is also called universal elimination. It can
applied multiple time to add new sentence.
 The UI rules state that we can infer any P(c) by
substituting a ground term c (a constant within
domain x) for any object in the universe of
discourse
Ɐx p(x)
p(c)
 E.g. “ Every person like ICE-CREAM”  Ɐx p(x)
 so we can infer that, “John like ice-cream” p(c)
20
Existential Introduction
 It is also called as Existential Generalization.
 This rule state that if there is some element c in
the universe of discourse which has a property P,
 we can infer that there exist something in the
universe which has property P.
p(c)
ꓱx p(x)
 E.G. “Ahmed got good marks in math”  P(c)
 “Therefore, some one got good marks in
math” ꓱx p(x)
21
Existential Instantiation
 It is also called Existential elimination, which
is a valid inference rule in FOL
 It can applied by once to replace the
existential sentence.
 The EI rules state that one can infer any P(c)
from the formula given in the form ꓱx p(x)
for a new constant symbol “c”
ꓱx p(x)
p(c) 22
END
23

You might also like