0% found this document useful (0 votes)
7 views27 pages

Expert Systems L5

The document provides an overview of First-order Logic (FOL), highlighting its ability to represent complex natural language statements and relationships between objects, unlike propositional logic which is limited to true or false facts. It explains key concepts such as predicates, variables, functions, and quantifiers, including universal and existential quantifiers, and their roles in forming logical statements. Additionally, it discusses the scope of variables and the distinction between bound and free variables in logical expressions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views27 pages

Expert Systems L5

The document provides an overview of First-order Logic (FOL), highlighting its ability to represent complex natural language statements and relationships between objects, unlike propositional logic which is limited to true or false facts. It explains key concepts such as predicates, variables, functions, and quantifiers, including universal and existential quantifiers, and their roles in forming logical statements. Additionally, it discusses the scope of variables and the distinction between bound and free variables in logical expressions.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Lecture 5

 First-order logic is an extension to


propositional logic.
 FOL is sufficiently expressive to represent the
natural language statements in a concise way.
 First-order logic is also known as Predicate
logic or First-order predicate logic or first order
predicate calculus.
 FOL is a powerful language that develops
information about the objects in a more easy
way and can also express the
relationshipbetween those objects.
 In propositional logic, we can only represent
the facts, which are either true or false.
 PL is not sufficient to represent the complex
sentences or natural language statements.
 The propositional logic has very limited
expressive power.
 Consider the following sentence, which we
cannot represent using PL logic.
 "Some humans are intelligent"
 “Khalid likes cricket."
 First-order logic (like natural language) does not
only assume that the world contains facts like
propositional logic but also assumes the following
things in the world:
 Objects (Variable): A, B, people, numbers, colors,
wars, theories, squares, pits, ......
 Relations (predicate): A predicate takes one or
more arguments, and is either true or false.
 Example:
Brother (Ali, Ahmed)
Relationship (Object1, Object2)
Constant 1,2,A,John,Mumbai,cat,....
Variables x,y,z,a,b,....
Predicates Brother,Father,....
Function sqrt,LeftLegOf,....
Connectives ∧,∨,¬,⇒,⇔
Equality ==
Quantifier ∀,∃
 Atomic sentences are the most basic sentences of
first-order logic. These sentences are formed from
a predicate symbol followed by a parenthesis
with a sequence of terms.
 We can represent atomic sentences as

Predicate (term1, term2, ......, term n).


 Example 1: Rian and Ayman are brothers: =>

Brother (Rian , Ayman)

Predicate(term1, term2)
 Example 2:
“Finn likes chocolate” represents as:
Likes(Finn, chocolate)

 Example 3:
“Finn likes x food” represents as:
Likes(Finn, x) where x is a variable within the
domain „food‟
Are constructed (much as in propositional logic)
By combing atomic sentence with logical connectives
Conjunction (∧): AND
Disjunction (∨): OR
Negation (¬): NOT
Implication (⇒) If…THEN
Equivalence (⇔): IF AND ONLY IF
Example:
“If Alison is friends with Richard then she likes him”
friends(alison, Richard) ⇒likes(alison,Richard)
“Alison likes Richard then or chocolate”
likes(alison, Richard) ∨likes(alison, chocolate)
 Predicates are symbols that represent the
attributes or connections of things. They are
used to construct assertions about things and
their properties. For instance, "human(x)" may
be a predicate indicating that "x is a human."
Variables are placeholders in logical statements
that allow us to refer to undefined objects. They
help in the creation of general statements that
may be applied to any object. In the predicate
"human(x)," for example, "x" is a variable that
represents any human.
Functions are similar to predicates but flexibly
map to terms to other terms( don‟t return truth)
Example:
Mathematics function: p(x) ⇒x2
Any value of x get‟s squared
Object: LeftLeg(John)
Interpreted as “John‟s left leg”
Rather than specifying a constant name of John‟s
left leg
 "Quantifiers" are words or phrases used before
nouns to indicate the amount or quantity of
something, without necessarily specifying the
exact numbe

There are two types of quantifier:


•Universal Quantifier, (for all, everyone, for each,
for any, everything)
•Existential quantifier, (for some, at least one).
 The Universal Quantifier is a logic concept that
allows you to make statements about each and
every individual member in a group. It's
equivalent to stating "for all" or "for every". It
states a condition that holds true for every member
of a set or collection in mathematical and logical
terms.
 Statement: "In every classroom, all students have
notebooks."
 Meaning: This statement conveys that within
