SlideShare a Scribd company logo
1 of 43
UNIT-3

KNOWLEDGE REPRESENTATION




                           1
Agents that reason logically(Logical
agents)

•   A Knowledge based Agent
•   The Wumpus world environment
•   Representation, Reasoning and Logic
•   Logics – An Introduction
•   Propositional Logic
•   An Agent for the wumpus world – Propositional
    Logic




                                                    2
Abilities KB agent

• Agent must be able to:
   • Represent states and actions,
   • Incorporate new percepts
   • Update internal representation of the world
   • Deduce hidden properties of the world
   • Deduce appropriate actions




                                                   3
Agents that Reason Logically

• Logical agents have knowledge base, from
  which they draw conclusions
   • TELL: provide new facts to agent
   • ASK: decide on appropriate action




                                             4
Sample: Wumpus World

• Show original wumpus game
   • goal is to shoot wumpus
   • example of logical reasoning

• Our version:
  • Find gold, avoid wumpus, climb back out of
    cave




                                                 5
A Wumpus Agent

• Agent does not perceive its own location (unlike
  sample game), but it can keep track of where it
  has been
• Percepts:
   • Stench – wumpus is nearby
   • Breeze – pit is nearby
   • Glitter – gold is here
   • Bump – agent has just bumped against a wall
   • Scream – agent has heard another player die

                                                 6
Wumpus Agent

• Actuators:
   • Forward, Turn Left, Turn Right
   • Grab (gold)
   • Shoot (shoots arrow forward until hits
     wumpus or wall)
      • agent only has one arrow
   • Climb (exit the cave)
• Environment:
   • 4x4 grid, start at (1,1) facing right


                                              7
Wumpus Agent

• Death
  • Agent dies if it enters a pit or square with
    wumpus
• Goal: get gold and climb back out. Don’t die.
  • 1000 points for climbing out of cave with gold
  • 1 point penalty for each action taken
  • 10,000 point penalty for death




                                                 8
Some complex reasoning examples

• Start in (1,1)
   • Breeze in (1,2) and (2,1)
   • Probably a pit in (2,2)
• Smell in (1,1) – where can you go?
   • Pick a direction – shoot
   • Walk in that direction
   • Know where wumpus is




                                       9
Another example solution




No perception  1,2 and 2,1 OK   B in 2,1  2,2 or 3,1 P?
Move to 2,1                      1,1 V  no P in 1,1
                                 Move to 1,2 (only option)
                                                             10
Example solution




S and No S when in 2,1  1,3 or 1,2 has W
1,2 OK  1,3 W
No B in 1,2  2,2 OK & 3,1 P
                                            11
AI Models and Pr opositional
Logic
   •The Role of a Model
   •Represent The Environment
   •Assimilate Knowledge
   •Learning
   •Simulation
   •Inference



                                12
Models
• If we are going to create programs that
  are intelligent, then we need to figure out
  how to represent models

• They allow us to predict certain things
  about the future.




                                            13
The Role of a Model
• Represent the environment

• Provide a structure for the assimilation of
  new knowledge




                                                14
Represent The Environment

• Features in the environment must be
  represented as features in the model
• They should be able to act in the model just as
  they do in the environment
• Needs to be able to represent both long term
  qualities of the environment and short term
  states.




                                                    15
Assimilate Knowledge


• A model of the world allows an agent to
  organize new information in the context of
  what it already knows and draw
  conclusions.




                                               16
Learning
• An AI agent may start ready programmed
  with knowledge, or it may have to learn it
  from experience

• The model may change in response to
  new experiences.




                                           17
Simulation

• Simulate the real environment to test
  potential actions.
• The model needs to accept simulated
  sensory input and it needs to feed
  simulated actions back in without actually
  making those actions in reality
• It needs an imagination



                                           18
Inference

• Inference is the process of deriving a
  conclusion based on what is known




                                           19
Representation, Reasoning and logic




                                 20
Logic in general




                   21
Ontological and Epistemological Assumptions

•    ontological assumption :It is understood in connection to the
    logic of functioning of the agent.
      - question is: “What does the agent do?” This means discussing
    both what the agent is and what its behavior constitutes of.

• Epistemological assumptions: It consider the nature of
  knowledge.
    - question is: “On what knowledge does the agent base its
  actions?” It is important to discuss the origins of knowledge as well
  as concepts such as learning and memory.




                                                                       22
Types of logic




                 23
The use of logic

