0% found this document useful (0 votes)
25 views48 pages

Ai Module2

This document discusses predicate logic as a method for knowledge representation, highlighting its structure, symbols, and the use of quantifiers and predicates. It covers the representation of facts, instance and isa relationships, computable functions, and the resolution procedure for proving statements. The document emphasizes the importance of predicate logic in reasoning and knowledge representation in computer systems.

Uploaded by

Arun IG
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)
25 views48 pages

Ai Module2

This document discusses predicate logic as a method for knowledge representation, highlighting its structure, symbols, and the use of quantifiers and predicates. It covers the representation of facts, instance and isa relationships, computable functions, and the resolution procedure for proving statements. The document emphasizes the importance of predicate logic in reasoning and knowledge representation in computer systems.

Uploaded by

Arun IG
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/ 48

MODULE 2

1.ISSUES IN KNOWLEDGE
REPRESENTATION
2.PREDICATE LOGIC
Introduction
• Predicate logic is used to represent Knowledge.
Predicate logic will be met in Knowledge
• Representation Schemes and reasoning methods. There
are other ways but this form is popular. Propositional
Logic
• It is simple to deal with and decision procedure for it
exists. We can represent real-world facts as logical
propositions written as well-formed formulas. To
explore the use of predicate logic as a way of
representing knowledge by looking at a specific
• example.
PREDICATE LOGIC
• example.
• 𝐼𝑡 𝑖𝑠 𝑟𝑎𝑖𝑛𝑖𝑛𝑔 𝑅𝐴𝐼𝑁𝐼𝑁𝐺
• 𝐼𝑡 𝑖𝑠 𝑠𝑢𝑛𝑛𝑦. 𝑆𝑈𝑁𝑁𝑌
• 𝐼𝑡 𝑖𝑠 𝑤𝑖𝑛𝑑𝑦. W𝐼𝑁𝐷𝑌
• 𝐼𝑓 𝑖𝑡 𝑖𝑠 𝑟𝑎𝑖𝑛𝑖𝑛𝑔 𝑡ℎ𝑒𝑛 𝑖𝑡 𝑖𝑠 𝑛𝑜𝑡 𝑠𝑢𝑛𝑛𝑦. ∶ 𝑅𝐴𝐼𝑁𝐼𝑁𝐺  ℸ 𝑆𝑈𝑁𝑁𝑌
• 𝑆𝑜𝑐𝑟𝑎𝑡𝑒𝑠 𝑖𝑠 𝑎 𝑚𝑎𝑛 𝑆𝑂𝐶𝑅𝐴𝑇𝐸𝑆𝑀𝐴𝑁
• 𝑃𝑙𝑎𝑡𝑜 𝑖𝑠 𝑎 𝑚𝑎𝑛 𝑃𝐿𝐴𝑇𝑂𝑀𝐴𝑁
• The above two statements becomes totally separate assertion, we
would not be able to draw any conclusions about similarities
between Socrates and Plato.
• 𝑀𝐴𝑁(𝑆𝑂𝐶𝑅𝐴𝑇𝐸𝑆)
• 𝑀𝐴𝑁(𝑃𝐿𝐴𝑇𝑂)
• These representations reflect the structure of the knowledge itself.
These use predicates applied to arguments.
PREDICATE LOGIC
• 𝐴𝑙𝑙 𝑚𝑒𝑛 𝑎𝑟𝑒 𝑚𝑜𝑟𝑡𝑎𝑙 𝑀𝑂𝑅𝑇𝐴𝐿𝑀𝐴𝑁

• It fails to capture the relationship between any individual being a man and that
individual being a mortal.

• We need variables and quantification unless we are willing to write separate


statements

