SlideShare una empresa de Scribd logo
1 de 31
Knowledge Representation
 using First-Order Logic
Domain
• Domain is a section of the knowledge
  representation.
     - The Kinship domain
     - Mathematical sets
     - Assertions and queries in first order logic
     - The Wumpus World
Kinship domain
Kinship domain(family relationship)
It consists of
• Object – People
• Unary Predicates - Male and Female
• Binary Predicates - Parent,Brother,Sister
• Functions – Father, Mother
• Relations – Brotherhood, sisterhood.
Examples
The kinship domain:
• Brothers are siblings
  ∀x,y Brother(x,y) => Sibling(x,y)


• Male and female are disjoint categories
  ∀x, Male(x) ⇔ ¬Female(x)


• Parent and child are inverse relations
  ∀p,c Parent(p,c) ⇔ Child(c,p)
Mathematical sets
Mathematical set representation
• Constant – Empty set (s = {})
• Predicate – Member and subset (s1 ⊆ s2)
• Functions – Intersection( ∩ ) and union (∪ )

•   Example: Two sets are equal if and only if each is a subset of the
    other.
 ∀s1,s2 (s1=s2) ⇔(subset(s1,s2) ∧ subset(s2,s1))
Other eg:
 ∀x,s1,s2 x ∈ (s1 ∩ s2) ⇔ (x ∈ s1 ∧ x ∈ s2)
 ∀x,s1,s2 x ∈ (s1 ∪ s2) ⇔ (x ∈ s1 ∨ x ∈ s2)
Assertions and Queries in
     first-order logic
Assertions
• Sentences are added to a knowledge base
  using TELL are called assertions.
• We want to TELL things to the KB,
   e.g. TELL(KB, King(John))
        TELL(KB, ∀ x king(x) => Person(x))
        John is a king and that king is a person.
Queries
• Questions are asked to the knowledge base
  using ASK called as queries or goals.
• We also want to ASK things to the KB,
  ASK(KB, ∃x , Person (x ) )

      returns true by substituting john to a x.
Wumpus world
Agent Architectures
• Reflex agents: Classify their percept and act
  accordingly.
• Model based agents: Construct an internal
  representation of the world and use it to act.
• Goal based agent : Form goals and try to
  achieve them.
FOL Version of Wumpus World
• Typical percept sentence:
  Percept([Stench,Breeze,Glitter,None,None],3)

• In this sentence:
  Percept - predicate
  Stench, Breeze and glitter – Constants
  3 – Integer to represent time

• Actions:
  Turn Right), Turn Left), Forward, Shoot, Grab, Release,
  Climb
Cont..,
• To determine best action, construct query:
  ∀ a BestAction(a,5)

• ASK solves this query and returns {a/Grab}
   – Agent program then calls TELL to record the action
     which was taken to update the KB.
• Percept sequences
    1. Synchronic sentences (same time).
           - sentences dealing with time.
    2. Diachronic sentences (across time).
            - agent needs to know how to
  combine information about its previous
  location to current location.
Two kinds of synchronic rules
  1.Diagnostic rules
  2.Casual rules
Deducing hidden properties
• Squares are breezy near a pit:
  – Diagnostic rule---infer cause from effect
     ∀s Breezy(s) ⇔ ∃ r Adjacent(r,s) ∧ Pit(r)


  – Causal rule---infer effect from cause
  ∀r Pit(r) ⇒ [∀s Adjacent(r,s) ⇒ Breezy(s)]
Knowledge engineering in
         FOL
Steps
1. Identify the task

3. Assemble the relevant knowledge

5. Decide on a vocabulary of predicates, functions, and
   constants

7. Encode general knowledge about the domain

9. Encode a description of the specific problem instance

11. Pose queries to the inference procedure and get
    answers

13. Debug the knowledge base
The electronic circuits domain
One-bit full adder




Possible queries:
  - does the circuit function properly?
  - what gates are connected to the first input terminal?
  - what would happen if one of the gates is broken?
  and so on
The electronic circuits domain
1. Identify the task
   – Does the circuit actually add properly?

2. Assemble the relevant knowledge
   – Composed of wires and gates; Types of gates (AND,
     OR, XOR, NOT)
   – Two input terminals and one output terminal
3. Decide on a vocabulary

