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

Lec 11

The document discusses First-Order Logic (FOL) as a powerful extension of propositional logic, emphasizing its ability to express relationships and properties of objects. It covers key concepts such as syntax, semantics, atomic and complex sentences, and the use of quantifiers. The lecture aims to illustrate how FOL can generalize statements and reason about objects in a more expressive manner.

Uploaded by

syed Bilal Ahmed
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)
2 views

Lec 11

The document discusses First-Order Logic (FOL) as a powerful extension of propositional logic, emphasizing its ability to express relationships and properties of objects. It covers key concepts such as syntax, semantics, atomic and complex sentences, and the use of quantifiers. The lecture aims to illustrate how FOL can generalize statements and reason about objects in a more expressive manner.

Uploaded by

syed Bilal Ahmed
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/ 26

“Artificial Intelligence”

CS-481
Lecture 11
“Chapter 7 Knowledge Representation
Schemes”

By: Dr. Saima Hassan


Asst. Professor, Institute of Computing
KUST
2 Tautology and Contradiction
5 Example
6 Logical Equivalence
7
8 Do it yourself

(AVB)^C

(AV ~B) ^ B
9 FOL

 In predicate calculus or First order Logic (FOL), we use predicates to express


properties of objects.
 Predicate calculus allows us to reason about the object’s proprieties and
the relationships between them.
 In propositional calculus, we can express sentence “I like chocolate” by P.
 We can also construct ¬ P from here which means “I do not like
chocolate”.
10 FOL

 This does not allow us to extract any information about me, or I


like or chocolate.
 In predicate logic, we can express the sentence P by L(me,
chocolate) where L is a predicate that represents ╉liking.╊
 Predicate calculus can be generalized and used for more
general statements.
 “I like chocolate” to “Everyone likes chocolate” and can be
expressed as:
 ∀x P(x)⇒L(x, c) where ∀ means “for all” and it is called universal
quantifier.
Motivation for FOL

Statements that can not be made in Propositional Logic but can be made in
FOL
 When you paint a block with green paints, it becomes green
 In Propositional Logic one would need a statement about every single block, one can
not make a general statement about all blocks.
 When you sterilize a jar, all bacteria are dead.
 In FOL we can talk about all bacteria without naming them explicitly.
12 First-Order Logic
 First-Order Predicate Logic
 First-Order Predicate Calculus

Much more powerful the propositional (Boolean) logic


Greater expressive power than propositional logic
We no longer need a separate rule
Allows for facts, objects, and relations
In programming terms, allows classes, functions and variables
Topic: First Order Logic

First-Order Logic

Whereas propositional logic assumes world contains facts, first-order logic


(like natural language) assumes the world contains:

• Objects: people, houses, numbers colors, baseball games,


wars, centuries . . .
• Relations: red, round, prime. . ., brother of, bigger than,
inside, part of, has color, occurred after, owns, comes between,
...
• Functions: father of, best friend, one more than.
14
Relations
 Some relations are properties: they state some fact about a single
object: Round(ball), Prime(7).

 n-ary relations state facts about two or more objects:


Married(John,Mary), GreaterThan(3,2).

 Some relations are functions: their value is another object:


Plus(2,3), Father(Dan).
16 First-Order Logic
As a natural language, first-order logic also has two main
parts:
Syntax
Semantics
Topic: First Order Logic

Syntax of FOL: Basic elements


Topic: First Order Logic

First-Order Logic

First-order logic statements can be divided into two parts:


 Subject: Subject is the main part of the statement.
 Predicate: A predicate can be defined as a relation, which binds two atoms
together in a statement.
Topic: First Order Logic

Sentences in FOL
Atomic Sentences:
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:
Ahmad and Saad are brothers: => Brothers(Ahmad, Saad)
Tom is a cat: => cat (Tom).
Sentences in FOL
Complex Sentences:
Complex sentences are made by combining atomic sentences
using connectives.
 Brother(Richard, John)  Brother(John, Richard)

 King(Richard)  King(John)

 King(John) =>  King(Richard)

 LessThan(Plus(1,2) ,4)  GreaterThan(1,2)

(Semantics are the same as in propositional logic)


Quantifiers in First-order logic:

These are the symbols that permit to determine or identify the


range and scope of the variable in the logical expression.
There are two types of quantifier:

Universal Quantifier, (for all, everyone, everything)


Existential quantifier, (for some, at least one).
Quantifiers in First-order logic:
Universal Quantifier, (for all, everyone, everything) 
Quantifiers in First-order logic:
Universal Quantifier, (for all, everyone, everything) 
Examples
 x King(x) => Person(x)
 x Person(x) => HasHead(x)
 i Integer(i) => Integer(plus(i,1))

Note that
 x King(x)  Person(x) is not
correct!

 x King(x) => Person(x)


Quantifiers in First-order logic:
Existential quantifier, (for some, at least one). 
Quantifiers in First-order logic:
Existential quantifier, (for some, at least one). 

Examples:
 x King(x)
 x Lives_in(John, Castle(x))
 i Integer(i)  GreaterThan(i,0)
Examples

You might also like