• Predicate:
• A Predicate is a truth assignment given for a particular statement which is either
true or false. To solve common sense problems by computer system, we use
predicate logic.
• Logic Symbols used in predicate logic
• ∀ − 𝐹𝑜𝑟 𝑎𝑙𝑙
• ∃ − 𝑇ℎ𝑒𝑟𝑒 𝑒𝑥𝑖𝑠𝑡𝑠
• → − 𝐼𝑚𝑝𝑙𝑖𝑒𝑠 ℸ − 𝑁𝑜𝑡
• ∨ − 𝑂𝑅
• ∧ − 𝐴𝑁𝐷
PREDICATE LOGIC
• Predicate Logic
• Terms represent specific objects in the world and can be constants,
variables or functions.
• Predicate Symbols refer to a particular relation among objects.
• Sentences represent facts, and are made of terms, quantifiers and predicate
symbols.
• Functions allow us to refer to objects indirectly (via some relationship).
• Quantifiers and variables allow us to refer to a collection of objects without
explicitly naming each object.
• Some Examples
– Predicates: Brother, Sister, Mother , Father
– Objects: Bill, Hillary, Chelsea, Roger
– Facts expressed as atomic sentences a.k.a. literals:
• Father(Bill,Chelsea)
• Mother(Hillary,Chelsea)
• Brother(Bill,Roger)
• ┐Father(Bill,Chelsea)
PREDICATE LOGIC
• Variables and Universal Quantification
• Universal Quantification allows us to make a statement about a collection of
objects:
• x Cat(x) . Mammel(x) : All cats are mammels
• x Father(Bill,x) . Mother(Hillary,x) : All of Bill’s kids are also Hillary’s kids.

• Variables and Existential Quantification


• Existential Quantification allows us to state that an object does exist (without
naming it):
• .x Cat(x) .Mean(x) : There is a mean cat.
• .x Father(Bill,x) .Mother(Hillary,x) : There is a kid whose father is Bill and whose
mother is Hillary

• Nested Quantification
• .x,y Parent(x,y) . Child(y,x)
• .x .y Loves(x,y)
• .x [Passtest(x) .(.x ShootDave(x))]
PREDICATE LOGIC
• Functions
• Functions are terms - they refer to a specific object.
• We can use functions to symbolically refer to objects without naming them.
• Examples:
• fatherof(x) age(x) times(x,y) succ(x)
Using functions
• . x Equal(x,x)
• Equal(factorial(0),1)
• . x Equal(factorial(s(x)), times(s(x),factorial(x)))

• If we use logical statements as a way of representing knowledge, then we


have available a good way of reasoning with that knowledge.
PREDICATE LOGIC
Representing facts with Predicate Logic
1) Marcus was a man 𝑚𝑎𝑛(𝑀𝑎𝑟𝑐𝑢𝑠)
2) Marcus was a Pompeian 𝑝𝑜𝑚𝑝𝑒𝑖𝑎𝑛(𝑀𝑎𝑟𝑐𝑢𝑠)
3) All Pompeians were Romans
∀𝑥 ∶ 𝑝𝑜𝑚𝑝𝑒𝑖𝑎𝑛(𝑥) → 𝑟𝑜𝑚𝑎𝑛(𝑥)
4 ) Caeser was a ruler. 𝑟𝑢𝑙𝑒𝑟(𝐶𝑒𝑎𝑠𝑒𝑟)
5 )All romans were either loyal to caeser or hated him.
– ∀𝑥 ∶ 𝑟𝑜𝑚𝑎𝑛(𝑥) → 𝑙𝑜𝑦𝑎𝑙𝑡𝑜(𝑥, 𝑐𝑎𝑒𝑠𝑒𝑟) ∨ ℎ𝑎𝑡𝑒(𝑥, 𝑐𝑎𝑒𝑠𝑒𝑟)

6) Everyone loyal to someone. ∀𝑥, ∃𝑦 ∶ 𝑙𝑜𝑦𝑎𝑙𝑡𝑜(𝑥, 𝑦)