• A logic: formal language for representing information,
  rules for drawing conclusions
• Two kinds of logics:
• Propositional Logic
      • Represents facts
                           P∧Q ⇒ R
   • First Order Logic
      • Represents facts, objects, and relations

              ∀x Cat ( x) ⇒ Mammal ( x)



                                                           24
Entailment


 •   One thing follows from another
         KB |= α (knowledge base entails alpha)

 •   KB entails sentence α if and only if α is true in worlds where
     KB is true.
                            Ε.g. x+y=4 entails 4=x+y

 •   Entailment is a relationship between sentences that is based
     on semantics.




                                                                      25
Propositional Logic


• Represents facts as being either true or false
   • Formally represented by a letter, e.g. P or Q.
   • Actually refer to facts about the environment, e.g.
     the speed limit in town is 30mph
• Single facts can be combined into sentences using
  Boolean operators
• These sentences, if true, can become facts in the KB.
• A KB is said to entail a sentence if it is true in the
  KB



                                                       26
Logic consists of

•   Logical constants: true, false
•   Proposition symbols: P, Q, R, ...
•   Logical connectives: & (or ^), ∨, ¬, →, ↔
•   Parentheses: ( )
•   Propositional logic is an extremely simple
    representation




                                                 27
Basic symbols

• Expressions only evaluate to either “true” or “false.”




•   P           “P is true”
•   ¬P          “P is false”                             negation
•   PVQ         “either P is true or Q is true or both”  disjunction
•   P^Q         “both P and Q are true”                  conjunction
•   P => Q      “if P is true, the Q is true”            implication
•   PQ         “P and Q are either both true or both false” equivalence




                                                                     28
For example




              29
Syntax rules for propositional logic

• The constants true and false are propositions by
  themselves.

• A proposition symbol such as P or Q is a
  proposition by itself.

• Wrapping parentheses around a proposition
  produces proposition.




                                                     30
Ambiguity

The grammar can be ambiguous, for example:
   P & Q ∨ R.
It is best to use parentheses to eliminate ambiguity.
When ambiguity is present, we resolve it with
  operator precedence:
   (highest) : ¬ ,& ,∨ ,⇒ , ⇔ (lowest)
    For example: ¬P ∨ Q & R )⇒ S
   is equivalent to: ((¬ P) ∨ (Q & R)) ⇒ S



                                                    31
Limitations of Propositional Logic

1. It is too weak, i.e., has very limited expressiveness:
•   Each rule has to be represented for each situation:
    e.g., “don’t go forward if the wumpus is in front of you” takes 64 rules

2. It cannot keep track of changes:
• If one needs to track changes, e.g., where the agent has been before then
    we need a timed-version of each rule. To track 100 steps we’ll then need
    6400 rules for the previous example.


    Its hard to write and maintain such a huge rule-base
    Inference becomes intractable




                                                                               32
Inference
rules




            33
An Agent for the wumpus world – Propositional
Logic




                                            34
Example of using logic in Wumpus World

                             •   KB contains:




                                 ¬S1,1          ¬B1,1
                                 ¬S 2,1         B2,1
Stench
Agent
                                 S1, 2          ¬B1, 2
Start    Breeze
                                 ¬S 2 , 2       ¬B2, 2


                                                         35
KB also contains knowledge of environment

• No stench  no wumpus nearby

    R1 : ¬S1,1 ⇒ ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2,1
    R2 : ¬S 2,1 ⇒ ¬W1,1 ∧ ¬W2,1 ∧ ¬W2, 2 ∧ ¬W3,1
    R3 : ¬S1, 2 ⇒ ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2, 2 ∧ ¬W1,3
• Stench  wumpus nearby


      R4 : S1, 2 ⇒ W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3


                                                 36
We can determine where wumpus is!

• Method 1: Truth table
  • At least 14 symbols currently: S1,1, S2,1, S1,2, S2,2,
    W1,1, W2,1, W1,2, W2,2, W3,1, W1,3, B1,1, B2,1, B1,2, B2,2
    214 rows, ouch!




                                                            37
We can determine where wumpus is!

• Method 2: Inference
   • Modus Ponens

         R1 : ¬S1,1 ⇒ ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2,1
         ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2,1
   • And-Elimination


             ¬W1,1 ¬W1, 2 ¬W2,1



                                               38
