0% found this document useful (0 votes)
4 views25 pages

Chap 3 Logical Agents

The document discusses logical agents, focusing on knowledge-based agents and the principles of propositional logic, including syntax, semantics, and reasoning. It uses the Wumpus World example to illustrate how agents represent states, incorporate perceptions, and deduce properties through logical inference. Key concepts covered include consequence relations, models, validity, satisfiability, and proof methods.

Uploaded by

Anwar Chouchane
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)
4 views25 pages

Chap 3 Logical Agents

The document discusses logical agents, focusing on knowledge-based agents and the principles of propositional logic, including syntax, semantics, and reasoning. It uses the Wumpus World example to illustrate how agents represent states, incorporate perceptions, and deduce properties through logical inference. Key concepts covered include consequence relations, models, validity, satisfiability, and proof methods.

Uploaded by

Anwar Chouchane
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/ 25

Logical Agents

Overview
• Knowledge-based agents
• General principles of logic
• Propositional logic
• Reasoning and proof in propositional logic
Knowledge-Based Agent Capabilities
1. Represent states
2. Incorporate new perceptions
3. Update internal world representation
4. Deduce hidden world properties
The Wumpus World Example
Performance measures:
- Gold: +1000
- Death: -1000

Environment:
- Agent starts at [1,1]
- Adjacent cells to the Wumpus smell bad
- Breeze in cells adjacent to pits
- Glow in cell with gold

Actions:
- Turn left, turn right, move forward, grab, shoot
Logical Principles
- Logic: formal language to represent and derive
conclusions
- Syntax: rules for well-formed sentences
- Semantics: meaning and truth of sentences
- Example:
- Syntax: 'x + y = 4' (correct), 'x4y+=' (incorrect)
- Semantics: 'x + y = 4' is true if x=1 and y=3.
Consequence relation

Consequence Relation: A statement logically follows from


another statement.
α⊨β
•α ⊨ β is true if and only if β is true in all worlds where α is
true.
• If α is true, then β must also be true.
• For example: (x + y = 4) ⊨ (x + y < 8)
•Knowledge base (KB) = Set of statements. A KB entails a
statement as a consequence:
KB ⊨ α
•The consequence relation is a relation between
statements based on semantics.
6
Models
•Logicians think in terms of models, which are structured worlds where the
truth or falsehood of each statement can be evaluated.
•m is a model of the statement α if α is true in m.
•M(α) is the set of all models of α.
•BC ⊨ α if and only if M(BC) ⊆ M(α).
The diagram shows a visual representation where M(BC) is a subset of M(α).

7
Consequence relation in the world of
Wumpus

•Situation after detecting nothing at


[1,1]:
•Turn right.
•Breeze at [2,1].
•Let us consider the possible models for
the cells marked with “?” by
considering only the pits:
•3 boolean choices ⇒ 2^3 = 8 possible
models.

8
Models of the Wumpus world

9
Models of the Wumpus world
• BC = Wumpus world rules + observations

10
Models of the Wumpus world
• BC = Wumpus world rules + observations
• α1 = "[1,2] is pit-free"

11
Models of the Wumpus world
• BC = Wumpus world rules + observations
• α1 = "[1,2] is pit-free“
• BC ⊨ α1, proven through model checking

12
Models of the Wumpus world

13
Propositional Logic
Syntax
- Propositional logic = very simple logic
- A statement is an atomic statement or a complex statement
- A propositional symbol is a proposition that can be true or false
(P, Q, R, ...)
- Atomic statements: a single propositional symbol, true or false.
- Also called a literal
- Complex statements:
- If E is a statement, -E is a statement (negation)
- If E1 and E2 are statements, E1 ∧ E2 is a statement
(conjunction)
- If E1 and E2 are statements, E1 ∨ E2 is a statement (disjunction)
- If E1 and E2 are statements, E1 → E2 is a statement
(implication)
- If E1 and E2 are statements, E1 ↔ E2 is a statement
(equivalence)
14
Propositional Logic
Semantic
A model assigns a truth value (true or false) to each propositional symbol.

