SlideShare a Scribd company logo
Logical Agents 
Chapter 7
Outline 
• Knowledge-based agents 
• Logic in general 
• Propositional (Boolean) logic 
• Equivalence, validity, satisfiability
Knowledge bases 
• Knowledge base = set of sentences in a formal language 
• Declarative approach to building an agent (or other system): 
– Tell it what it needs to know 
• Then it can Ask itself what to do - answers should follow from the 
KB 
• Agents can be viewed at the knowledge level 
i.e., what they know, regardless of how implemented 
• Or at the implementation level 
– i.e., data structures in KB and algorithms that manipulate them 
–– 
»
A simple knowledge-based agent 
• The agent must be able to: 
– Represent states, actions, etc. 
– Incorporate new percepts 
– Deduce appropriate actions 
–– 
Update internal representations of the world 
– Deduce hidden properties of the world 
–
Logic in general 
• Logics are formal languages for representing information 
such that conclusions can be drawn 
• Syntax defines the sentences in the language 
• Semantics define the "meaning" of sentences; 
– i.e., define truth of a sentence in a world 
• E.g., the language of arithmetic 
– x+2 ≥ y is true iff the number x+2 is no less than the number y 
– x+2 ≥ y is true in a world where x = 7, y = 1 
– x+2 ≥ y is false in a world where x = 0, y = 6 
– 
– 
»x+2 ≥ y is a sentence; x2+y > {} is not 
a sentence
Propositional logic: Syntax 
• Propositional logic is the simplest logic – illustrates 
basic ideas 
• The proposition symbols P1, P2 etc are sentences 
– If S is a sentence, ØS is a sentence (negation) 
– If S1 and S2 are sentences, S1 Ù S2 is a sentence (conjunction) 
– If S1 and S2 are sentences, S1 Ú S2 is a sentence (disjunction) 
– If S1 and S2 are sentences, S1 Þ S2 is a sentence (implication) 
– If S1 and S2 are sentences, S1 Û S2 is a sentence (biconditional) 
––––
Propositional logic: Semantics 
Each model specifies true/false for each proposition symbol 
E.g. P1,2 P2,2 P3,1 
false true false 
With these symbols, 8 possible models, can be enumerated automatically. 
Rules for evaluating truth with respect to a model m: 
ØS is true iff S is false 
S1 Ù S2 is true iff S1 is true and S2 is true 
S1 Ú S2 is true iff S1is true or S2 is true 
S1 Þ S2 is true iff S1 is false or S2 is true 
i.e., is false iff S1 is true and S2 is false 
S1 Û S2 is true iff S1ÞS2 is true andS2ÞS1 is true 
Simple recursive process evaluates an arbitrary sentence, e.g., 
ØP1,2 Ù (P2,2 Ú P3,1) = true Ù (true Ú false) = true Ù true = true
Truth tables for connectives
Wumpus world sentences 
Let Pi,j be true if there is a pit in [i, j]. 
Let Bi,j be true if there is a breeze in [i, j]. 
Ø P1,1 
ØB1,1 
B2,1 
• "Pits cause breezes in adjacent squares" 
B1,1 Û (P1,2 Ú P2,1) 
B2,1 Û (P1,1 Ú P2,2 Ú P3,1) 
»
Truth tables for inference
Logical equivalence 
• Two sentences are logically equivalent} iff true in same 
models: α ≡ ß iff α╞ β and β╞ α 
• 
•
Validity and satisfiability 
A sentence is valid if it is true in all models, 
e.g., True, A ÚØA, A Þ A, (A Ù (A Þ B)) Þ B 
Validity is connected to inference via the Deduction Theorem: 
KB ╞ α if and only if (KB Þ α) is valid 
A sentence is satisfiable if it is true in some model 
e.g., AÚ B, C 
A sentence is unsatisfiable if it is true in no models 
e.g., AÙØA 
Satisfiability is connected to inference via the following: 
KB ╞ α if and only if (KB ÙØα) is unsatisfiable 
–––
Summary 
• Logical agents apply inference to a knowledge base to derive new 
information and make decisions 
• Basic concepts of logic: 
– syntax: formal structure of sentences 
– semantics: truth of sentences wrt models 
– entailment: necessary truth of one sentence given another 
– inference: deriving sentences from other sentences 
– soundness: derivations produce only entailed sentences 
– completeness: derivations can produce all entailed sentences 
• Wumpus world requires the ability to represent partial and negated 
information, reason by cases, etc. 
• Resolution is complete for propositional logic 
Forward, backward chaining are linear-time, complete for Horn 
clauses 
• Propositional logic lacks expressive power 
• 
» 
–––––