Inference continued...

  • Modus Ponens and And-Elimination again:

     R2 : ¬S 2,1 ⇒ ¬W1,1 ∧ ¬W2,1 ∧ ¬W2, 2 ∧ ¬W3,1
     ¬W1,1 ¬W2,1 ¬W2, 2 ¬W3,1
  • One more Modus Ponens:


       R4 : S1, 2 ⇒ W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3
      W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3



                                                  39
Inference continued...

  • Unit Resolution:

                         W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3
                         ¬W1,1
                         W1, 2 ∨ W2, 2 ∨ W1,3
                         ¬W2, 2
                         W1, 2 ∨ W1,3
                         ¬W1, 2
                                   Wumpus is in (1,3)!!!
                         W1,3      Shoot it. Shoot where?
                                                     40
Determining action based on knowledge

      A1, 2 ∧ W1,3 ∧ Forward A ⇒ Shoot
      A1, 2 ∧ P ,3 ∧ Forward A ⇒ ¬Forward
               1

• Propositional logic cannot answer well the question
  “What action should I take?”
• It only answers “Should I take action X?”




                                                        41
Propositional logic seems inefficient

• Rule: “Shoot if the wumpus is in front of you”
   • 16 x 4 = 64 rules for the 4x4 grid
• Ditto for pits




                                                   42
First-order logic to the rescue

• Uses variables to represent generalities
• Can reduce rules significantly




                                             43

More Related Content

What's hot

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AIvikas dhakane
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular setsSampath Kumar S
 
First order predicate logic (fopl)
First order predicate logic (fopl)First order predicate logic (fopl)
First order predicate logic (fopl)chauhankapil
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prologHarry Potter
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemMohammad Imam Hossain
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithmMegha Sharma
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)Naman Joshi
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMvikas dhakane
 
LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxAkhilJoseph63
 
ProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) IntroductionProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) Introductionwahab khan
 
Reinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners TutorialReinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners TutorialOmar Enayet
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardAnimesh Chaturvedi
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmHema Kashyap
 

What's hot (20)

I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
Planning
PlanningPlanning
Planning
 
First order logic
First order logicFirst order logic
First order logic
 
1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets1.10. pumping lemma for regular sets
1.10. pumping lemma for regular sets
 
First order predicate logic (fopl)
First order predicate logic (fopl)First order predicate logic (fopl)
First order predicate logic (fopl)
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
 
03 Single layer Perception Classifier
03 Single layer Perception Classifier03 Single layer Perception Classifier
03 Single layer Perception Classifier
 
Unit7: Production System
Unit7: Production SystemUnit7: Production System
Unit7: Production System
 
Flat unit 3
Flat unit 3Flat unit 3
Flat unit 3
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
Finite automata(For college Seminars)
Finite automata(For college Seminars)Finite automata(For college Seminars)
Finite automata(For college Seminars)
 
I. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHMI. AO* SEARCH ALGORITHM
I. AO* SEARCH ALGORITHM
 
LINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptxLINEAR BOUNDED AUTOMATA (LBA).pptx
LINEAR BOUNDED AUTOMATA (LBA).pptx
 
ProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) IntroductionProLog (Artificial Intelligence) Introduction
ProLog (Artificial Intelligence) Introduction
 
Reinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners TutorialReinforcement Learning : A Beginners Tutorial
Reinforcement Learning : A Beginners Tutorial
 
P, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-HardP, NP, NP-Complete, and NP-Hard
P, NP, NP-Complete, and NP-Hard
 
TOC 5 | Regular Expressions
TOC 5 | Regular ExpressionsTOC 5 | Regular Expressions
TOC 5 | Regular Expressions
 
Lecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithmLecture 14 Heuristic Search-A star algorithm
Lecture 14 Heuristic Search-A star algorithm
 
Introduction to Prolog
Introduction to PrologIntroduction to Prolog
Introduction to Prolog
 

Viewers also liked

How expensive a logical agent is
How expensive a logical agent isHow expensive a logical agent is
How expensive a logical agent isRashmika Nawaratne
 
Logical Agents
Logical AgentsLogical Agents
Logical AgentsYasir Khan
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in folchandsek666
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsNuruzzaman Milon
 
Solving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) SearchSolving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) Searchmatele41
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchchandsek666
 
مقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعيةمقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعيةمحمد طاهر الحميدي
 

Viewers also liked (8)

Logical agent8910
Logical agent8910Logical agent8910
Logical agent8910
 
How expensive a logical agent is
How expensive a logical agent isHow expensive a logical agent is
How expensive a logical agent is
 
