Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

Logic Representation

Logic
• Logics are the formal languages for representing
information such that conclusion can be drawn.

• Two kinds of logic are there:

propositional logic
 logic (first-order predicate calculus)
Propositional and Predicate Logic
Formal Definitions
• AND and OR operators are sometimes
referred to as conjunction and disjunction
respectively.
Propositional logic
• The logic of propositions (also called propositional logic) is an
alternative form of knowledge representation.

• For instance, it can join simple sentences or clauses by logical


connectives to represent more complex sentences.

• Due to the usage of logical connectives. Prepositional logic is


sometimes called logical calculus.

• In propositional logic, symbols represent whole propositions (facts);


Some Simple Facts in
Propositional Logic
Propositional Logic: Semantics

7
Limitations of Propositional Logic
1. It is too weak, i.e., has very limited expressiveness

2. Each rule has to be represented for each situation


Limitations of Propositional Logic
Socrates is a man.

SOCRATESMAN
Can not able to draw similarities between
Plato is a man. Socrates and Plato.
PLATOMAN

Better representations :

MAN(SOCRATES)

MAN(PLATO)
Fail to capture the relationship
All men are mortal.
between any individual being a
MORTALMAN man and that individual being
mortal
Better representation :
Limitation of propositional Logic
• Propositional logic could not represent
following types of sentences:

• All Triangles have three sides.


• All students use computer.
• Some students use computer.

10
Predicate Logic
• Predicate Logic (also called first order predicate logic or simply
first order logic or predicate calculus) has similar formalisms
like the propositional logic.

• It is more versatile than the propositional counterpart for its


added features.

• For instance, it includes two quantifiers, namely, the essential


quantifier  and the existential quantifier   that are capable
of handling more complex knowledge.
Knowledge 1: All boys like sweets.
Using predicate logic, we can write the above statement as

X  Boy X  Likes X,sweets


Knowledge 2: Some boys like flying kites.
Using predicate logic, the above statement can be represented as

X  Boy  X   Likes  X , Flying  kites 

Before describing predicate logic (PL) or first order logic (FOL) in a


formal manner, we first present the alphabets of FOL.
Using Predicate Logic

• Can represent objects and quantification


Using Predicate Logic
1. Marcus was a man.
2. Marcus was a Pompeian.
3. All Pompeians were Romans.
4. Caesar was a ruler.
5. All Pompeians were either loyal to Caesar or hated him.
6. Every one is loyal to someone.
7. People only try to assassinate rulers they are not loyal to.
8. Marcus tried to assassinate Caesar.
Using Predicate Logic
1. Marcus was a man.
man(Marcus)
Using Predicate Logic
2. Marcus was a Pompeian.
Pompeian(Marcus)
Using Predicate Logic
3. All Pompeians were Romans.
x: Pompeian(x)  Roman(x)
Using Predicate Logic
4. Caesar was a ruler.
ruler(Caesar)
Using Predicate Logic
5. All Pompeians were either loyal to Caesar or hated
him.
x: Pompeian (x)  loyalto(x, Caesar) 
hate(x, Caesar)
Using Predicate Logic
6. Every one is loyal to someone.
x: y: loyalto(x, y) y: x: loyalto(x, y)
Using Predicate Logic
7. People only try to assassinate rulers they are not loyal to.

x: y: person(x)  ruler(y)  tryassassinate(x, y)


 loyalto(x, y)
Using Predicate Logic
8. Marcus tried to assassinate Caesar.
tryassassinate(Marcus, Caesar)
Using Predicate Logic
Was Marcus loyal to Caesar?
man(Marcus)
ruler(Caesar)
tryassassinate(Marcus, Caesar)
 x: man(x)  person(x)
loyalto(Marcus, Caesar)
Using Predicate Logic
• Many English sentences are ambiguous.
• There is often a choice of how to represent
knowledge.

• Obvious information may be necessary for


reasoning

• We may not know in advance which statements


to deduce (P or P).

You might also like