More Related Content

PPTX
Predicate logic
PPTX
Propositional logic & inference
PPT
Predicate calculus
PPTX
Knnowledge representation and logic lec 11 to lec 15
PDF
AI Lesson 11
PDF
AI Lesson 09
PDF
Artificial intelligence and first order logic
PPT
Predicate logic_2(Artificial Intelligence)
Predicate logic
Propositional logic & inference
Predicate calculus
Knnowledge representation and logic lec 11 to lec 15
AI Lesson 11
AI Lesson 09
Artificial intelligence and first order logic
Predicate logic_2(Artificial Intelligence)

What's hot (19)

PPTX
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
PPT
L03 ai - knowledge representation using logic
PPTX
Artificial intelligence- Logic Agents
PDF
Cs6503 theory of computation book notes
PPTX
Knowledge representation and Predicate logic
PPTX
Statistical machine translation
PDF
Theory of Computation Lecture Notes
PDF
Logic programming (1)
PDF
Ai lecture 07(unit03)
PPTX
Kr using rules
PPTX
Linguistic variable
PDF
Ai lecture 10(unit03)
PDF
First order logic
PPT
Introduction iii
DOC
Chapter 4 (final)
PPTX
First order predicate logic(fopl)
PPTX
Jarrar: Description Logic
PPT
Predicate Logic
Artificial Intelligence (AI) | Prepositional logic (PL)and first order predic...
L03 ai - knowledge representation using logic
Artificial intelligence- Logic Agents
Cs6503 theory of computation book notes
Knowledge representation and Predicate logic
Statistical machine translation
Theory of Computation Lecture Notes
Logic programming (1)
Ai lecture 07(unit03)
Kr using rules
Linguistic variable
Ai lecture 10(unit03)
First order logic
Introduction iii
Chapter 4 (final)
First order predicate logic(fopl)
Jarrar: Description Logic
Predicate Logic
Ad

Similar to Logic (20)

PPT
AI-Unit4.ppt
PPT
Logic agent
PPT
Jarrar.lecture notes.aai.2011s.ch7.p logic
PDF
Lecture 4 representation with logic
PPT
Propositional Logic in Artificial Intelligence
PPT
Propositional and first-order logic different chapters
PPT
Logical Agents
PPTX
PPT
PropositionalLogic.ppt
PPT
Propositional Logic for discrete structures
PPT
Propositional Logic, Truth Table, Compound Proposition
PPT
m7-logic.ppt
PPT
Logic.ppt
PPTX
Jarrar: Introduction to logic and Logic Agents
PPT
wumpus world in artifial intelligence and machine learning
PDF
Knowledge based agent
PPT
Propositional and first order logic - AI
PPT
10a.ppt
PPT
AI Lecture 6 (logical agents)
PDF
Knowledge base artificial intelligence.pdf
AI-Unit4.ppt
Logic agent
Jarrar.lecture notes.aai.2011s.ch7.p logic
Lecture 4 representation with logic
Propositional Logic in Artificial Intelligence
Propositional and first-order logic different chapters
Logical Agents
PropositionalLogic.ppt
Propositional Logic for discrete structures
Propositional Logic, Truth Table, Compound Proposition
m7-logic.ppt
Logic.ppt
Jarrar: Introduction to logic and Logic Agents
wumpus world in artifial intelligence and machine learning
Knowledge based agent
Propositional and first order logic - AI
10a.ppt
AI Lecture 6 (logical agents)
Knowledge base artificial intelligence.pdf
Ad

More from Yasir Khan (20)

PPT
Lecture 6
PPT
Lecture 4
PPT
Lecture 3
PPT
Lecture 2
PPT
Lec#1
PPT
Ch10 (1)
PPT
PPT
PPT
Snooping protocols 3
PPT
Snooping 2
PPT
Introduction 1
PPT
Hpc sys
PPTX
Hpc 6 7
PPTX
Hpc 4 5
PPTX
Hpc 3
PPTX
Hpc 2
PPTX
Hpc 1
PPT
Flynns classification
PPT
Dir based imp_5
PPT
Natural Language Processing
Lecture 6
Lecture 4
Lecture 3
Lecture 2
Lec#1
Ch10 (1)
Snooping protocols 3
Snooping 2
Introduction 1
Hpc sys
Hpc 6 7
Hpc 4 5
Hpc 3
Hpc 2
Hpc 1
Flynns classification
Dir based imp_5
Natural Language Processing