Logical Agents
Logical AgentsLogical Agents
Logical Agents
 
Knowledge engg using & in fol
Knowledge engg using & in folKnowledge engg using & in fol
Knowledge engg using & in fol
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
 
Solving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) SearchSolving problems by searching Informed (heuristics) Search
Solving problems by searching Informed (heuristics) Search
 
Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
 
مقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعيةمقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعية
 

Similar to Introduction iii

Knowledge based agent
Knowledge based agentKnowledge based agent
Knowledge based agentShiwani Gupta
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceGeetha Kannan
 
Knowledge and reasoning power point for engineering students
Knowledge and reasoning power point for engineering studentsKnowledge and reasoning power point for engineering students
Knowledge and reasoning power point for engineering studentsGeetha Kannan
 
08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptx08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptxMehwish Mehmood
 
Logic
LogicLogic
LogicH K
 
Lecture 4 representation with logic
Lecture 4   representation with logicLecture 4   representation with logic
Lecture 4 representation with logicVajira Thambawita
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logicAmey Kerkar
 
CS Artificial Intelligence chapter 4.pptx
CS Artificial Intelligence chapter 4.pptxCS Artificial Intelligence chapter 4.pptx
CS Artificial Intelligence chapter 4.pptxethiouniverse
 
Top school in delhi ncr
Top school in delhi ncrTop school in delhi ncr
Top school in delhi ncrEdhole.com
 
Interactive Proof Systems and An Introduction to PCP
Interactive Proof Systems and An Introduction to PCPInteractive Proof Systems and An Introduction to PCP
Interactive Proof Systems and An Introduction to PCPReza Rahimi
 
Logical reasoning 21.1.13
Logical reasoning 21.1.13Logical reasoning 21.1.13
Logical reasoning 21.1.13Slideshare
 
Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents Mustafa Jarrar
 

Similar to Introduction iii (20)

Knowledge based agent
Knowledge based agentKnowledge based agent
Knowledge based agent
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Knowledge and reasoning power point for engineering students
Knowledge and reasoning power point for engineering studentsKnowledge and reasoning power point for engineering students
Knowledge and reasoning power point for engineering students
 
Logic agent
Logic agentLogic agent
Logic agent
 
l4.pptx
l4.pptxl4.pptx
l4.pptx
 
m7-logic.ppt
m7-logic.pptm7-logic.ppt
m7-logic.ppt
 
AI-Unit4.ppt
AI-Unit4.pptAI-Unit4.ppt
AI-Unit4.ppt
 
08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptx08-Knowledge Based Agent.pptx
08-Knowledge Based Agent.pptx
 
Logic
LogicLogic
Logic
 
Lecture 4 representation with logic
Lecture 4   representation with logicLecture 4   representation with logic
Lecture 4 representation with logic
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
CS Artificial Intelligence chapter 4.pptx
CS Artificial Intelligence chapter 4.pptxCS Artificial Intelligence chapter 4.pptx
CS Artificial Intelligence chapter 4.pptx
 
Logic
LogicLogic
Logic
 
Top school in delhi ncr
Top school in delhi ncrTop school in delhi ncr
Top school in delhi ncr
 
u-3 ppt.pptx
u-3 ppt.pptxu-3 ppt.pptx
u-3 ppt.pptx
 
Unit-III.pptx
Unit-III.pptxUnit-III.pptx
Unit-III.pptx
 
Logic.ppt
Logic.pptLogic.ppt
Logic.ppt
 
Interactive Proof Systems and An Introduction to PCP
Interactive Proof Systems and An Introduction to PCPInteractive Proof Systems and An Introduction to PCP
Interactive Proof Systems and An Introduction to PCP
 
Logical reasoning 21.1.13
Logical reasoning 21.1.13Logical reasoning 21.1.13
Logical reasoning 21.1.13
 
Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents Jarrar: Introduction to logic and Logic Agents
Jarrar: Introduction to logic and Logic Agents
 

Recently uploaded

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docxPoojaSen20
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxVishalSingh1417
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 

Recently uploaded (20)

How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

