0% found this document useful (0 votes)
8 views22 pages

Week 8a

The document outlines the course structure for CZ3005 Artificial Intelligence, focusing on logical agents and knowledge-based systems. It includes a detailed schedule of topics, such as propositional logic, first-order logic, and fuzzy logic, along with the importance of logic in AI development. The content emphasizes the role of knowledge representation and inference in enabling intelligent agents to make informed decisions.

Uploaded by

Tom Riddle
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)
8 views22 pages

Week 8a

The document outlines the course structure for CZ3005 Artificial Intelligence, focusing on logical agents and knowledge-based systems. It includes a detailed schedule of topics, such as propositional logic, first-order logic, and fuzzy logic, along with the importance of logic in AI development. The content emphasizes the role of knowledge representation and inference in enabling intelligent agents to make informed decisions.

Uploaded by

Tom Riddle
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

CZ3005 Artificial Intelligence

Week 8a – Logical Agent

Yu Han

[Link]@[Link]

Associate Professor
College of Computing and Data Science (CCDS)
Nanyang Technological University (NTU)
Singapore
Second Half Lecturer

Associate Professor Yu Han

• Email: [Link]@[Link]

• Office: S3-B2c-94

• Website: [Link]

2
Course Overview (2nd Half)
Week Date Venue Topic Tutorial Lab

8 10/03/2026 LT1A Logical Agent (a)

8 13/03/2026 LT1 Logical Agent (b)

9 17/03/2026 LT1A Propositional Logic (a)

9 20/03/2026 LT1 Propositional Logic (b)

10 24/03/2026 LT1A First-Order Logic (a)


Tutorial 4
10 27/03/2026 LT1 First-Order Logic (b) One Lab session in Week 10/11
(Lab Attendance is
11 31/03/2026 LT1A Default Logic (a) NOT Compulsory)

11 03/04/2026 LT1 Default Logic (b)

12 07/04/2026 LT1A Fuzzy Logic (a)


Tutorial 5
12 10/04/2026 LT1 Fuzzy Logic (b)

13 No Class

3
Why Logic?
• The earliest way people imagined how to build
AI system

• Still a relevant tool to guide today’s AI with


human knowledge

• Good interpretability (which deep learning-


based AI lacks)
4
An Example Logical Agent
[Link]

5
Why Logic?

6
Why Logic?
• New life for an old technology:
– Deep Learning and Logic Programming are starting
to merge today for building Explainable AI (XAI)
systems.
– Logic Explained Networks:

7
From Search to Logical Reasoning
• Representation of Knowledge and the
Reasoning Processes are central to the entire
field of AI

• A knowledge-based system (KBS) is a


computer program that reasons and uses a
knowledge base to solve complex problems.

8
Knowledge and Intelligence

Sensing
Knowledge
Decision
Maker

Action

9
The Knowledge-Based Approach
• Agents that know
– Achieve competence by being told new knowledge
or by learning
– Achieve adaptability by updating their knowledge
– > Knowledge representation
• State of the world, properties and evolution of the world;
goals of the agent, actions and their effect

• Agents that reason Logic


– Use knowledge to deduce course of actions
– > Knowledge inference

10
Knowledge-Based Agents
• Knowledge base (KB)
– Set of sentences i.e., representations of facts (DB)
– Knowledge representation language
• Adding and querying knowledge
– Tell: add a sentence to the KB
– Ask: retrieve knowledge from the KB
• Answers must follow from what has been Tell’ed (told)

• Inference mechanism
– Determine what follows from the KB

11
Problem Formulation of KBS
• Knowledge Based System
– States: Instances of the KB (sets of sentences)
–> Use Tell to build the KB
e.g. Tell(KB, “Smoke  Fire”)
Tell(KB, “Fire  Call_999”)

Tell(KB, “Smoke”)

– Operators: Add / Infer a new sentence


– Goal: Answer a query
–> Use Ask to query the KB
e.g. Ask(KB, “? Call_999”)

12
A Generic Knowledge-Based Agent
function KB-Agent (percept) returns action
static KB, // a knowledge base
t // a time counter, initially 0