•     Alternatives:
     Type(X1) = XOR (function)
     Type(X1, XOR) (binary predicate)
     XOR(X1) (unary predicate)

        It can be represented by either
    binary predicate or individual type.
4. Encode general knowledge of the
             domain
 1.If two terminals are connected, then they have
the same signal.

 ∀t1,t2 Connected(t1, t2) ⇒ Signal(t1) = Signal(t2)

2.The signal at every terminal is either 1 or 0
  (but not both)

 ∀t Signal(t) = 1 ∨ Signal(t) = 0

  1≠0
3. Connected is a commutative predicate.

  ∀t1,t2 Connected(t1, t2) ⇒ Connected(t2, t1)




4. An OR gate’s output is 1 if and only if any of its input is 1.

   ∀g Type(g) = OR ⇒
   Signal(Out(1,g)) = 1 ⇔ ∃n Signal(In(n,g)) = 1
5. An AND gate’s output is 0 if and only if any of its
  input is 0.
   ∀g Type(g) = AND ⇒
   Signal(Out(1,g)) = 0 ⇔ ∃n Signal(In(n,g)) = 0

6. An XOR gate’s output is 1 if and only if any of its
  inputs are different:
   ∀g Type(g) = XOR ⇒Signal(Out(1,g)) = 1 ⇔
     Signal(In(1,g)) ≠ Signal(In(2,g))
7. An XOR gate’s output is 1 if and only if any of its
  inputs are different:
      ∀g Type(g) = NOT ⇒
   Signal(Out(1,g)) ≠ Signal(In(1,g))
5. Encode the specific problem
                instance
• First we categorize the gates:



  Type(X1) = XOR             Type(X2) = XOR
  Type(A1) = AND             Type(A2) = AND
  Type(O1) = OR

  – Then show the connections between them:
Connected(Out(1,X1),In(1,X2))
 Connected(In(1,C1),In(1,X1))
Connected(Out(1,X1),In(2,A2))
 Connected(In(1,C1),In(1,A1))
Connected(Out(1,A2),In(1,O1))
 Connected(In(2,C1),In(2,X1))
Connected(Out(1,A1),In(2,O1))
 Connected(In(2,C1),In(2,A1))
Connected(Out(1,X2),Out(1,C1))
 Connected(In(3,C1),In(2,X2))
Connected(Out(1,O1),Out(2,C1))
 Connected(In(3,C1),In(1,A2))
6. Pose queries to the inference
   procedure and get answers


     For the given query the inference
procedure operate on the problem
specific facts and derive the answers.
What are the possible sets of values of all the
 terminals for the adder circuit?

∃i1,i2,i3,o1,o2 Signal(In(1,C1)) =
        i1 ∧ Signal(In(2,C1)) = i2 ∧ Signal(In(3,C1)) = i3 ∧
Signal(Out(1,C1)) = o1 ∧ Signal(Out(2,C1)) = o2
7. Debug the knowledge base

• For the given query, if the result is not a
  user expected one then KB is updated
  with relevant axioms.
• The KB is checked with different
  constraints.eg:prove any output for the
  circuit i.e.,0 or 1.

Más contenido relacionado

La actualidad más candente

Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceRamla Sheikh
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolutionAmar Jukuntla
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & ReasoningSajid Marwat
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agentsMegha Sharma
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)SHUBHAM KUMAR GUPTA
 
Unit4: Knowledge Representation
Unit4: Knowledge RepresentationUnit4: Knowledge Representation
Unit4: Knowledge RepresentationTekendra Nath Yogi
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rulesHarini Balamurugan
 
Resolution,forward backward chaining
Resolution,forward backward chainingResolution,forward backward chaining
Resolution,forward backward chainingAnn Rose
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AIVishal Singh
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplicationRespa Peter
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicVishal Tandel
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
Artificial intelligence Prolog Language
Artificial intelligence Prolog LanguageArtificial intelligence Prolog Language
Artificial intelligence Prolog LanguageREHMAT ULLAH
 

La actualidad más candente (20)

Knowledge representation In Artificial Intelligence
Knowledge representation In Artificial IntelligenceKnowledge representation In Artificial Intelligence
Knowledge representation In Artificial Intelligence
 
First order logic
First order logicFirst order logic
First order logic
 
First Order Logic resolution
First Order Logic resolutionFirst Order Logic resolution
First Order Logic resolution
 
Knowledge Representation & Reasoning
Knowledge Representation & ReasoningKnowledge Representation & Reasoning
Knowledge Representation & Reasoning
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
Fuzzy arithmetic
Fuzzy arithmeticFuzzy arithmetic
Fuzzy arithmetic
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
Fuzzy logic
Fuzzy logicFuzzy logic
Fuzzy logic
 
Unit4: Knowledge Representation
Unit4: Knowledge RepresentationUnit4: Knowledge Representation
Unit4: Knowledge Representation
 
knowledge representation using rules
knowledge representation using rulesknowledge representation using rules
knowledge representation using rules
 
Resolution,forward backward chaining
Resolution,forward backward chainingResolution,forward backward chaining
Resolution,forward backward chaining
 
Fuzzy Membership Function
Fuzzy Membership Function Fuzzy Membership Function
Fuzzy Membership Function
 
Prolog basics
Prolog basicsProlog basics
Prolog basics
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Knowledge representation in AI
Knowledge representation in AIKnowledge representation in AI
Knowledge representation in AI
 
Matrix chain multiplication
Matrix chain multiplicationMatrix chain multiplication
Matrix chain multiplication
 
Introduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in LogicIntroduction on Prolog - Programming in Logic
Introduction on Prolog - Programming in Logic
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Artificial intelligence Prolog Language
Artificial intelligence Prolog LanguageArtificial intelligence Prolog Language
Artificial intelligence Prolog Language
 

Destacado

Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchchandsek666
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 
Class first order logic
Class first order logicClass first order logic
Class first order logicchandsek666
 
Introduction iii
Introduction iiiIntroduction iii
Introduction iiichandsek666
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed SearchHema Kashyap
 
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
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsNuruzzaman Milon
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searchingLuigi Ceccaroni
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search StrategiesAmey Kerkar
 
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
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}FellowBuddy.com
 
مقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعيةمقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعيةمحمد طاهر الحميدي
 

Destacado (14)

Ch2 3-informed (heuristic) search
Ch2 3-informed (heuristic) searchCh2 3-informed (heuristic) search
Ch2 3-informed (heuristic) search
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Class first order logic
Class first order logicClass first order logic
Class first order logic
 
Introduction iii
Introduction iiiIntroduction iii
Introduction iii
 
Fol
FolFol
Fol
 
Lecture 11 Informed Search
Lecture 11 Informed SearchLecture 11 Informed Search
Lecture 11 Informed Search
 
Logic agent
Logic agentLogic agent
Logic agent
 
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
 
Artificial intelligence- Logic Agents
Artificial intelligence- Logic AgentsArtificial intelligence- Logic Agents
Artificial intelligence- Logic Agents
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
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
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
مقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعيةمقدمة في الشبكات العصبية الاصطناعية
مقدمة في الشبكات العصبية الاصطناعية
 

Similar a Knowledge Representation using First-Order Logic

Frstorder 9 sldes read
Frstorder 9 sldes readFrstorder 9 sldes read
Frstorder 9 sldes readYasir Khan
 
Topology Matters in Communication
Topology Matters in CommunicationTopology Matters in Communication
Topology Matters in Communicationcseiitgn
 
09 - 27 Jan - Recursion Part 1
09 - 27 Jan - Recursion Part 109 - 27 Jan - Recursion Part 1
09 - 27 Jan - Recursion Part 1Neeldhara Misra
 
An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)ananth
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAsst.prof M.Gokilavani
 
Abductive commonsense reasoning
Abductive commonsense reasoningAbductive commonsense reasoning
Abductive commonsense reasoningSan Kim
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues listsJames Wong
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
StacksqueueslistsFraboni Ec
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsYoung Alista
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsTony Nguyen
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues listsHarry Potter
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerJoshuaAgcopra
 
Recursive State Estimation AI for Robotics.pdf
Recursive State Estimation AI for Robotics.pdfRecursive State Estimation AI for Robotics.pdf
Recursive State Estimation AI for Robotics.pdff20220630
 

Similar a Knowledge Representation using First-Order Logic (20)

Frstorder 9 sldes read
Frstorder 9 sldes readFrstorder 9 sldes read
Frstorder 9 sldes read
 
Topology Matters in Communication
Topology Matters in CommunicationTopology Matters in Communication
Topology Matters in Communication
 
09 - 27 Jan - Recursion Part 1
09 - 27 Jan - Recursion Part 109 - 27 Jan - Recursion Part 1
09 - 27 Jan - Recursion Part 1
 