Introduction iii

  • 2. Agents that reason logically(Logical agents) • A Knowledge based Agent • The Wumpus world environment • Representation, Reasoning and Logic • Logics – An Introduction • Propositional Logic • An Agent for the wumpus world – Propositional Logic 2
  • 3. Abilities KB agent • Agent must be able to: • Represent states and actions, • Incorporate new percepts • Update internal representation of the world • Deduce hidden properties of the world • Deduce appropriate actions 3
  • 4. Agents that Reason Logically • Logical agents have knowledge base, from which they draw conclusions • TELL: provide new facts to agent • ASK: decide on appropriate action 4
  • 5. Sample: Wumpus World • Show original wumpus game • goal is to shoot wumpus • example of logical reasoning • Our version: • Find gold, avoid wumpus, climb back out of cave 5
  • 6. A Wumpus Agent • Agent does not perceive its own location (unlike sample game), but it can keep track of where it has been • Percepts: • Stench – wumpus is nearby • Breeze – pit is nearby • Glitter – gold is here • Bump – agent has just bumped against a wall • Scream – agent has heard another player die 6
  • 7. Wumpus Agent • Actuators: • Forward, Turn Left, Turn Right • Grab (gold) • Shoot (shoots arrow forward until hits wumpus or wall) • agent only has one arrow • Climb (exit the cave) • Environment: • 4x4 grid, start at (1,1) facing right 7
  • 8. Wumpus Agent • Death • Agent dies if it enters a pit or square with wumpus • Goal: get gold and climb back out. Don’t die. • 1000 points for climbing out of cave with gold • 1 point penalty for each action taken • 10,000 point penalty for death 8
  • 9. Some complex reasoning examples • Start in (1,1) • Breeze in (1,2) and (2,1) • Probably a pit in (2,2) • Smell in (1,1) – where can you go? • Pick a direction – shoot • Walk in that direction • Know where wumpus is 9
  • 10. Another example solution No perception  1,2 and 2,1 OK B in 2,1  2,2 or 3,1 P? Move to 2,1 1,1 V  no P in 1,1 Move to 1,2 (only option) 10
  • 11. Example solution S and No S when in 2,1  1,3 or 1,2 has W 1,2 OK  1,3 W No B in 1,2  2,2 OK & 3,1 P 11
  • 12. AI Models and Pr opositional Logic •The Role of a Model •Represent The Environment •Assimilate Knowledge •Learning •Simulation •Inference 12
  • 13. Models • If we are going to create programs that are intelligent, then we need to figure out how to represent models • They allow us to predict certain things about the future. 13
  • 14. The Role of a Model • Represent the environment • Provide a structure for the assimilation of new knowledge 14
  • 15. Represent The Environment • Features in the environment must be represented as features in the model • They should be able to act in the model just as they do in the environment • Needs to be able to represent both long term qualities of the environment and short term states. 15
  • 16. Assimilate Knowledge • A model of the world allows an agent to organize new information in the context of what it already knows and draw conclusions. 16
  • 17. Learning • An AI agent may start ready programmed with knowledge, or it may have to learn it from experience • The model may change in response to new experiences. 17
  • 18. Simulation • Simulate the real environment to test potential actions. • The model needs to accept simulated sensory input and it needs to feed simulated actions back in without actually making those actions in reality • It needs an imagination 18
  • 19. Inference • Inference is the process of deriving a conclusion based on what is known 19
  • 22. Ontological and Epistemological Assumptions • ontological assumption :It is understood in connection to the logic of functioning of the agent. - question is: “What does the agent do?” This means discussing both what the agent is and what its behavior constitutes of. • Epistemological assumptions: It consider the nature of knowledge. - question is: “On what knowledge does the agent base its actions?” It is important to discuss the origins of knowledge as well as concepts such as learning and memory. 22
  • 24. The use of logic • A logic: formal language for representing information, rules for drawing conclusions • Two kinds of logics: • Propositional Logic • Represents facts P∧Q ⇒ R • First Order Logic • Represents facts, objects, and relations ∀x Cat ( x) ⇒ Mammal ( x) 24
  • 25. Entailment • One thing follows from another KB |= α (knowledge base entails alpha) • KB entails sentence α if and only if α is true in worlds where KB is true. Ε.g. x+y=4 entails 4=x+y • Entailment is a relationship between sentences that is based on semantics. 25
  • 26. Propositional Logic • Represents facts as being either true or false • Formally represented by a letter, e.g. P or Q. • Actually refer to facts about the environment, e.g. the speed limit in town is 30mph • Single facts can be combined into sentences using Boolean operators • These sentences, if true, can become facts in the KB. • A KB is said to entail a sentence if it is true in the KB 26
  • 27. Logic consists of • Logical constants: true, false • Proposition symbols: P, Q, R, ... • Logical connectives: & (or ^), ∨, ¬, →, ↔ • Parentheses: ( ) • Propositional logic is an extremely simple representation 27
  • 28. Basic symbols • Expressions only evaluate to either “true” or “false.” • P “P is true” • ¬P “P is false” negation • PVQ “either P is true or Q is true or both” disjunction • P^Q “both P and Q are true” conjunction • P => Q “if P is true, the Q is true” implication • PQ “P and Q are either both true or both false” equivalence 28
  • 30. Syntax rules for propositional logic • The constants true and false are propositions by themselves. • A proposition symbol such as P or Q is a proposition by itself. • Wrapping parentheses around a proposition produces proposition. 30
  • 31. Ambiguity The grammar can be ambiguous, for example: P & Q ∨ R. It is best to use parentheses to eliminate ambiguity. When ambiguity is present, we resolve it with operator precedence: (highest) : ¬ ,& ,∨ ,⇒ , ⇔ (lowest) For example: ¬P ∨ Q & R )⇒ S is equivalent to: ((¬ P) ∨ (Q & R)) ⇒ S 31
  • 32. Limitations of Propositional Logic 1. It is too weak, i.e., has very limited expressiveness: • Each rule has to be represented for each situation: e.g., “don’t go forward if the wumpus is in front of you” takes 64 rules 2. It cannot keep track of changes: • If one needs to track changes, e.g., where the agent has been before then we need a timed-version of each rule. To track 100 steps we’ll then need 6400 rules for the previous example. Its hard to write and maintain such a huge rule-base Inference becomes intractable 32
  • 34. An Agent for the wumpus world – Propositional Logic 34
  • 35. Example of using logic in Wumpus World • KB contains: ¬S1,1 ¬B1,1 ¬S 2,1 B2,1 Stench Agent S1, 2 ¬B1, 2 Start Breeze ¬S 2 , 2 ¬B2, 2 35
  • 36. KB also contains knowledge of environment • No stench  no wumpus nearby R1 : ¬S1,1 ⇒ ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2,1 R2 : ¬S 2,1 ⇒ ¬W1,1 ∧ ¬W2,1 ∧ ¬W2, 2 ∧ ¬W3,1 R3 : ¬S1, 2 ⇒ ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2, 2 ∧ ¬W1,3 • Stench  wumpus nearby R4 : S1, 2 ⇒ W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3 36
  • 37. We can determine where wumpus is! • Method 1: Truth table • At least 14 symbols currently: S1,1, S2,1, S1,2, S2,2, W1,1, W2,1, W1,2, W2,2, W3,1, W1,3, B1,1, B2,1, B1,2, B2,2  214 rows, ouch! 37
  • 38. We can determine where wumpus is! • Method 2: Inference • Modus Ponens R1 : ¬S1,1 ⇒ ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2,1 ¬W1,1 ∧ ¬W1, 2 ∧ ¬W2,1 • And-Elimination ¬W1,1 ¬W1, 2 ¬W2,1 38
  • 39. Inference continued... • Modus Ponens and And-Elimination again: R2 : ¬S 2,1 ⇒ ¬W1,1 ∧ ¬W2,1 ∧ ¬W2, 2 ∧ ¬W3,1 ¬W1,1 ¬W2,1 ¬W2, 2 ¬W3,1 • One more Modus Ponens: R4 : S1, 2 ⇒ W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3 W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3 39
  • 40. Inference continued... • Unit Resolution: W1,1 ∨ W1, 2 ∨ W2, 2 ∨ W1,3 ¬W1,1 W1, 2 ∨ W2, 2 ∨ W1,3 ¬W2, 2 W1, 2 ∨ W1,3 ¬W1, 2 Wumpus is in (1,3)!!! W1,3 Shoot it. Shoot where? 40
  • 41. Determining action based on knowledge A1, 2 ∧ W1,3 ∧ Forward A ⇒ Shoot A1, 2 ∧ P ,3 ∧ Forward A ⇒ ¬Forward 1 • Propositional logic cannot answer well the question “What action should I take?” • It only answers “Should I take action X?” 41
  • 42. Propositional logic seems inefficient • Rule: “Shoot if the wumpus is in front of you” • 16 x 4 = 64 rules for the 4x4 grid • Ditto for pits 42
  • 43. First-order logic to the rescue • Uses variables to represent generalities • Can reduce rules significantly 43