Logic

  • 2. Outline • Knowledge-based agents • Logic in general • Propositional (Boolean) logic • Equivalence, validity, satisfiability
  • 3. Knowledge bases • Knowledge base = set of sentences in a formal language • Declarative approach to building an agent (or other system): – Tell it what it needs to know • Then it can Ask itself what to do - answers should follow from the KB • Agents can be viewed at the knowledge level i.e., what they know, regardless of how implemented • Or at the implementation level – i.e., data structures in KB and algorithms that manipulate them –– »
  • 4. A simple knowledge-based agent • The agent must be able to: – Represent states, actions, etc. – Incorporate new percepts – Deduce appropriate actions –– Update internal representations of the world – Deduce hidden properties of the world –
  • 5. Logic in general • Logics are formal languages for representing information such that conclusions can be drawn • Syntax defines the sentences in the language • Semantics define the "meaning" of sentences; – i.e., define truth of a sentence in a world • E.g., the language of arithmetic – x+2 ≥ y is true iff the number x+2 is no less than the number y – x+2 ≥ y is true in a world where x = 7, y = 1 – x+2 ≥ y is false in a world where x = 0, y = 6 – – »x+2 ≥ y is a sentence; x2+y > {} is not a sentence
  • 6. Propositional logic: Syntax • Propositional logic is the simplest logic – illustrates basic ideas • The proposition symbols P1, P2 etc are sentences – If S is a sentence, ØS is a sentence (negation) – If S1 and S2 are sentences, S1 Ù S2 is a sentence (conjunction) – If S1 and S2 are sentences, S1 Ú S2 is a sentence (disjunction) – If S1 and S2 are sentences, S1 Þ S2 is a sentence (implication) – If S1 and S2 are sentences, S1 Û S2 is a sentence (biconditional) ––––
  • 7. Propositional logic: Semantics Each model specifies true/false for each proposition symbol E.g. P1,2 P2,2 P3,1 false true false With these symbols, 8 possible models, can be enumerated automatically. Rules for evaluating truth with respect to a model m: ØS is true iff S is false S1 Ù S2 is true iff S1 is true and S2 is true S1 Ú S2 is true iff S1is true or S2 is true S1 Þ S2 is true iff S1 is false or S2 is true i.e., is false iff S1 is true and S2 is false S1 Û S2 is true iff S1ÞS2 is true andS2ÞS1 is true Simple recursive process evaluates an arbitrary sentence, e.g., ØP1,2 Ù (P2,2 Ú P3,1) = true Ù (true Ú false) = true Ù true = true
  • 8. Truth tables for connectives
  • 9. Wumpus world sentences Let Pi,j be true if there is a pit in [i, j]. Let Bi,j be true if there is a breeze in [i, j]. Ø P1,1 ØB1,1 B2,1 • "Pits cause breezes in adjacent squares" B1,1 Û (P1,2 Ú P2,1) B2,1 Û (P1,1 Ú P2,2 Ú P3,1) »
  • 10. Truth tables for inference
  • 11. Logical equivalence • Two sentences are logically equivalent} iff true in same models: α ≡ ß iff α╞ β and β╞ α • •
  • 12. Validity and satisfiability A sentence is valid if it is true in all models, e.g., True, A ÚØA, A Þ A, (A Ù (A Þ B)) Þ B Validity is connected to inference via the Deduction Theorem: KB ╞ α if and only if (KB Þ α) is valid A sentence is satisfiable if it is true in some model e.g., AÚ B, C A sentence is unsatisfiable if it is true in no models e.g., AÙØA Satisfiability is connected to inference via the following: KB ╞ α if and only if (KB ÙØα) is unsatisfiable –––
  • 13. Summary • Logical agents apply inference to a knowledge base to derive new information and make decisions • Basic concepts of logic: – syntax: formal structure of sentences – semantics: truth of sentences wrt models – entailment: necessary truth of one sentence given another – inference: deriving sentences from other sentences – soundness: derivations produce only entailed sentences – completeness: derivations can produce all entailed sentences • Wumpus world requires the ability to represent partial and negated information, reason by cases, etc. • Resolution is complete for propositional logic Forward, backward chaining are linear-time, complete for Horn clauses • Propositional logic lacks expressive power • » –––––