Logical Agent
Logical Agent
Logical Agent
(Autonomous )
Guest Lecture on
Logical Agents and Knowledge Representation
Organized by:
Department of Civil Engineering
Resource Person
Dr. K. Venkata Rao
Director and Professor (GNITC)
Logical Agents &
Knowledge Representation
• Logical Agents
• Knowledge-based agents
• The Wumpus world
• Logic
• Propositional logic: the very simple logic
• Knowledge Representation
• Introduction, approaches to knowledge representation-
relational knowledge, knowledge represented as logic,
procedural knowledge, knowledge representation using
semantic networks, inheritance in semantic net.
Logical Agents
• Knowledge-based agents – agents that have an explicit representation
of knowledge that can be reasoned with.
• These agents can manipulate this knowledge to infer new things at the
“knowledge level”
• Humans can know “things” and “reason”
• Representation: How are the things stored?
• Reasoning: How is the knowledge used?
• To solve a problem…
• To generate more knowledge…
6
Knowledge-Based Agents
• Central component of a Knowledge-Based Agent is a Knowledge-Base
• A set of sentences in a formal language
• Sentences are expressed using a knowledge representation language
7
• C=a + b; generic
• C=4+6;
• C=4.5+5.6;
• Tell function:
• Charith is CSE student.
• All CSE students are intelligent.
• Ask:
• Is Charith intelligent?
• Yes.
Knowledge bases
• 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
world
• Deduce hidden properties of the world
• Deduce appropriate actions
10
Knowledge-Based Agents(agent program)
11
Knowledge-Based Agents
• Declarative Approach
• You can build a knowledge-based agent simply by “TELLing” it what it needs
to know
• Procedural Approach
• Encode desired behaviors directly as program code
• Minimizing the role of explicit representation and reasoning can result in a
much more efficient system
12
Wumpus World
• Performance Measure
• Gold +1000, Death – 1000
• Step -1, Use arrow -10
• Environment
• Square adjacent to the Wumpus are smelly
• Squares adjacent to the pit are breezy
• Glitter iff gold is in the same square
• Shooting kills Wumpus if you are facing it
• Shooting uses up the only arrow
• Grabbing picks up the gold if in the same square
• Releasing drops the gold in the same square
• Actuators
• Left turn, right turn, forward, grab, release, shoot
• Sensors
• Breeze, glitter, and smell
13
Wumpus World
Wumpus World PEAS description
• Performance measure
• gold +1000, death -1000
• -1 per step, -10 for using the arrow
• Deterministic
• Episodic
• Static
• Discrete
• Single-agent?
Wumpus world characterization
• Fully Observable No – only local perception
• Deterministic
• Episodic
• Static
• Discrete
• Single-agent?
Wumpus world characterization
• Fully Observable No – only local perception
• Episodic
• Static
• Discrete
• Single-agent?
Wumpus world characterization
• Fully Observable No – only local perception
• Static
• Discrete
• Single-agent?
Wumpus world characterization
• Fully Observable No – only local perception
• Discrete
• Single-agent?
Wumpus world characterization
• Fully Observable No – only local perception
• Discrete Yes
• Single-agent?
Wumpus world characterization
• Fully Observable No – only local perception
• Discrete Yes
Initial situation:
From this the agent can infer the neighboring squares are safe (otherwise there would be a breeze
or a stench)
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
Exploring a wumpus world
In each case where the agent draws a conclusion from the available
Information, that conclusion is guaranteed to be correct if the available
Information is correct…
This is a fundamental property of logical reasoning
Logic
• Knowledge bases consist of sentences.
• Logics are formal languages for representing information such that conclusions can be drawn
• Syntax defines how symbols can be put together to form the sentences in the language
Derived:
• Understanding inference and entailment: think of
Doly is intelligent. • Set of all consequences of a KB as a haystack
• α as the needle
If KB is true in the real world, then any sentence α derived from KB by a sound
inference procedure is also true in the real world.
Propositional logic
• Propositional logic is the simplest logic – illustrates basic ideas
• SYNTAX:
• Syntax of Propositional logic defines allowable sentences.
• Atomic sentences: These are the individual syntactic elements which consists of a single
propositional symbol.
• Each symbol stands for a proposition true or false.
• Uppercase names are used for symbols Ex: P,Q,R etc.
• Ex: W1,3 stand for Wumpus is in 1,3
• Complex Sentences: Constructed from simpler sentences using logical connectives
• The proposition symbols P1, P2 etc are (atomic) sentences
• Model checking
• truth table enumeration (always exponential in n)
• improved backtracking, e.g., Davis--Putnam-Logemann-Loveland (DPLL)
• heuristic search in model space (sound but incomplete)
e.g., min-conflicts-like hill-climbing algorithms
MAIN GATE
L
R
S
Conversion to CNF
B1,1 (P1,2 P2,1)
1. Eliminate , replacing α β with (α β)(β α).
(B1,1 (P1,2 P2,1)) ((P1,2 P2,1) B1,1)