7) People only try to assassinate rulers they are not loyal to.
∀𝑥, ∀𝑦: 𝑃𝑒𝑟𝑠𝑜𝑛(𝑥) ⋀ 𝑅𝑢𝑙𝑒𝑟(𝑦) ⋀ 𝑡𝑟𝑦_𝑎𝑠𝑠𝑎𝑠𝑠𝑖𝑛𝑎𝑡𝑒(𝑥, 𝑦) → ¬𝐿𝑜𝑦𝑎𝑙_𝑡𝑜(𝑥, 𝑦)
8) Marcus try to assassinate Ceaser 𝑡𝑟𝑦_𝑎𝑠𝑠𝑎𝑐𝑖𝑛𝑎𝑡𝑒(𝑀𝑎𝑟𝑐𝑢𝑠, 𝐶𝑒𝑎𝑠𝑒𝑟)
PREDICATE LOGIC
PREDICATE LOGIC
2.1 Representing Instance and Isa
Relationships
• Two attributes isa and instance play an
important role in many aspects of knowledge
representation. The reason for this is that they
support property inheritance.
• isa - used to show class inclusion, e.g. isa
(mega_star,rich).
• instance - used to show class membership, e.g.
instance(prince,mega_star).
2.1 Representing Instance and Isa
Relationships
2.1 Representing Instance and Isa
Relationships
In the figure above,
• The first five sentences of the represent the pure predicate logic. In these
representations, class membership is represented with unary predicates (such as
Roman), each of which corresponds to a class. Asserting that P(x) is true is
equivalent to asserting that x is an instance of P.
• The second part of the figure contains representations that use the instance
predicate explicitly. The predicate instance is a binary one, whose first
argument is an object and whose second argument is a class to which the object
belongs. But these representations do not use an explicit isa predicate.
• The third part contains representations that use both the instance and isa
predicates explicitly. The use of the isa predicate simplifies the representation
of sentence 3, but it requires that one additional axiom be provided. This
additional axiom describes how an instance relation and an isa relation can be
combined to derive a new instance relation.
2.2 Computable Functions and
Predicates
This is fine if the number of facts is not very large or if the facts
themselves are sufficiently unstructured that there is little alternative.
But suppose we want to express simple facts, such as the following
greater-than and less-than relationships:
gt(1,0) It(0,1)
gt(2,1) It(1,2)
gt(3,2) It( 2,3)
Clearly we do not want to have to write out the representation of each
of these facts individually. For one thing, there are infinitely many of
them. But even if we only consider the finite number of them that can
be represented, say, using a single machine word per number, it would
be extremely inefficient to store explicitly a large set of statements
when we could, instead, so easily compute each one as we need it. Thus
it becomes useful to augment our representation by these computable
predicates.
2.2 Computable Functions and
Predicates
2.2 Computable Functions and
Predicates
Prove that Marcus is dead now
2.2 Computable Functions and
Predicates
2.3 Resolution
• A procedure to prove a statement, Resolution attempts to show that Negation of
Statement gives Contradiction with known statements. It simplifies proof
procedure by first converting the statements into canonical form. Simple iterative
process; at each step, 2 clauses called the parent clauses are compared, yielding a
new clause that has been inferred from them.
• Resolution refutation:
• • Convert all sentences to CNF (conjunctive normal form)
• • Negate the desired conclusion (converted to CNF)
• Apply resolution rule until either
• Derive false (a contradiction)
• Can’t apply any more Resolution refutation is sound and complete
• If we derive a contradiction, then the conclusion follows from the axioms
• If we can’t apply any more, then the conclusion cannot be proved from the
axioms.
2.3 Resolution
• A procedure to prove a statement, Resolution attempts to show that
Negation of Statement gives Contradiction with known statements. It
simplifies proof procedure by first converting the statements into canonical
form. Simple iterative process; at each step, 2 clauses called the parent
clauses are compared, yielding a new clause that has been inferred from
them.
• Resolution refutation:
• • Convert all sentences to CNF (conjunctive normal form)
• • Negate the desired conclusion (converted to CNF)
• Apply resolution rule until either
• Derive false (a contradiction)
• Can’t apply any more Resolution refutation is sound and complete
• If we derive a contradiction, then the conclusion follows from the axioms
• If we can’t apply any more, then the conclusion cannot be proved from the
axioms.
2.3 Resolution
• Sometimes from the collection of the statements we have, we
want to know the answer of this question - "Is it possible to
prove some other statements from what we actually know?" In
order to prove this we need to make some inferences and those
other statements can be shown true using Refutation proof
method i.e. proof by contradiction using Resolution. So for the
asked goal we will negate the goal and will add it to the given
statements to prove the contradiction.
• So resolution refutation for propositional logic is a complete
proof procedure. So if the thing that you're trying to prove is,
in fact, entailed by the things that you've assumed, then you
can prove it using resolution refutation.
2.3 Resolution
2.3 Resolution
2.3 Resolution
2.3 Resolution
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Conversion of FIRST ORDER LOGIC(FOL) TO
CNF(CONJUCTIVE NORMAL FORM)
Unification
Unification
Unification
Unification
Unification

You might also like