Tell (KB, Make-Percept-Sentence (percept, t))


action  Ask (KB, Make-Action-Query (percept, t))
Tell (KB, Make-Action-Sentence (action, t))
tt+1
return action

– > 3 steps: interpretation, inference, execution


– > KB: background knowledge (observed )
+ acquired information (deduced)
13
Levels of Knowledge
• Epistemological level Tell Ask
– Declarative description of knowledge
• e.g. facts: “there is smoke in the kitchen”, “it is not warm
enough”
rules: “if there is smoke then there must be a fire”
• Logical level
– Logical encoding of knowledge (into sentences)
• e.g. facts: Smoke; rules: Implies(Smoke, Fire)
• Implementation level
– Physical representation of knowledge (sentences)
• e.g. - the string “Implies(Smoke, Fire)”, or
- a “1” entry in a 2-dimensional array: Implies[X,Y]

14
Example: the Wumpus World

15
Example: the Wumpus World
• Problem description (PAGE)
– Environment
• Grid of squares, walls; stench breeze
PIT
• Agent, gold, pits, wumpus.
stench
– Goal PIT
breeze
• Find the gold, return to S at [1,1]. breeze
– Percepts stench breeze

• A list of 5 symbols, e.g. [Stench,


Breeze, Glitter, Bump, Scream]; breeze breeze
PIT
• Agent’s location not perceived. S
– Actions
• Go-Forward, Turn-Left, Turn-Right,
Grab, Shoot (1 arrow only), Climb.
16
The Wumpus World
• Problem description (cont’d)
– Initial state
• Agent at [1,1]; gold, pits and wumpus in random squares.
– Path-cost
• Climbing out with the gold: +1000 (without: 0) • Each action: –1
• Getting killed (pit or wumpus): –10000
– Knowledge
• “In all squares adjacent to the one where the wumpus is,
the agent will perceive a stench.”
• “In all squares adjacent to a pit, the agent will perceive a breeze.”
• In the square where the gold is, the agent will perceive a glitter.”
• When walking into a wall, the agent will perceive a bump.”
• When the wumpus is killed, the agent will perceive a scream.”
17
Acting and Reasoning in
the Wumpus World
(0) Initial state (1) after {F}
[nil, nil, nil, nil, nil] [nil, Breeze, nil, nil, nil]

4 4

3 3

2 OK 2 P?
OK
A A
V
1 1 B
OK OK P?
OK OK
1 2 3 4 1 2 3 4
A = Agent G = Glitter, Gold P = Pit V = Visited
B = Breeze OK = Safe square S = Stench W = Wumpus 18
Acting and Reasoning in
the Wumpus World
(1) after {F} (6) after {F, L, L, F, R, F}
[nil, Breeze, nil, nil, nil] [Stench , nil, nil, nil, nil]

4 4

W?
W!
3 3
A
2 P? 2 S W?
OK OK OK
A B P!
V V
1 B 1 V
P?
OK OK OK OK
1 2 3 4 1 2 3 4
A = Agent G = Glitter, Gold P = Pit V = Visited
B = Breeze OK = Safe square S = Stench W = Wumpus 19
Acting and Reasoning in
the Wumpus World
(6) after {F, L, L, F, R, F} (10) after {F, L, L, F, R, F ,R, F, L, F}
[Stench , nil, nil, nil, nil] [Stench, Breeze, Glitter, nil, nil]

P?
4 4
A P?
W! W!
3 OK 3 SG
B
A S
V
2 S 2 V
OK OK OK OK
OK OK
B B
V P! V P!
1 V 1 V
OK OK
OK OK
1 2 3 4 1 2 3 4
A = Agent G = Glitter, Gold P = Pit V = Visited
B = Breeze OK = Safe square S = Stench W = Wumpus 20
Summary
• Intelligent agents need …
– Knowledge about the world to make good
decisions.
• Knowledge can be …
– Defined using a knowledge representation
language.
– Stored in a knowledge base in the form of
sentences.
– Inferred, using an inference mechanism and rules.
21
Thank you!

22

You might also like