every classroom, each and every student has a
notebook.
Implicationis the main connective
•If x is a variable, then ∀x is read as: For all x, For
each x, For every x.
•E.g. “Finn eats everything that he likes”
∀x (likes(Finn,x) → eats(Finn,x))
•For all x if Finn likes x then Finn eats
•All man drink coffee.

∀x man(x) → drink (x, coffee).


•It will be read as: There are all x where x is a man
who drink coffee.
 The Existential Quantifier (∃) is a key idea in logic that
allows you to say that at least one member in a group
or domain meets a certain condition. In other words,
it's the same as stating "there is" or "there exists" in
daily speech. It states the presence of at least one
member who fits a specific requirement in logical
terms.
 For Example, "There is a garden in the neighbourhood
with colourful flowers."
 Consider a neighbourhood that has a variety of
gardens. When we apply the Existential Quantifier (∃),
we mean that among all of these gardens, at least one
stands out because of its gorgeous flowers. We may not
know which garden it is, but we are certain that it
exists.
If x is a variable, then existential quantifier will be ∃x
or ∃(x). And it will be read as:
•There exists a 'x.‟, For some 'x.‟, For at least one 'x.‟
•Example:
•Some boys are intelligent.
∃x(boys(x) ∧intelligent(x))
•It will be read as: There are some x where x is a boy
who is intelligent.
•There exists some bird that doesn‟t fly.

∃x(bird(x) ∧¬flies(x))
 In universal quantifier, ∀x∀yis similar to ∀y∀x.
 In Existential quantifier, ∃x∃yis similar to ∃y∃x.
 ∃x∀yis not similar to ∀y∃x.
Using ∧ as the main connective with ∀
intended:
Example:
“Finn eats everything that he likes”
∀x (likes(Finn,x) → eats(Finn,x)) (true)
∀x (likes(Finn,x) ∧ eats(Finn,x)) (false)
Translated to “Finn eats everything and eats
everything”
Using → as the main connectives with ∃
intended:
Example:
There exists some bird that doesn‟t fly.
∃x(bird(x) ∧¬flies(x)) (true)
∃x(bird(x) → ¬flies(x)) (false)
Translation very difficult, but this statement is
only true if there is something other than bird:
 Involving properties of a single variable
∀x (house(x) → physical_object(x))
Every house is a physical object

 Binary predicates:
•Involving properties of a two variable
∀x,y(Brother(x,y) → Sibling (x,y))
Brothers are siblings
 Brothers are siblings
∀x,y(Brother(x,y) → Sibling(x,y))
 Sibling is symmetric

∀x,y(Sibling(x,y) → Sibling(y,x))

 One‟s mother is one‟s female parent


i.e. defining mother in terms of parentage
∀x,y(Mother(x,y) ⇔(Female(x)∧Parent(x,y)))
The scope of a variable is the sentence to which the quantifier
syntactically applies
•Examples:
∃x(Cat(x) ∧∀x(Black(x)))
The x in Black(x) is universal quantified, but elsewhere it‟s not
“There is a cat that all black”

∀x ((∃y)(P(x,y) ∧Q(x,y)) → R(x))


Scope of ∀x is entire expression
Scope ∃y of is (P(x,y) ∧Q(x,y))

∀x ((∃y)(P(x,y) ∧Q(x,y)) → R(x))


Scope of ∀x is entire expression
Scope y not defined for P(x,y) hence y is free variable
Variables are bound or free based on their
connection to some quantifiers
Bound variables is in the scope of some quantifier
 Variable can be given specific values (as
constant) or can be constrained by quantifiers
 ∀x (A(x)→ B(x))

X is bound by ∀
A formula with no free variables is called closed
formula sentence, or a proposition, and has a
truth value
Free Variable: A variable is said to be a free
variable in a formula if it occurs outside the
scope of the quantifier.
Example:
∀x ∃(y)[P (x, y, z)], where z is a free variable.
1. What is the meaning of the following FOL
formulas?
1. bought(Frank, dvd)
2. ∃x.bought(F rank, x)
3. ∀x.(bought(F rank, x) → bought(Susan, x))
4. ∀x.bought(F rank, x) → ∀x.bought(Susan, x)
5. ∀x∃y.bought(x, y)
6. ∃x∀y.bought(x, y)
 Formalize the following sentences using FOL formulas.
1. All Students are smart.
2. There exists a student.
3. There exists a smart student.
4. Every student loves some student.
5. Every student loves some other student.
6. There is a student who is loved by every other student.
7. Bill is a student.
8. Bill takes either Analysis or Geometry (but not both).
9. Bill takes Analysis and Geometry.
10. Bill doesn‟t take Analysis.
11. No students love Bill

You might also like