Lecture#6 - Knowledge Representation

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 18

ARTIFICIAL INTELLIGENCE

Dr. Shahid Naseem


Assistant Professor (IT)
Shahid.Naseem@ue.edu.pk

Dept. of Information Sciences, University of Education, Lahore


Knowledge Representation
• knowledge representation to store what it knows or hears.
• Knowledge representation and reasoning enable agents to reach good
decisions.
• knowledge representation (the study of how to put knowledge into a
form that a computer can reason with) is tied to language and informed
by research in linguistics, which was connected in turn to decades of
work on the philosophical analysis of language.
• knowledge representation and reasoning is useful to have a formal,
explicit representation of the world and its workings and to be able to
manipulate that representation with deductive processes.
• The widespread growth of applications to real-world problems caused a
concurrent increase in the demands for workable knowledge
representation schemes.
• A large number of different representation and reasoning languages
were developed.

Dept. of Information Sciences, University of Education, Lahore


Knowledge Representation
• Some were based on logic—for example, the Prolog language became
popular in Europe, and the PLANNER family in the United States.
• Others, following FRAMES, adopted a more structured approach,
assembling facts about particular object and event types and arranging
the types into a large taxonomic hierarchy analogous to a biological
taxonomy.
• The central component of a knowledge-based agent is its KNOWLEDGE
BASE knowledge base, or KB. A knowledge base is a set of sentences.
• Each sentence is expressed in a language called a knowledge
representation language.
• Intelligent agents need knowledge about the world in order to
reach good decisions.
• A knowledge-based agent is composed of a knowledge base and
an inference mechanism.

Dept. of Information Sciences, University of Education, Lahore


Knowledge Representation
• It operates by storing sentences about the world in its knowledge
base, using the inference mechanism to infer new sentences, and
using these sentences to decide what action to take.
• A representation language is defined by its syntax, which specifies
the structure of sentences, and its semantics, which defines the
truth of each sentence in each possible world or model.
• The relationship of entailment between sentences is crucial to our
understanding of reasoning. A sentence α entails another
sentence β if β is true in all worlds where α is true. Equivalent
definitions include the validity of the sentence α ⇒ β and the un-
satisfiability of the sentence α ∧ ¬ β.
• In knowledge representation, a domain is just some part of the
world about which we wish to express some knowledge.

Dept. of Information Sciences, University of Education, Lahore


Knowledge Representation
• Knowledge representation languages should be declarative,
compositional, expressive, context independent, and
unambiguous.

Dept. of Information Sciences, University of Education, Lahore


Knowledge Representation
• Humans learn mundane (ordinary) tasks since their birth. They
learn by perception, speaking, using language, and locomotives.
• They learn Formal Tasks and Expert Tasks later, in that order.
• For humans, the mundane tasks are easiest to learn.
• The same was considered true before trying to implement
mundane tasks in machines. Earlier, all work of AI was
concentrated in the mundane task domain.
• Later, it turned out that the machine requires more knowledge,
complex knowledge representation, and complicated algorithms
for handling mundane tasks.
• This is the reason why AI work is more prospering in the Expert
Task domain now, as the expert task domain needs expert
knowledge without common sense, which can be easier to
represent and handle.

Dept. of Information Sciences, University of Education, Lahore


Knowledge Representation
• Knowledge representation: It is the method used to organize and
formalize the knowledge in the knowledge base. It is in the form of
IF-THEN-ELSE rules.
• Knowledge Acquisition: The success of any expert system majorly
depends on the quality, completeness, and accuracy of the
information stored in the knowledge base.

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
• Resolution provides facts/queries its answers by refutation
(Negation).
• It involves assuming the fact/query is false and reaching in
contradiction, which indicates that the opposite must be true.

Steps of Resolution
There are four steps of resolution to solve the problem.
1. Convert all problem statements into FOL.
2. Convert FOL into CNF (Conjective Number Format).
3. Assets the negotiation of goal.
4. Resolve clauses together using Resolution Tree.

Dept. of Information Sciences, University of Education, Lahore


Resolution in AI
Steps to Convert FOL into CNF

• Eliminate Implication
• Standardize Variables
• Move Negotiation inwards
• Skolemization
• Drop Universal Quantifier

Step -1 Eliminate Implication

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Step-2 Standardize Variables
1. Someone is Smiling

2. Someone is Graduating

3. All are Happy

• Standardize Variables mean, we should use different variables


names instead of x in all cases such as

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Step-3 Move Negation in Wards
• In this step, universal quantifier is replaced with extential
quantifier and extential quantifier is replaced with universal
quantifier and vice versa.

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Step-4 Skolemization
• In this step, we will remove extential quantifier and replace
variable with a skolem constant as

• Where A, B are Skolem constants.

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Step-5 Drop Universal Quantifier
• In this step, we remove only universal quantifier in any statement
and we can’t use extential quantifier in this case and leave the
variable as it is, it will replace with any constant as:

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Why we need to convert FOL into CNF
• First of all, we convert all statements into Procedural Logic (PL).
• Then convert all PL statements into First Order Predicate Logic
(FOL).
• Then convert all FOL statements into CNF.
• As in FOL, statements are very complicated which are difficult to
understand by a computer, whereas, in CNF, statements are very
simple, which are easy to understand by a computer.
• That is why, we need to convert FOL statements in CNF.

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
•. i. Cat likes fish
• ii. Cat eats everything it likes
• iii. Mano is a cat
• We have to prove that
Mano eats fish

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Convert the Statements into FOL

For example

Mano(x)

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI
Convert FOL into CNF

Dept. of Information Sciences, University of Education, Lahore


Resolution In AI

¬𝑒𝑎𝑡𝑠 ( 𝑥 , 𝑓𝑖𝑠h )
𝐸𝑞𝑢𝑎𝑡𝑖𝑜𝑛−2 ¬𝑐𝑎𝑡 ( 𝑥 ) ∪¬ 𝑙𝑖𝑘𝑒𝑠 ( 𝑥, 𝑦 ) ∪𝑒𝑎𝑡𝑠(𝑥 , 𝑦)

𝑅𝑒𝑚𝑎𝑖𝑛𝑖𝑛𝑔 𝑃𝑎𝑟𝑡 ¬𝑐𝑎𝑡 ( 𝑥 ) ∪¬ 𝑙𝑖𝑘𝑒𝑠 ( 𝑥 , 𝑦 )


𝐸𝑞𝑢𝑎𝑡𝑖𝑜𝑛−3 𝑐𝑎𝑡 (𝑀𝑎𝑛𝑜)
𝑅𝑒𝑚𝑎𝑖𝑛𝑖𝑛𝑔 𝑃𝑎𝑟𝑡 ¬𝑙𝑖𝑘𝑒𝑠 ( 𝑥 , 𝑦 )
𝐸𝑞𝑢𝑎𝑡𝑖𝑜𝑛−3 ¬𝑐𝑎𝑡 ( 𝑥 ) ∪𝑙𝑖𝑘𝑒𝑠(𝑥 , 𝑓𝑖𝑠h )
𝑅𝑒𝑚𝑎𝑖𝑛𝑖𝑛𝑔 𝑃𝑎𝑟𝑡 ¬𝑐𝑎𝑡 ( 𝑥 )

𝐻𝑒𝑛𝑐𝑒 Mano eats fish

Dept. of Information Sciences, University of Education, Lahore

You might also like