Q
QQ
Q
 
An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)
 
Understanding Reed-Solomon code
Understanding Reed-Solomon codeUnderstanding Reed-Solomon code
Understanding Reed-Solomon code
 
Ch01
Ch01Ch01
Ch01
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
Teknik Simulasi
Teknik SimulasiTeknik Simulasi
Teknik Simulasi
 
Abductive commonsense reasoning
Abductive commonsense reasoningAbductive commonsense reasoning
Abductive commonsense reasoning
 
Stack squeues lists
Stack squeues listsStack squeues lists
Stack squeues lists
 
Stacksqueueslists
StacksqueueslistsStacksqueueslists
Stacksqueueslists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Stacks queues lists
Stacks queues listsStacks queues lists
Stacks queues lists
 
Integral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewerIntegral Calculus Anti Derivatives reviewer
Integral Calculus Anti Derivatives reviewer
 
002.decision trees
002.decision trees002.decision trees
002.decision trees
 
1519 differentiation-integration-02
1519 differentiation-integration-021519 differentiation-integration-02
1519 differentiation-integration-02
 
Recursive State Estimation AI for Robotics.pdf
Recursive State Estimation AI for Robotics.pdfRecursive State Estimation AI for Robotics.pdf
Recursive State Estimation AI for Robotics.pdf
 

Último

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersChitralekhaTherkar
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 

Último (20)

Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Micromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of PowdersMicromeritics - Fundamental and Derived Properties of Powders
Micromeritics - Fundamental and Derived Properties of Powders
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 