With 3 propositional symbols P1, P2, and P3, there are 2^3 = 8 possible
models.

Rules for evaluating a statement based on a model m:


- -E is true if E is false, and vice versa
- E1 ∧ E2 is true if E1 is true and E2 is true
- E1 ∨ E2 is true if E1 is true or E2 is true
- E1 ⇒ E2 is true if E1 is false or E2 is true
- E1 ⇔ E2 is true if E1 and E2 have the same truth value

The evaluation of a statement can be done through a simple recursive process.

The formula ¬P1 ∧ (P2 ∨ P3) = true ∧ (false ∨ true) = true ∧ true = true
demonstrates this recursive evaluation.
15
Truth tables for logical connectors:

P Q ¬P P∧Q P∨Q P⇒Q P⇔Q


false false true false false true true
false true true false true true false
true false false false true false false
true true false true true true true

16
Knowledge base of the Wumpus world
Knowledge Base:
- P[i,j] is true if there is a pit in [i,j]
- B[i,j] is true if there is a breeze in [i,j]
- Breeze indicates the presence of pits in adjacent squares

Rules:
- R1: ¬P[1,1]
- R2: B[1,1] ⇔ (P[1,2] ∨ P[2,1])
- R3: B[2,1] ⇔ (P[1,1] ∨ P[2,2] ∨ P[3,1])
- R4: ¬B[1,1]
- R5: B[2,1]

BC: R1 ∧ R2 ∧ R3 ∧ R4 ∧ R5

17
Knowledge base of the Wumpus world

18
Properties of Inference by Enumeration

Enumeration in depth is valid and complete


For n symbols, the complexity is O(2^n)

19
Validity and satisfiability
A statement is valid if it is true in all models. We also say it is a
tautology.
Examples:
valid statements: A ∨ ¬A; A ⇒ A; ((A ∧ (A ⇒ B)) ⇒ B

Deduction Theorem:
BC ⊨ α if and only if BC ⇒ α is valid

A statement is satisfiable if it is true in certain models.


Examples: A ∨ B; C

A statement is unsatisfiable if it is not true in any model.


Example: A ∧ ¬A

Satisfiability: BC ⊨ α if and only if BC ∧ ¬α is unsatisfiable 20


Exercices
Exercice 1 :
Determine for each of the following statements whether they are valid, satisfiable, or
not. Verify your answer by referring to the associated truth table:
1.A ⇒ A
2.A ⇒ B
3.(A ⇒ B) ⇒ (¬B ⇒ ¬A)
4.A ∨ B ∨ ¬B
5.((A ∧ C) ⇒ B) ⇔ ((A ⇒ B) ∨ (C ⇒ B))

Exercice 2 :

Show these logical deductions using the enumeration of the truth table.

a) (A ∧ (A ⇒ B)) ⊢ B
b) ¬(A ⇒ A) ⊢ B
c) (A ∧ ¬A) ⊢ B

21
Proof methods
Proof methods are of three main types:
1.Model Checking
2.Truth Table Enumeration (always exponential
in nnn)
3.Application of Inference Rules
1.Generation of new statements from existing ones
2.Proof: a sequence of applications of inference
rules

22
Logical equivalence
• Two statements are logically equivalent if and only if they are true in the same
models:

23
Example of Proof

24
Conclusion
Logical agents apply inference on a knowledge base to deduce new
information and make decisions.

Basic concepts of logic:


• Syntax: formal structure of statements
• Semantics: truth of each statement in a model
• Consequence: necessary truth of a statement in relation to another
• Inference: derivation of new statements from old ones
• Validity: truth of a statement in all models
• Satisfiability: truth of a statement in some models

• Model Checking
• Truth Table Enumeration
• Application of Inference Rules

25

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy