CS 4 - Knowledge Representation - First Order Logic
CS 4 - Knowledge Representation - First Order Logic
CS 4 - Knowledge Representation - First Order Logic
Pilani Campus
Artificial Intelligence-[SESIZC444]
CS 4 -Knowledge representation &inference
Solving problems by
Representing the knowledge in state-space
Reasoning about the solution in logical steps
Sentence
representation of knowledge in a language called Knowledge representation
language
Represents an axiom, when the sentence is taken as given without being derived
from other sentences
TELL operation: Add new sentences to the knowledge base
ASK operation: Query what is known
Wumpus World
Actuators –
Forward,
TurnLeft by 90,
TurnRight by 90,
Grab – pick gold if present,
Shoot – fire an arrow, it either hits a
wall or kills wumpus. Agent has only
one arrow.
Climb – Used to climb out of cave, only
from [1, 1]
Symbolic Notation
A = Agent
B = Breeze
G = Glitter, Gold
OK = Safe Square
P = Pit
S = Stench
V = Visited
W = Wumpus
Action: Forward
Hence, KB
Operator Precedence: , , , ,
In ambiguous sentences like , resolution is
done using precedence, such that rather than
R1 : P1,1
R2 : B1,1 (P1,2 P2,1)
R3 : B2,1 (P1,1 P2,2 P3,1 )
R4 : B1,1
R5 : B2,1
Inference Rules
Modus Ponens (Latin for Mode that affirms) :
Whenever any sentence of the form () and are
given, then can be inferred
E.g., ((WumpusAhead WumpusAlive) Shoot
If (WumpusAhead WumpusAlive) is given, then
Shoot can be inferred
Inference Rules
And-Elimination: Given a conjecture, any of
the conjuncts can be inferred: or
E.g., If (WumpusAhead WumpusAlive) is
given, then WumpusAhead can be inferred
Inference Rules
All Logical Equivalence
rules can be used as
inference rules
Less expressive
Proposition is a declarative that either true
or false not both
All and some cannot be represented using
propositional logic
Atomic Sentence:
Formed by a predicate symbol optionally
followed by a parenthesized list of terms.
E.g., Brother(Richard, John) – which means that
Richard is the brother of John.
Atomic sentences can have complex terms as
arguments.
E.g., Married(Father(Richard), Mother(John))
Atomic sentence is true if the Predicate relation
holds between the objects in the arguments
Complex Sentences –
use Logical connectives (, , , , to
construct complex sentences
Brother(LeftLeg(Richard), John)
Brother(Richard, John)Brother(John, Richard)
King(Richard) King(John)
King(Richard) King(John)
Universal quantification ()
E.g.,
We will infer the sentence - Crown(C1)
OnHead(C1, John)
C1 does not appear in KB