Knowledge Representation using First-Order Logic

  • 1. Knowledge Representation using First-Order Logic
  • 2. Domain • Domain is a section of the knowledge representation. - The Kinship domain - Mathematical sets - Assertions and queries in first order logic - The Wumpus World
  • 4. Kinship domain(family relationship) It consists of • Object – People • Unary Predicates - Male and Female • Binary Predicates - Parent,Brother,Sister • Functions – Father, Mother • Relations – Brotherhood, sisterhood.
  • 5. Examples The kinship domain: • Brothers are siblings ∀x,y Brother(x,y) => Sibling(x,y) • Male and female are disjoint categories ∀x, Male(x) ⇔ ¬Female(x) • Parent and child are inverse relations ∀p,c Parent(p,c) ⇔ Child(c,p)
  • 7. Mathematical set representation • Constant – Empty set (s = {}) • Predicate – Member and subset (s1 ⊆ s2) • Functions – Intersection( ∩ ) and union (∪ ) • Example: Two sets are equal if and only if each is a subset of the other. ∀s1,s2 (s1=s2) ⇔(subset(s1,s2) ∧ subset(s2,s1)) Other eg: ∀x,s1,s2 x ∈ (s1 ∩ s2) ⇔ (x ∈ s1 ∧ x ∈ s2) ∀x,s1,s2 x ∈ (s1 ∪ s2) ⇔ (x ∈ s1 ∨ x ∈ s2)
  • 8. Assertions and Queries in first-order logic
  • 9. Assertions • Sentences are added to a knowledge base using TELL are called assertions. • We want to TELL things to the KB, e.g. TELL(KB, King(John)) TELL(KB, ∀ x king(x) => Person(x)) John is a king and that king is a person.
  • 10. Queries • Questions are asked to the knowledge base using ASK called as queries or goals. • We also want to ASK things to the KB, ASK(KB, ∃x , Person (x ) ) returns true by substituting john to a x.
  • 12. Agent Architectures • Reflex agents: Classify their percept and act accordingly. • Model based agents: Construct an internal representation of the world and use it to act. • Goal based agent : Form goals and try to achieve them.
  • 13. FOL Version of Wumpus World • Typical percept sentence: Percept([Stench,Breeze,Glitter,None,None],3) • In this sentence: Percept - predicate Stench, Breeze and glitter – Constants 3 – Integer to represent time • Actions: Turn Right), Turn Left), Forward, Shoot, Grab, Release, Climb
  • 14. Cont.., • To determine best action, construct query: ∀ a BestAction(a,5) • ASK solves this query and returns {a/Grab} – Agent program then calls TELL to record the action which was taken to update the KB.
  • 15. • Percept sequences 1. Synchronic sentences (same time). - sentences dealing with time. 2. Diachronic sentences (across time). - agent needs to know how to combine information about its previous location to current location.
  • 16. Two kinds of synchronic rules 1.Diagnostic rules 2.Casual rules
  • 17. Deducing hidden properties • Squares are breezy near a pit: – Diagnostic rule---infer cause from effect ∀s Breezy(s) ⇔ ∃ r Adjacent(r,s) ∧ Pit(r) – Causal rule---infer effect from cause ∀r Pit(r) ⇒ [∀s Adjacent(r,s) ⇒ Breezy(s)]
  • 19. Steps 1. Identify the task 3. Assemble the relevant knowledge 5. Decide on a vocabulary of predicates, functions, and constants 7. Encode general knowledge about the domain 9. Encode a description of the specific problem instance 11. Pose queries to the inference procedure and get answers 13. Debug the knowledge base
  • 20. The electronic circuits domain One-bit full adder Possible queries: - does the circuit function properly? - what gates are connected to the first input terminal? - what would happen if one of the gates is broken? and so on
  • 21. The electronic circuits domain 1. Identify the task – Does the circuit actually add properly? 2. Assemble the relevant knowledge – Composed of wires and gates; Types of gates (AND, OR, XOR, NOT) – Two input terminals and one output terminal
  • 22. 3. Decide on a vocabulary • Alternatives: Type(X1) = XOR (function) Type(X1, XOR) (binary predicate) XOR(X1) (unary predicate) It can be represented by either binary predicate or individual type.
  • 23. 4. Encode general knowledge of the domain 1.If two terminals are connected, then they have the same signal. ∀t1,t2 Connected(t1, t2) ⇒ Signal(t1) = Signal(t2) 2.The signal at every terminal is either 1 or 0 (but not both) ∀t Signal(t) = 1 ∨ Signal(t) = 0 1≠0
  • 24. 3. Connected is a commutative predicate. ∀t1,t2 Connected(t1, t2) ⇒ Connected(t2, t1) 4. An OR gate’s output is 1 if and only if any of its input is 1. ∀g Type(g) = OR ⇒ Signal(Out(1,g)) = 1 ⇔ ∃n Signal(In(n,g)) = 1
  • 25. 5. An AND gate’s output is 0 if and only if any of its input is 0. ∀g Type(g) = AND ⇒ Signal(Out(1,g)) = 0 ⇔ ∃n Signal(In(n,g)) = 0 6. An XOR gate’s output is 1 if and only if any of its inputs are different: ∀g Type(g) = XOR ⇒Signal(Out(1,g)) = 1 ⇔ Signal(In(1,g)) ≠ Signal(In(2,g))
  • 26. 7. An XOR gate’s output is 1 if and only if any of its inputs are different: ∀g Type(g) = NOT ⇒ Signal(Out(1,g)) ≠ Signal(In(1,g))
  • 27. 5. Encode the specific problem instance • First we categorize the gates: Type(X1) = XOR Type(X2) = XOR Type(A1) = AND Type(A2) = AND Type(O1) = OR – Then show the connections between them:
  • 28. Connected(Out(1,X1),In(1,X2)) Connected(In(1,C1),In(1,X1)) Connected(Out(1,X1),In(2,A2)) Connected(In(1,C1),In(1,A1)) Connected(Out(1,A2),In(1,O1)) Connected(In(2,C1),In(2,X1)) Connected(Out(1,A1),In(2,O1)) Connected(In(2,C1),In(2,A1)) Connected(Out(1,X2),Out(1,C1)) Connected(In(3,C1),In(2,X2)) Connected(Out(1,O1),Out(2,C1)) Connected(In(3,C1),In(1,A2))
  • 29. 6. Pose queries to the inference procedure and get answers For the given query the inference procedure operate on the problem specific facts and derive the answers.
  • 30. What are the possible sets of values of all the terminals for the adder circuit? ∃i1,i2,i3,o1,o2 Signal(In(1,C1)) = i1 ∧ Signal(In(2,C1)) = i2 ∧ Signal(In(3,C1)) = i3 ∧ Signal(Out(1,C1)) = o1 ∧ Signal(Out(2,C1)) = o2
  • 31. 7. Debug the knowledge base • For the given query, if the result is not a user expected one then KB is updated with relevant axioms. • The KB is checked with different constraints.eg:prove any output for the circuit i.e.,0 or 1.