Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Ai All Merged PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 248

Course code:IT4006

knowledge representation

Dr. Priyadarshan Dhabe,


Ph.D, IIT Bombay,
Assistant Professor in Information Technology
Syllabus-Module 4
 Knowledge Representation
Knowledge based agents, Wumpus world, Propositional
logic: Representation, inference, Reasoning patterns, ,
Resolution, Forward and backward chaining, First order
Logic: Representation, inference, Reasoning patterns, ,
Resolution, Forward and backward chaining,
Basics of PROLOG: Representation, Structure, Backtracking
Expert system: Case study of expert system in PROLOG
Knowledge Representation-basic

 Deals with
 Facts:- truths in some relevant world. These are the
things we want to represent.
 Representations of facts:- in some chosen formalism.
 Representation of facts can be done in various ways
 Plain English/ Mother tongue
 In Computers we use “Symbols”
 Mathematical logic (Propositional and Predicate Logic)
Knowledge Representation-basic

 Mappings between facts and Representation also


called as “Representation mappings”
Knowledge base

Forward mapping:- Backward mapping:-


Facts to representation Representation to Facts
Knowledge Representation-basic
 Consider following facts written in English and their
representations in predicate logic.
Tommy is a dog.
dog (Tommy )

All dogs have tails.


x : dog ( x)  hastail(x)

Using deductive mechanism we can generate


new fact.
hastail (Tommy )
Knowledge Based Agents

 That uses Representation of knowledge and reasoning


processes to bring knowledge in life.
 The central component of knowledge based agents is
“Knowledge base” (KB).
 Informally, KB, is set of “Sentence” (Sentence is a
technical term and is related to English sentences but
not identical)
 Each sentence is expressed in a language called a
“Knowledge Representation Language”
Knowledge Based Agents

 Operations on Knowledge Base (KB)


 Add new sentences (standard name is TELL)
 Query KB (standard name is ASK)
 Inference:- Both TELL and ASK may involve
“inference”- Deriving new sentence from old (existing)
by following systematic process.
Outline of Knowledge Based Agents program

-It takes “Percept” as input and returns “action” as output


- Each time program does the two things. First it “TELL”s (Add) the KB
what it perceives. Second, it ASKs (query) KB “What action it should
perform”.
- The second TELL is necessary to know the agent that the action is already
taken
Outline of Knowledge Based Agents program

MAKE-PPERCEPT-SENTENCE:-
- Takes a percept and a time and
returns a sentence (representation)
asserting that agent perceived the
percept at given time.
- Inputs can be Audio, Video,
combinations using various sensors
MAKE-ACTION-QUERY:-
- Takes a time as input and returns a
sentence (representation) that asks
what action should be performed at
that time.
The Wumpus World
Wumpus- a mysterious monster

 “Hunt the Wumpus game” (https://www.youtube.com/watch?v=xGVOw8gXl6Y )


 The Wumpus world is a cave consisting of rooms
connected by passageways. Lurking (hiding) some
where in the cave is the Wumpus, a beast that eats
anyone who enters its room. The Wumpus can be shot
by an agent, but the agent has only one arrow. Some
rooms contains bottomless pits (holes) that will trap
anyone who wanders into these rooms except
Wumpus, since it is too big to fall in. An agent can also
find a heap of gold.
The Wumpus World

PEAS (Performance measure,


Environment, Actuators,
Sensors) description of task
environment
1. Performance measure:- +1000
for picking up the gold, -1000 for
falling into pit or being eaten by
3. Actuators:- agent can move forward, wumpus, -1 for each action
turn left and right by 90 degrees. Agent taken and -10 for the using up
dies if enters into a room with pit or arrow.
wumpus. Action Grab can be used to pick 2. Environment:- a 4 x 4 grid of
the object in the same square. Action rooms. The agent always start in
shoot can be used to fire an (only) arrow in the square labeled [1,1,], facing
the straight direction agent is facing. the right. The locations of gold
and wumpus are chosen
randomly from other than start
square.
The Wumpus World
 Sensors:- The agent has 5 sensors
1. In the square containing the wumpus and in directly adjacent (not
diagonally) squares agent will perceive a stench (strong and unpleasant
smell).
2. In the square directly adjacent to pit, agent will perceive breeze (a
gentle wind)
3. In the square where the gold is, agent will perceive a glitter (bright
reflected light)
4. When agent walks into a wall, it will perceive a bump (collision)
5. When the wumpus is killed , it emits a woeful (sad) scream (loud
sound) that can be perceived any-where in the cave
The percepts will be given to the agent in the following form, if there is a
stench, breeze but no glitter, bump or scream

[Stench, Breeze, None, None, None]


The Wumpus World
Knowledge based wumpus Agent
 Agent has to retrieve gold safely.
 Initial knowledge Base contains
 Rules of the environment e.g [1,1] is safe square
 Agents knowledge evolves as new percepts arrives and
actions are taken.
 The first percept is [None, None, None, None, None],
from which agent concludes that its neighboring
squares (not diagonal) are safe. Fig. 1 shows this
situation. We use sentence “OK” to indicate safety of
squares.
Knowledge based wumpus Agent

Fig. 1
Since there was no stench or breeze in [1,1], the agent can infer that [1,2]
and [2,1] are free from danger and thus marked with OK and will try to
move in those squares only.
Knowledge based wumpus Agent
 Let agent decided to move to [2,1].
 Let agent detect a breeze in [2,1] i.e there can be pit in
[2,2] or [3,1], as shown in fig.2
Agent then can go back to [1,1] and then
proceed to [1,2]

Fig. 2
Knowledge based wumpus Agent
 Let new percept in [1,2] is stench., means there can be
wumpus near by, but wumpus can not be [1,1] and [2,2],
since they are already marked OK (known). Thus, agent
can infer that wumpus can be in [1,3] and indicated by w!

Lack of breeze in [1,2]


indicates that there is no pit in
[2,2] and thus will move to
[2,2] and then to [2,3]
Knowledge based wumpus Agent
Let that in [2,3] agent detects glitter, so it must grab
the gold.

Conclusion:- 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.
Propositional Logic/Boolean logic

 What is logic?
 Logic is the study of the principles of correct
reasoning.
 It is used for representation of knowledge, reasoning,
inference and proof generation.
 It provides syntax of representing facts and semantics
for knowing the truth value of a sentence.
 Logic is used to separate truth from falsehood,
reasonable from unreasonable beliefs.
Propositional Logic
 What is a proposition?
 It is a statement which can either true or false.
 Syntax of propositional logic- defines allowable
sentences OR how sentences can be formed?
 Syntax
 Atomic sentence:- is individual syntactic element and
can be represented with a single proposition symbol.
 Proposition Symbols- are upper case letter like P,Q, R
 Complex sentence:- are constructed from atomic ones,
using logical connectives
Propositional Logic-connectives
 Logical connectives.
 There are 5 logical connectives
• NOT , AND, OR, Implication, Bi-conditional
Negation (NOT)
 P- is called Negation of P,
A literal is either a atomic sentence (positive literal)
or a negated atomic sentence (negative literal)

Conjunction (AND)
A sentence whose main connective is  is called a Conjunction.
e.g (P  Q) , where P and Q are called conjuncts
Implication  OR  P Q PQ
A sentence whose connective is  is called an implication. F F T
e.g (P  Q) , where P is called premise /antecedent F T T
and Q is called as conclusion/consequence T F F
T T T
Propositional Logic
PQ
Bi-conditional (  ) (if and only if) P Q
F F T
P  Q is same as ( P  Q)  (Q  P) F T F
T F F
T T T

Syntax of propositional logic- in Backus –Naur form


Propositional Logic-semantics
 Semantics- Defines rules for determining truth of a
sentence wrt to a given model/world/environment

Let Pi , j defines Pit in room [i,j] in wumpus word.


If knowledge base has three proposition symbols
P1,2 , P2,2 and P3,1 then one possible model can be
m1  {P1,2 =F, P2,2 =F, P3,1  T } there can be 23  8
such possible models.
Truth tables are used to determine the truth of sentence. Find truth
value of an atomic sentence and then compute truth value of complex
sentences based on them.
Knowledge base in Propositional Logic

 KB consists of set of sentences. Thus, KB logically is


conjunction of those sentences (s1 to sn).
 If we start with empty KB and do
TELL(KB,s1),….,TELL(KB, sn), then we have

KB  S1  S 2  .....  Sn
Simple Wumpus world Knowledge base in Propositional Logic
Let Pi, j is true if there is pit in room [i,j]
and Bi,j is true if there is breeze in room [i,j]
KB then contains following sentences , each one is labeled for convenience

R1: P1,1 (no pit in room [1,1])


R2: B1,1  (P1,2  P2,1 ) ( pit is in room [1,2] or [2,1] iff breeze is in [1,1])
R3: B2,1  (P1,1  P2,2  P3,1 )
R 4 : B1,1
R5 : B2,1

KB then consists of sentences R1 to R5 or it can also be considered as a


single sentence

R1  R2  ...  R 5
Inference in Propositional Logic
 Entailment :- (implies) (logically follows)

Logical entailment between sentences.


We say that sentence  follows logically from 
 | 
Formal definition:-  |  ,iff, in every model in which  is true
 is also true.
 can be an atomic senetence or complete KB
We can say that  can be inferred from 
Logical equivalences in Propositional Logic

Equivalence Equivalence
We say that  and  are equivalent and written as
 
iff  |=  and  |=
Validity and satisfiability in Propositional
Logic
 Validity
A sentence is valid if it is true in all models
e.g P  P
They are also called as tautologies

 Satisfiability

A sentence  is satisfiable if it is true in some models.


If  is true in model m , the we say that m satisfy 
Reasoning patterns in Propositional Logic
 Standard patterns of inferences (also called as
inference rules)
Rule1. Modus Ponen (best known Rule)
If    and  are given, then
sentence  can be inferred.
e.g (WumpusAhead  WumpusAlive)  shoot and
(WumpusAhead  WumpusAlive) are given then shoot
can be inferred
Rule 2- And-Elimination
if    are given then we can infer either  or 
i.e from conjunction any conjuct canbe inferred
From (WumpusAhead  WumpusAlive) we can infer
WumpusAlive
Reasoning patterns in Propositional Logic
 All logical equivalences can be used as inference rules
If    is given then we can infer
(   )  (   ), since
Bi-conditional elimination
(   )  (   )  (   ) rule
OR
If (   )  (   ) is given then we can infer

Not all rules can be used in both the ways
e.g if    and  is given we can not infer 
Use of inference rules in Propositional Logic
in wumpus world
KB contains R1 to R5 and want to prove that P1,2
Using bi-conditional elimination rule on R2 we get R6
R6: (B1,1  ( P1,2  P2,1 ))  (( P1,2  P2,1 )  B1,1 )
Applying And-Elimination rule on R6 to obtain
R7: (( P1,2  P2,1 )  B1,1 )
Using contrapositive rule if    then (   )
R8 : B1,1  ( P1,2  P2,1 )
Applying modus ponens with R8 the fact B1,1 to obtain
R9: ( P1,2  P2,1 )
Proof: sequence of
Applying De-morgans law we obtain application of inference rules
R10: P1,2  P2,1 is called Proof.
By applying And-Elimination we obtain
P1,2
Proof generation and searching in
Propositional Logic
 Generating proof is equivalent of searching through
space and finding the solution. At each step set of all
applicable inference rules can be generated and the
most optimal rule is selected, continue till we get the
final conclusion.
 Proof procedures:-
 Forward:- start with a fact in KB and end in fact to be
proved
 Backward:- Opposite of forward
 Thus, searching algorithms can also be used to
generate proofs.
Resolution in Propositional Logic
 Resolution is an inference RULE.
 It generates proof by contradiction
 At each step takes two clauses (parent clauses) as input
which have complimentary literals and produces a new
clause containing all the literals of two clauses except
complementary literals. (P and P)
 Resolution process continues till a resolvant is either
NULL or Contradiction
To prove that KB|= ( logically follows or inferred from KB),
Resolution shows that
KB|= is unsatisfiable by prooving a contradiction.
Resolution in Propositional Logic
Resolution converts (KB|= ) into Conjuctive Normal Form (CNF)
CNF is conjunction of disjuncts i.e (P  Q)  (R  S)....
Convert the fact R2 from wumpus world into CNF (B: Breeze, P: Pit)
R2: B1,1  ( P1,2  P2,1 )
1.Eliminate bi-conditional using    can be replaced by (   )  (   )
(B1,1  ( P1,2  P2,1 ))  (( P1,2  P2,1 )  B1,1 )
2.Eliminate implication using     (   )
(B1,1  ( P1,2  P2,1 ))  (( P1,2  P2,1 )  B1,1 )
3. CNF requires  to appear only in literals, so we move  inwards using
equivalence rules
(B1,1  P1,2  P2,1 )  ((P1,2  P2,1 )  B1,1 )
4.Distributing  over 
(B1,1  P1,2  P2,1 )  (P1,2  B1,1 )  (P2,1  B1,1 )
( Is Required CNF)
Example 1: Resolution in Propositional Logic
3. (P1,2  B1,1 ) P1,2

Consider the KB and P1,2 B1,1 4. B1,1


prove using resolution
1. (P2,1  B1,1 ) NULL

2. (B1,1  P1,2  P2,1 )


3. (P1,2  B1,1 )
4. B1,1
Thus, P1,2 is proved
Example 2: Resolution in Propositional Logic
Using KB prove that R is True
Given axioms Converted to a clause form
P P (1) 2. P  Q  R R
(P  Q)  R P  Q  R (2)
(S  T)  Q S  Q (3) 1. P P   Q
T  Q (4)
T T (5) 4. T  Q Q

Reference:- Rich and Knight 5. T T

NULL

Since resolvant is a null a contradiction is obtained and thus R is proven true


Forward and Backward chaining in
Propositional Logic
 Real world KBs often contain only clauses of restricted
kind called Horn Clauses.
 A Horn clause is a disjunction of literals of which at
most one is positive.
 (P  Q  R) is Horn clause but ( P  Q  R)is not

• Using Horn clauses Inference can be drawn using forward


chaining and backward chaining in a very efficient
manner.
Forward and Backward chaining in
Propositional Logic
 Forward chaining.
 Determines if a single propositional symbol q can be entailed by
KB of Horn clauses. It begins with the known facts (positive
literals). If all premises of an implication are known then its
conclusion is added to set of facts. This process continues till q is
added to KB or until no inference can be made.
 Backward chaining
 It works backward from q. If q is known to be true no work is
needed. Otherwise algorithm finds those implications in KB that
concludes q. If all premises of implications can be proved true (by
backward chaining) then q is true.
 It is a form of goal-directed reasoning.
 Forward reasoning is used for generation of facts and backward
is for proof.
NOTE
 Read from slides of Predicate logic
Predicate Logic

Dr. Priyadarshan Dhabe


Ph.D (IIT Bombay), Assistant Professor,
Department of Information Technology
What is a Logic?

Logic:- is a science of reasoning. It defines


representation, Manipulation and uses of real
world facts. (Knowledge).
Logic:-The formal, systematic study of the
principles of valid inference and correct
reasoning (Ref:-Penguin Encyclopedia)
Aristotle –pioneered this field by codifying
“Right Thinking”
Components of a Logic System

• Syntax Rules- how to represent a fact in a


valid manner using symbols?
• Semantic Rules- How to interpret a
represented fact?
• Inference Rules- How to generate new and
valid facts from existing facts?
• A set of symbols- Used to represent real
world facts.
Properties of Logic systems
• Consistency :- No theorem (proof) of the
system contradicts to another.
• Soundness:-which means that the system's rules
of proof will never allow a false inference from a true
premise (basis/ argument). If a system is sound and
its axioms are true then its theorems are also
guaranteed to be true.
• Completeness:-which means that there are no
true sentences in the system that cannot, at least in
principle, be proved in the system.
Propositional Logic

• A Logic system already Known to you. Also


called as sentential logic.
• Proposition- is a sentence having truth
values either “True” or “False”.
• Not all sentences are propositions.
• Is there water on Mars?- not a proposition.
• Propositions are subset of sentences.
Problems with Propositional Logic(PL).

• Assume following propositions.


– Tommy is a dog. Represented with “P”
– Moti is a dog. Represented with “Q”
• Consider these representations only, P and
Q. It is very difficult to find the commonality
between “Tommy” and “Moti”.
• Lack of expressiveness. Not every real world
fact can be expressed in PL concisely (brief).
• Representation lack focus on objects and
their relationship.
Predicate Logic

• What is a predicate?
• Any sentence describes objects and their
properties, classes and relationships.
• Predicate is a part of sentence describing
properties, classes and relationships of
objects.
• E.g. This Ball is Red.
• (Red- predicate, Ball is an object)
Representing Facts in
Predicate Logic (informal way)
• Write predicate outside the bracket ( ) and
objects inside the bracket.
• This ball is red.
red (Ball). unary

• Ram is brother of Sham


brother (Ram, Sham) binary

• Sham defeated Hari and Ram


defeated(Sham, Hari, Ram) Ternary
• A predicate can have n objects or of n-arity
n>=0.
General form

pqrst (A,B, C)

Objects
Relationship,
Class involved
Or
Property
Represent following simple facts in
predicate logic
1. P. S. Dhabe is assistant professor.
2. Students appeared for exam.
3. Train is late.
4. A and B played chess.
5. Sky is blue.
6. A, B and C are project group members.
Relationship between Proposition and
Predicate

Proposition= Predicate+ Objects involved in the fact


Components Of Predicate Logic

• Set of Objects (Object Constants)


• Set of functions (Function Constants)
• Set of Relations (Relation Constants)
• Connectives ( ,  ,  )
• Delimiters (, ), [, ], seperator ,
• Quantifiers (   )

Have a closer look at Syntax and


Semantics.
Syntax of Objects
• These are alphanumeric strings.
• They either starts with a Capital letter
or a number.
e.g. EifelTower,
Exam,
12box,
Ab,
Are valid Object representations in (PL)
Semantics of Objects

• They can physical objects like box or


pen.
• They can be abstract entities like
number 7 & Л.
• They can be fictional entities like-
“Santa Claus”
Syntax of Functions
• These are alphanumeric strings always
begins with a Capital letter.
• These are the computable functions allowed
to be used and called as “Skolem
Functions”, due to logician Thoralf Skolem
[1920].
e.g Father(x), x- object variable
This function returns name of the father of x so
that we can write
congratulated(y, Father(x))
Semantics of Functions

A function can be of n-arity and it maps


n objects into another objects.
e.g Childs(y) will return all the child
names of object y.

Note:-Typographical conventions used here are


not universal.
Syntax of Relations

• Relation can be-


– property and object-Class relationship.
• These are alphanumeric strings always begin
with small case letters.
• A relation constant is also called as a
“predicate”. (Formal Definition)

defeated( Ram, Sham)


Semantics of Relations
• Each relation will have arities.
• Objects can participate in arbitrary number
of relations.
• A relation with arity 1 is called as “property”
or A “object-class” relationship.
red(Ball) bird(crow)
• They can have zero objects.
e.g. There is raining.
raining( ) or simply raining
Syntax Rules in predicate Logic
Talks about “How to write a valid WFF?”.
1. True and False (represented as T and F) are
valid WFF.
(They are called as distinguished Atoms).
2. Atom or Atomic formula is a valid WFF.
“A predicate followed by n objects (n>=0) in
parenthesis separated by comma” is called
as Atom or Atomic formula.
playedchess(A, B) – is “Atomic” Formula
playedchess(A, B)^ winner(B) – “Composite”
Formula
Syntax Rules in predicate Logic
3. If R1 and R2 are valid WFF then following are also WFF

a).R1  R2 (Conjunction)
b).R1  R2 (disjunction)
c).R1 ( Negation)
d ).R1  R2 (implicatio n)
e). A WFF involving Quantifier s is also a validWFF

x : drive( x) y : x : drive( x)

4. There are no other WFF


Truth Table for Implication

A B AB
T T T
T F F
F T T
F F T

What is “interpretation” of a formula?


Predicate calculus formulas (PCF) and
Knowledge
• PCF can be used to represent “Knowledge”
that an agent has about the world.
• Knowledge base:- A set  of such wffs is
called as knowledge base.
• If a formula w is in  then we say that agent
“Knows” w, or more appropriately agent
“believes” in w.
Example of Knowledge base

On (A, Floor)
On (B, A)
B
A C On (C, Floor)
clear (B)
Floor
clear ( C )

Blocks World
on( B, A)  clear ( A)
Domain

Knowledge base
Quantification

• Is a process that specify “quantity” of


objects involved in a Fact in abstract/ general
way. Mostly “at least one” or “all”.
• This can be done using “Quantifiers”.
• There are two types of Quantifiers
• Universal Quantifier.
• Existential Quantifier.
Universal Quantifiers (UQ) 
• Suppose we want to say that every object in the domain has a
certain property or participated in a relation. If the domain is
finite ( 3dogs A, B and C), we want to represent “every dog has
a tail” . It can be represented using conjunction as
dog ( A)  hasatail ( A) 
dog ( B)  hasatail ( B) 
dog (C )  hasatail (C )

• But if the domain is infinite we can not list all of them


• Such situation is handled with a (UQ)
• A UQ is used to represent “for all” and “every” phrases.

x : dog ( x)  hasatail ( x)
Syntax rule using UQ

if w( x) is a WFF
then
x : w( x) is also a WFF

Where x-is a object variable


“Truth value” of wff with Universal
quantifiers

x : dog ( x)  hasatail ( x)

Above WFF is “TRUE” if it has a value “TRUE” for all


the objects x in that domain.
Existential Quantifier 
• Suppose we want to say that “at least one” object
has a certain property. It can be handled using
“disjunction” in finite domain.
• Assume a finite domain of 3 persons A, B and C. We
want to represent a fact “ at least one person can
drive”.
drive( A)  drive( B)  drive(C )
• In infinite domain an Existential Quantifier is used

x : y : drive( y )
Set-subset relationship?
“Truth value” of wff with Existential
quantifiers

x : y : drive( y )

Above WFF is “TRUE” if it has a value “TRUE” for


“at least one object” x in that domain.
Some Rules about Quantifiers

1. (x) : [(y ) : w] is equivalent to (y ) : [(x) : w]


We can change order of universal Quantifier s.
2. (x) : [(y ) : w] is equivalent to (x) : (y ) : [ w]
We can group universal Quantifier s.
3. Rule1 and Rule 2 are also applicable to Matrix

Exsitential Quantifier s prefix

4. (x) : [(y ) : w] is not equivalent to (y ) : [(x) : w]


grouping of universal and Exsitential Quantifier
must retain their order
Some Rules about Quantifiers

5. (x) : [ w] is equivalent to (y ) : [ w]


if all occurances of x are replaced by y
We can change var iable name.
(applicable to EQ also )
6. (x) : w is equivalent to (x) : w
(x) : w is equivalent to (x) : w
Change of Quantifier s with reducing scope of .
Inference Rules in Predicate Logic
1. Modus-ponen ( LATIN mode that
affirms/state/asserts)
If P and PQ are given
Then infer Q

If dog (Tommy) and x : dog ( x)  hasatail ( x) Then


INFER
hasatail (Tommy)
Inference Rules in Predicate Logic

2. (AND ^ Introduction)

IF P and Q are given


then Infer
P^Q
If dog (Tommy) and hasatail (Tommy) are given
Then
INFER
dog (Tommy)  hasatail (Tommy)
Inference Rules in Predicate Logic

3. (Commutativity of ^)

IF P ^ Q is given then
Infer
Q^P
Inference Rules in Predicate Logic

4. (^ Elimination)

IF P ^ Q is given then
Infer
(either Q ) or (either P)
Inference Rules in Predicate Logic

5. ( V Introduction)

IF P is given
then Infer
PvQ
If dog (Tommy) is given
Then
INFER
dog (Tommy)  black (Tommy)
Inference Rules in Predicate Logic

6. ( ⌐ Elimination)

IF ⌐(⌐ P) is given
then Infer
P
Inference Rules in Predicate Logic
7. ( Universal Instantiation UI)
If x : w( x) is given
Then INFER
w( ) where  is a real object from a domain
(replace all x by  in that WFF )

If x : dog ( x)  hasatail ( x) is given


Then INFER
dog (Tommy)  hasatail (Tommy)
General to specific
Inference Rules in Predicate Logic
8. ( Existential Generalization EG)
If w( ) is given
Then INFER
x : w( x) where  is a real object
from a domain & x is object Variable

INFER x : dog ( x)
if dog (Tommy) is given

Specific to General
ISA Hierarchy
• How to represent Class- subclass and instance
relationships Explicitly?
• Isa- predicate is used to represent Class- subclass
relationship like.

isa (Mammal, Animal)


Not Objects
isa (Human, Mammal)

• Arguments to the isa predicate are “Class labels”.


• Instance-predicate is used to represent object and
class relationship explicitly.
instance (Tommy, Dog)
• Arguments to the instance predicate are object and
class label.
Representing more facts in Predicate
Logic
1. Marcus was a man.

man(Marcus ) (Tense is ignored)


2. Marcus was Pompeian.
(Not:-Pompeii, an ancient city of southern Italy southeast of Naples. Founded in the
sixth or early fifth century b.c., it was a Roman colony by 80 b.c. and became a prosperous
port and resort with many noted villas, temples, theaters, and baths. Pompeii was destroyed
by an eruption of Mount Vesuvius (volcano) in a.d. 79.)

pompeian(M arcus)
3. All Pompeian’s were Romans.
x : pompeian( x)  roman( x)
4. Caesar was a ruler
ruler (Caesar )
Representing more facts in Predicate
Logic
5. All Romans were either loyal to Caesar or hated him.
x : roman( x)  loyalto ( x, Caesar )  hate( x, Caesar)
6. Everyone is loyal to someone.
x : y : loyalto ( x, y )
7. People only try assassinate rulers they are not loyal to.
x : y : person ( x)  ruler ( y )  tryassas sin ate( x, y )  loyalto ( x, y )

8. Marcus tried to assassinate Caesar.


tryassas sin ate( Marcus , Caesar )
Representing more facts in Predicate
Logic
9. Every man is a person.
x : man( x)  person ( x)

Suppose we want to prove that “Marcus was not


loyal to Caesar”. A Human expert can prove this
in following way.
loyalto ( Marcus , Caesar )
(7, sustitution) x Marcus
y Caesar
person ( Marcus )  ruler (Caesar ) 
tryassas sin ate( Marcus , Caesar )
( Applying axiom 4 )

person ( Marcus )  tryassas sin ate( Marcus , Caesar )


( Applying axiom 8 )
person (Marcus )
(9 substitution ) x Marcus

man(Marcus )
( Applying fact 1)

NULL
Problems in automating the proofs
• Suppose a machine has to prove a statement that
“Marcus was not loyal to Caesar” and having
knowledgebase represented using WFF in
predicate logic. e.g a WFF
x : y : person ( x)  ruler ( y )  tryassas sin ate( x, y )  loyalto ( x, y )

Problems
1.System will not be efficient due to “Conjunctions”
2. Conjunction forces system to think more and
thus requires more efforts.
3. Quantifiers add-up the same effect.
Solution :- A clause form
What is a Clause?

• A clause is fact represented without


“Conjunction” and “Quantifiers”.
• A fact represented using single WFF in
predicate logic can be converted into
multiple clauses.
• These Clauses are called “Horn Clauses”
(Logician Alfred Horn, 1951)
Converting a Fact into clause form.

Rule-1. Convert implication into their equivalent using rule

a  b  a  b
“All Romans who know Marcus either hate Caesar or think that
anyone who hates anyone is a crazy”.

x : [roman( x)  know( x, Marcus )] 


[hate( x, Caesar )  (y : z : hate( y, z )  thinkcrazy( x, y ))]

x : [roman( x)  know( x, Marcus )] 


[hate( x, Caesar )  (y : (z : hate( y, z ))  thinkcrazy( x, y ))]
Converting a Fact into clause form.
Rule-2:- Reduce the scope of negation to a single term using
the above rules

(p )  p
(a  b)  a  b deMorgan’s Law

(a  b)  a  b
x : P( x)  x : P( x) Standard
corresponden

x : P( x)  x : P( x)
ce between
quantifiers
x : [roman( x)  know( x, Marcus )] 
[hate( x, Caesar )  (y : (z : hate( y, z ))  thinkcrazy( x, y ))]

By applying Rule 2, above fact will be changed to

x : [roman( x)  know( x, Marcus )] 


[hate( x, Caesar )  (y : z : hate( y, z ) 
thinkcrazy( x, y ))]

Correspondence between
deMorgan’s law
quantifiers
Converting a Fact into clause form.
Rule-3:- Standardize variables so that each quantifier
binds a unique variable. e.g.

x : P( x)  x : Q( x)
x : P( x)  y : Q( y )
Scope of x
x : [roman( x)  know( x, Marcus )] 
[hate( x, Caesar )  (y : z : hate( y, z ) 
thinkcrazy( x, y ))]

Rule 3- is not applicable to this fact since each quantifier


binds a single variable.
Converting a Fact into clause form.
Rule-4:- Move all the quantifiers to the left of formula without
changing their relative order. This is possible since there is
no conflict among variable names.
x : [roman( x)  know( x, Marcus )] 
[hate( x, Caesar )  (y : z : hate( y, z ) 
thinkcrazy( x, y ))]
After application of Rule-4 to above fact it will be changed to

x : y : z : [roman( x)  know( x, Marcus )] 


[hate( x, Caesar )  (hate( y, z ) 
thinkcrazy( x, y ))]
x : y : z : [roman( x)  know( x, Marcus )] 
[hate( x, Caesar )  (hate( y, z ) 
thinkcrazy( x, y ))]
At this point formula is said to be in Prenex
normal form, containing prefix of quantifiers
followed by matrix.

prefix Matrix
Converting a Fact into clause form.
Rule-5:- Eliminate existential quantifiers using “Skolem Functions”
as follows.
y : president ( y )
replace by
president ( s1)
Where s1 is a function with no arguments and that returns a value
that satisfies president.
x : y : fatherof ( y, x)
replace by
x : fatherof ( s 2( x), x)
Converting a Fact into clause form.
Rule-6:- Drop the prefix. At this point all the remaining variables
are universally quantified and any proof procedure can
assume that each variable it sees is universally quantified.

After applying rule 6

[roman( x)  know( x, Marcus )] 


[hate( x, Caesar )  (hate( y, z ) 
thinkcrazy( x, y ))]
Converting a Fact into clause form.
Rule-7:- Convert the matrix into conjunction of disjuncts
(CNF) and remove the parenthesis. Following properties
can be useful here.

a  (b  c)  (a  b)  c Associative

(a  b)  c  (a  c)  (b  c) Distributive

Since there is no “AND” operator in our case thus remove the


parenthesis.
roman( x)  know( x, Marcus ) 
hate( x, Caesar )  hate( y, z ) 
thinkcrazy( x, y )
Converting a Fact into clause form.

Rule-8:- Create a separate clause corresponding to each conjunct. A


WFF is true if all the clauses generated from it are true. The set of
facts represented with WFF and set of clauses are equivalent.

In our example there is no AND operator thus it leads to only one


clause.

roman( x)  know( x, Marcus ) 


hate( x, Caesar )  hate( y, z ) 
thinkcrazy( x, y )
Converting a Fact into clause form.
Rule-9:- Standardize the variables such that each clause refers
to different variable. Use following fact if necessary
(x : P( x)  Q( x))  x : P( x)  y : Q( y )
In our case there is only one clause thus there is no need to
apply this rule.

roman( x)  know( x, Marcus ) 


hate( x, Caesar )  hate( y, z ) 
thinkcrazy( x, y )

Clause Form
Problem-1
• Convert above fact into Clause form.

x : dog ( x)  hasatail ( x)  bark ( x)


Rule  1
x : dog ( x)  (hasatail ( x)  bark ( x))
Rule  2,3,4, and 5 are not applicable
Rule  6  drop the prefix
dog ( x)  (hasatail ( x)  bark ( x))
Rule  7  distribute  over 
(dog ( x)  hasatail ( x))  (dog ( x)  bark ( x))
Rule  8  prepare seperate clauses
1.dog ( x)  hasatail ( x)
2.dog ( x)  bark ( x)
Rule  9  change var iable names
1.dog ( x)  hasatail ( x)
2.dog ( y )  bark ( y )
Problem.2

Convert following WFF into clause form

x : y : drive( y )  cook ( y )
Rule 1 ,2 , 3 4 are not applicable

Rule 5- Eliminate Existential quantifiers by “Skolem functions”

x : drive( s1)  cook ( s 2)

S1 and s2 are “Skolem functions” and they correctly return


value of x to satisfy the predicate.
Rule-6:- drop the prefix
drive( s1)  cook ( s 2)

Rule-7-not applicable since it is already in CNF

Rule-8- creating separate clauses from each conjunct

1.drive( s1)
2.cook ( s 2)
Rule-9- Assuming that s1 will refer to x and s2 to y.
Resolution
• It is a proof generating procedure.
• It generates proof by “Contradiction”.
Definitions.
1. Contradiction:- is a statement whose every
possible interpretation is “False” e.g
( P  P )
2.Tautology:- is a statement whose every
possible interpretation is “True” e.g
( P  P )
3. Contingency:- is a statement which is
neither tautology nor contradiction.
Resolution
• Resolution generates proof by “Refutation”,
means the fact to be proved is negated and
then it is added to the knowledgebase and if
a contradiction is found then original fact is
proved.

blue(sky) ¬ blue(sky)

Red(carpet)

Contradiction is found in two ways.


1. Null resolvant
2. A non-null resolvant which is a contradiction.
Unification

• In resolution we can resolve/cancel following


clauses in a straight forward manner.

man( Marcus )
Parent Clauses.
man( Marcus )

• But we can not resolve/cancel following clauses


in a straight forward manner unless x is replaced
by Marcus.
man( Marcus )
man( x)
Unification
• Unification is a process that suggest substitution to unify the
parent clauses.
Let L1 and L 2 are parent clauses to
be unified
Unification( L1, L 2)
{ 1. If L1  L 2 return NULL
2. If L1 and L 2 have same predicate symbol
& same number of Arguments.
for each i th Argument in L1 and L 2
A1i
substitution( )
A2 i
if any one or both of them are Variables
else
report failure
}
Example of unification

hate( x, y )
hate( Marcus , z )

Marcus / x
substitution
y/z
Problem-3.
• Represent above facts in predicate logic and convert
them into clause form.

Consider following facts about Santa Maria club.


1. Joe, Sally, Bill and Ellen are members of Santa
Maria club.
2. Joe is married to sally.
3. Bill is Ellen’s brother.
4. The spouse of every married person in the
club is also in the club.
5. Last meeting of the club was at Joe’s house.
Resolution
• Consider set of facts F and a statement to be
proved P.
Resolution Algorithm
1. Convert all the facts in F to clause form.
2. Negate P and convert the result to clause form.
Add it to the set of clauses obtained in step 1.
3. Repeat until either a contradiction is found, no
progress can be made or a predetermined amount
of effort has been expanded.
a) Select parent clauses.
b) Resolve them together. If necessary call to unification to
unify them. The resolvant will be disjunction of all the
literal from both the clauses. Omit the resolved literals
from the resolvant.
Resolution

c) If the resolvant is empty clause, then a contradiction has


been found. If not then add it to the set of clauses available to
the procedure. If can’t progress with non-null resolvant, check
that is it a contradiction?
Guidelines to select clauses to speedup
Resolution
• Only resolve pairs of clauses that contain
complementary literals.
• Eliminate certain clauses as soon as they are
generated so that they can not participate in later
process.
• Whenever possible resolve either with one of the
clauses that is part of the statement to be proved or
with a clause in resolvant. (set of support strategy)
• Wherever possible resolve with a clause having
single literal. Such resolution generates resolvant
with fewer literals.( unit-preference strategy)
Example-1 of resultion.

1. man( Marcus )
2. popeian ( Marcus )
3. pompeain( x1)  roman( x1)
4. ruler (Caesar ) F
5. roman( x 2)  loyalto ( x 2, Caesar )  hate( x 2, Caesar )
6. loyalto ( x3, f 1( x3))
7. man( x 4)  ruler ( y1)  tryassas sin ate( x 4, y1)  loyalto ( x 4, y1)
8. tratassa sin ate( Marcus , Caesar )

This is a set of facts about the Marcus in clause form. Suppose


we want to prove that “Marcus hate Caesar”.

hate( Marcus , Caesar ) P


Example-1 of resultion.
¬ hate( Marcus , Caesar ) 5

Marcus/x2

3
roman( Marcus )  loyalto ( Marcus , Caesar )

Marcus/x1
2
pompeain( Marcus )  loyalto ( Marcus , Caesar )
7
loyalto ( Marcus , Caesar )
Marcus/x4, Caesar/y1 1
man( Marcus )  ruler (Caesar )  tryassas sin ate( Marcus , Caesar )

ruler (Caesar )  tryassas sin ate( Marcus , Caesar )


ruler (Caesar )  tryassas sin ate( Marcus , Caesar ) 4

8
tryassas sin ate( Marcus , Caesar )

Null

Since we found a a Null resolvant, it means that


contradiction has been found and thus “Marcus hate
Caesar” is proved.
Example-2 of resultion.
Consider following facts about Santa Maria club.
1. Joe, Sally, Bill and Ellen are members of Santa Maria club.
2. Joe is married to sally.
3. Bill is Ellen’s brother.
4. The spouse of every married person in the club is also in the club.
5. Last meeting of the club was at Joe’s house.

Knowledgebase of about this club in Clause Form is as follows.


1. member( Joe)
2. member( Sally )
3. member( Bill )
4. member( Ellen )
5. married ( Joe, Sally )
6.brother ( Bill , Ellen )
7. married ( x, y )  member( x)  member( y )
8.lastmeeting ( Joe)
Suppose we want to prove that “Ellen is not married”

married ( Ellen , z )
*****************************Resolution***************************

married ( Ellen , z ) 7
Ellen/x, z /y
4
member( Ellen )  member( z )

member(z )
Z can assume following values z=Joe, z=Sally, z=Bill
z  Joe, Since Joe is already married
z  Bill , Since Bill is Ellans brother
z  Sally , Since is already married with Joe
Since every possible interpretation of member(z) is False, Thus it is a
contradiction.
Problem.1
• Represent following facts in predicate logic and
using resolution prove that West is a criminal.
1. It is crime for American to sell weapons to hostile
nations.
2. Nono has some missiles.
3. All of missiles owned by Nono were sold to it by
Colonel West.
4. Missiles are weapons.
5. America counts enemy as hostile.
6. West is American.
7. Country Nono is enemy of America.
Reference:- Artificial intelligence A modern approach-Russell &
Norvig, Page.280
Facts in WFF
American( x)  weapon( y )  sells ( x, y, z )  hostile ( z )  cri min al ( x)
x : owns( Nono, x)  missile ( x)
missile ( x)  owns( Nono, x)  sells (West , x, Nono)
missile ( x)  weapon( x)
enemy( x, America )  hostile ( x)
american (West )
enemy( Nono, America )
Facts in clause form
Null
Points to be learned

• Forward and Backward reasoning , Forward and


Backward chaining rules.

Reference:- Rich & Knight.


Introduction to Prolog
• The name prolog was taken from phrase
“PROgramming in LOGic” and first developed in 1972, in
France.
• It is unique in its ability to infer facts and conclusions
• User has to provide a Knowledge Base (KB) about a
problem domain and has to specify a goal. Then system
uses KB to achieve this goal, defining its own
procedure.
• Procedural languages:-
– like C, C++, uses procedure describing how to solve a given
problem?.
– Focus on Procedure and Data
– Same procedure is executed many times with great speed
Introduction to Prolog

• Prolog Features
– OOP language
– No procedure and thus, no programs and thus no
programmers, but “Knowledge Engineers”
– Only data (facts) about objects and their relationships
– Thus, a prolog program= database (Knowledge base)
– Goal is given by user and using formal reasoning it
proves or disproves it for find truth value
– It is a complied language
Introduction to Prolog

• Prolog software : This course recommends SWI prolog


• SWI Prolog available on
• [1]. http://www.swi-prolog.org/download/stable
• Tutorials on
• [2]. http://lpn.swi-prolog.org/lpnpage.php?pagetype=html&pageid=lpn-htmlse1
• Learn:- Case study of Expert system from Rich and Knight (MYCIN OR PROSPECTOR)
• Following are corresponding Lab Assignments

Lab assignment 4:- Implement real time applications in Prolog.


Uses Knowledge bases KB3 to KB5 and all the queries on them in [2]
Lab assignment 5:- Expert System in Prolog
Implement a small expert system in prolog for detection of childhood diseses
(refer:- Introduction to Turbo Prolog by Carl Townsend)
Course code: IT4006
(Intro. Planning and ANN) (5 Hrs)

Dr. Priyadarshan S. Dhabe,


Ph.D, IIT Bombay,
Assistant Professor in Information Technology
Syllabus-
 Planning- Blocks world, STRIPS, Implementation
using goal stack.
 Introduction to Neural networks:- basic,
comparison of human brain and machine, biological
neuron, general neuron model, activation functions,
Perceptron learning rule, applications and advantages
of neural networks.
 Brief introduction to single layer and multiplayer
networks.
What is planning?

 Planning
 Can be broadly defined as the process of computing
several steps of a problem solving procedure before
executing any of them.
 Planning decompose the problem into sub-
problems/parts
 These sub-parts
 interacts with each other
 Are Ordered to solve big problem
The Blocks world domain
 The domain considered for planning systems
 There is s flat surface on which blocks can be placed.
 Each block has exactly same size and identified with an
alphabet. There are many such blocks.
 At most one block can be stacked on the another block,
since they are of same size.
 There is a robot arm that can manipulate the blocks
 Predicates are used to represent facts in the blocks world
The Blocks world domain-
ON (A, B)  ONTABLE (B)
Robot arm can perform following
actions
A 1. UNSTACK(A,B)- Pick up the block
B A from its current position on block
B. The arm must be empty and no
block should be on the top of A
2. STACK(A,B)- Place block A on
block B. The arm must already be
holding block A and the surface of B
must be clear
3. PICKUP(A)- Pick up block A from
4. PUTDOWN(A)- Put block A the table and hold it. Precondition-
down on the table. The arm must arm must be empty and there must
be holding block A. be nothing on the top of A
The Blocks world domain
 Following predicates describe the block world
ON ( A, B )  block A is on block B
ONTABLE(B)- block B is on Table
CLEAR(A)- There is nothing on the top of block A
HOLDING(A)- Robot arm is currently holding block A
ARMEMPTY- The arm is holding nothing

 Various logical statements are true in the blocks world


[x : HOLDING (x)]   ARMEMPTY
x : ONTABLE ( x)  y : ON ( x, y )
x :[y : ON(y, x)]  CLEAR(x)
Components of a planning system
 Planning can also be viewed as searching of various
operators that can be applied at current state to obtain new
state .
 There must be a component to perform following functions
1. Choose the best rule to apply next based on the best available
heuristic information
2. Apply the chosen rule to compute the new problem state that
arises from its application
3. Detect when a solution has been found
4. Detect dead ends so that they can be abandoned and the system’s
effort directed in more fruitful directions.
5. Detect when an almost correct solution has been found and
employ special techniques to make it totally correct.
Components of a planning system
 Choosing a rule to apply-
 if several rules are available, then find the best rule by
exploiting the heuristic information. The chosen rule
must allow to reduce the difference between current
state and the goal state, in planning procedure.
 Applying rules-
 Each rule has a precondition and consequent
 Frame axioms – are axioms that describes the situation
after application of the rule, are used.
 STRIPS- a robot problem solving system uses frame axioms
STRIPS-Stanford Research Institute Problem
Solver
 STRIPS is developed in 1971, by Fikes and Nilsson
 Each operation is described by list of new predicates
that the operator causes to become true and a list of
old predicates that it causes to become false.
 These two list are called as ADD and DELETE lists,
respectively.
 A third list must also be specified for each operator
called PRECONDITION. It lists predicates that must
be true for the operator to be applied.
 Any predicate not included in either ADD or
DELETE is assumed to be unaffected by it. Thus,
unrelated things need not be considered.
STRIPS- Style operators for blocks world
domain
STACK ( x, y )
P: CLEAR(y)  HOLDING(x)
D: CLEAR(y)  HOLDING(x)
A: ARMEMPTY  ON(x,y)

UNSTACK ( x, y )
P: ON(x,y)  CLEAR(x)  ARMEMPTY
D: ON(x,y)  ARMEMPTY
A: HOLDING(x)  CLEAR(y)
PICKUP( x)
P: CLEAR(x)  ONTABLE ( x)  ARMEMPTY
D: ONTABLE ( x)  ARMEMPTY
A: HOLDING(x)
STRIPS- Style operators for blocks world
domain
PUTDOWN( x)
P: HOLDING( x )
D: HOLDING( x )
A: ONTABLE(x)  ARMEMPTY
The situation in blocks world can be descrtibed as
ON(A,B)  ONTABLE(B)  CLEAR(A)

After applying operator UNSTACK(A,B), the description


A of the world would be
B ONTABLE(B)  CLEAR(B)  HOLDING(A)
Components of a planning system
 Detecting a solution-
 Planning procedures transforms a given state into another by
application of operators. How will it know it has done?
 If the states are described with the help of properties, the
matter becomes difficult
 Using predicate P(x), the goal state is described and it is
tested for termination of planning procedures.
 There can be multiple goal states e.g ON(A,B)

A
B A
B C
Components of a planning system
 Detecting dead ends-
 Planning procedures searches for sequence of operators
to solve a problem.
 It must able to detect, when exploring a path that never
lead to a solution (or at least unlikely to lead to one).
This fact must be true in reasoning forward or backward
Components of a planning system
 Repairing an almost correct solution-
 A bigger problem is decomposed into several sub-
problems. But combining solutions of several sub-
solutions may not yield the solution to original
problem. Thus, following alternates are used.
 1. Throw that solution- wasted efforts
 2. If the difference between two sub-solutions A and B is
greater than zero, then call problem solving system to
eliminate this difference.
 3. Try more appropriate operators
 4. Keep the problems as it is till the last moment. Then
when as much info as possible is available, then complete
the solution (eliminate the difference). This approach is
called least commitment strategy.
Goal stack planning
 This approach is used in STRIPS
 The problem solver makes use of a single stack that
contains both goals and operators, that has been
proposed to satisfy those goals.
 The problem solver relies on a KB that describes the
current situation and a set of operators described as
PRECONDITION, ADD, DELETE lists
Goal stack planning-working
Start Goal

B C B
A C D A D

ON(B,A)  ON(C,A) 
ONTABLE (A)  ON (B, D) 
ONTABLE(C)  ONTABLE(A) 
ONTABLE(D)  ONTABLE(D)
ARMEMPTY
When we start solving this problem , the goal stack is simply
ON(C,A)  ON (B, D)  ONTABLE(A)  ONTABLE(D)
We want to separate this problem into 4 sub problems, one for each
component of the original goal
Goal
Start
stack planning-working
Goal

B C B
A C D A D

ON(C,A)  ON (B, D)  ONTABLE(A)  ONTABLE(D)


Two of the sub-problems ONTABLE(A) and ONTABLE(D) are
already true in the initial state. Thus, we will work for remaining two

Depending on the order in which we want to solve sub-problems two goal


stacks are possible. Let OTAD=ONTABLE(A)  ONTABLE(D)

ON(C,A) ON(B,D)
ON(B,D) ON(C,A)
ON(C,A)  ON(B,D)  OTAD ON(C,A)  ON(B,D)  OTAD
Stack 1 Stack 2
Goal stack planning-working
 At each step of the problem solving process, the top of
the stack will be pursued.
 When a sequence of operators that satisfies it is found,
that sequence is applied to the state description,
yielding new description.
 The process continues till the goal stack is empty.
 The last check is the original goal is compared with
the final state derived from the application of chosen
operators.
Goal stack planning-working
On the stack we have ON(C,A) which is not true. Thus, will find
operators that could make it true. Out of 4 operators we are
considering (stack, unstack, pickup, putdown) only STACK(C,A)
can make it possible and thus replace ON(C,A) by STACK(C,A)
ON(C,A)
ON(B,D)
B
A C D ON(C,A)  ON(B,D)  OTAD

Our new stack will be STACK(C,A)


ON(B,D)
ON(C,A)  ON(B,D)  OTAD

But, in order to apply operator STACK(C,A), its precondition


must hold so we must establish them as sub goals
CLEAR(A) Thus, our new goal stack will be
HOLDING(C)
CLEAR(A)  HOLDING(C)
STACK(C,A)
ON (B, D)
ON(C,A)  ON(B,D)  OTAD
Goal stack planning-working
CLEAR(A) Next we check that CLEAR(A) is not true
HOLDING(C) and only operator that can make it true is
CLEAR(A)  HOLDING(C) UNSTACK(B,A) and thus, our new goal
STACK(C,A) stack will be
ON (B, D) UNSTACK(B,A)
ON(C,A)  ON(B,D)  OTAD HOLDING(C)
CLEAR(A)  HOLDING(C)
STACK(C,A)
B
A C D ON (B, D)
ON(C,A)  ON(B,D)  OTAD

Apply preconditions of UNSTACK(B,A) which are


ON(B,A), CLEAR(B) and ARMEMPTY. Thus our
ON(B,A) goal stack will be
CLEAR(B)
ARMEMTY Now we will compare top of stack ON(B,A) with our
HOLDING(C) model and learn that it is satisfied so we will pop the
CLEAR(A)  HOLDING(C) stack till ARMEMPTY.
STACK(C,A)
ON (B, D)
ON(C,A)  ON(B,D)  OTAD
Goal stack planning-working
HOLDING(C)
Our goal stack at this point will be CLEAR(A)  HOLDING(C)
STACK(C,A)
We now try to solve the goal HOLDING(C), but it is ON (B, D)
not true. It can be made true by operator PICKUP(C) ON(C,A)  ON(B,D)  OTAD
and thus add preconditions of PICKUP(C) on stack,
which are CLEAR(C)^ONTABLE(C)^ARMEMPTY

Our goal stack at this point will be


ONTABLE(C) and CLEAR(C ) are true, thus pop
ONTABLE(C)
them. But ARMEMPTY is not satisfied since
CLEAR(C)
ARMEMPTY
HOLDING(B) is true (due to UNSTACK(B,A)). TO
CLEAR(A)  HOLDING(C)
make ARMEMPTY as true we will use STACK(B,D),
STACK(C,A) since it is in the goal. Apply all the preconditions of
ON (B, D) STACK(B,D) to the stack CLEAR(D)
ON(C,A)  ON(B,D)  OTAD HOLDING(B)
CLEAR(D)^HOLDING(B)
STACK(B,D)
CLEAR(A)  HOLDING(C)
STACK(C,A)
ON (B, D)
ON(C,A)  ON(B,D)  OTAD
Goal stack planning-working
 At some stage our stack will look like
CLEAR(D)
At this point problem solver will halt and UNSTACK(B, A)
produce a plan with following actions in CLEAR(D)^HOLDING(B)
the specified order STACK(B, D)
1. UNSTACK(B,A) ONTABLE(C)  CLEAR(C)  ARMEMPTY
PICKUP(C)
2. STACK(B,D)
CLEAR(A)  HOLDING(C)
3. PICKUP(C) STACK(C, A)
4.STACK(C,A) ON (B, D)
ON(C,A)  ON(B,D)  OTAD

Start
Goal

B
A C D C B
A D
Introduction to Artificial Neural networks
Human Brain

-Basic computing unit


“Neuron”
- A neuron is connected to
several other neurons
- The connection is called
“synapse” and its property
is “synaptic weight”
- Neurons communicates
with electrical impulses of
short duration with milli-
electron-volt
Human brain is massively parallel - Statistics
processor - Neurons=10^11
- Synapse= Trillions= 10^18
Why to study ANN?
 Consider intelligence exhibited by some
animals.
 Consider a problem of identifying a photo of a
familiar person from the group photo requires
considerable time or hours for a
supercomputer (using fastest H/W and fastest
algorithm). But the Dogs can recognize their
masters in 10 m sec from a crowd.
 Who is intelligent?
Why to study ANN?
 Echo locating bat.
-It is a bird, who don’t have
“eyes” instead echo sensors.
-Mostly active in night.
-Eats insects near by the trees.
-How they catch their traget?.
-They capture reflection of an
emitted rays from target to
detect it.

Echo locating bats are several times intelligent than


the well designed radar systems in terms of HIT ratios.
Why ANN?
 Visual and audible pattern recognition is found most
difficult with the machines.
 Animals are intelligent than the computers, which are
inspired from human brain.
 This fact motivated scientists to study the brain.
 ANN is outcome of such a sincere study.
 ANN is a new way of computation called neuro-
computing as opposed to digital computing.
 ANN system works like human brain that has
capability to learn and reason.
Human brain and Machine
 Human Brain Machine
 1. Outperform in 1. Outperform in precise
cognitive tasks. calculatory task.
 2. Basic computation
unit (neuron) is non- 2. Basic computational
linear. unit is linear.
 3. Switching speed is 3. Switching speed is 10-9
order of 10-3 (msec) (pico sec)
 4. Massively parallel 4. Few processor
processor (1011)
 5. Consumes less power 5. Consumes more power.
Structure Of Human brain
 Human brain consists of 1011 computational units
called “neurons”. (which is approx. the number of
stars in Milky Way!!) Each neuron is connected to
at least 104 other neuron with “synaptic link”.
 Neurons communicate with each other in terms of
electrical impulses generated by a biochemical
process. Thus brain can be considered as densely
connected network conditioned by bio-chemical
process.
Biological neuron
 The elementary nerve cell is called a neuron,
which is the fundamental building block of the
biological neural network.
 A neuron has three major regions 1) Dendrites
2) Axon and 3) Cell body
 Dendrites forms a dendritic tree, which is fine
bush of thin fibers around neuron body (see
and draw fig.).
 Dendrites receives information to the neuron
and thus are acting as input channels.
Schematic of biological neuron
model.
dendrites

Axon

Cell body, Soma


synapse
Terminal arborization

Dendrite of other neuron


Biological neuron
 Neuron throws its output on Axon, which can
be treated as output channel of neuron.
 Dendrites of a neuron are connected to axons of
another neighboring neurons.
 End part of Axon splits into fine arborization (
arbo-means tree in Latin)
 The axon-dendrite contact organ is called a
synapse. The synapse is where the neuron
introduces its signal to another neuron.
Biological neuron

Synapse

Connected neurons
General neuron Model
 In, general neuron model input is given as
vector x, weights are represented with vector w
and output o is function of net.
 The net input, net or internal activity level of
neuron is calculated as

n
net   wi xi
i 1
General neuron model.
w  [ w1 , w2 ,..., wn ] weight vector

x  [ x1 , x2 ,..., xn ] Input vector wi  any value


w1
x1 for i  1,2,..., n
w2
x2 O
f ()

Transfer function
f (.)  Activation function
wn
xn n
net  w x
i 1
i i

O  f (net )
Activation functions
 Based on sign of output they are of two type
 Unipolar (either positive or negative)
 Biploar (both positive and negative)

 Based on nature of function they are of two


type
- Continuous
- Discrete
 Thus unipolar continuous, bipolar
continuous, unipolar discrete and bipolar
discrete are possible types.
Activation functions
 General neuron model is commonly used in
ANN literature but can use different activation
functions.
 Some of the activation functions are shown
below.
Bipolar Binary-Activation function
 1 if net  0 Undefined for net=0
f (net )  sgn( net )  
 1 if net  0

+ve
f (net )

net

Signum function -ve


Unipolar Binary-Activation function
 1 if net  0
f (net )  
 0 if net  0

+ve
f (net )

net
How neuron learns?

 It learns by adjustment of its weights. Weights


are adjusted to reduce the error in desired
output and actual output of a neuron.
 Various learning rules are used to update the
weights based on mode of learning i.e
supervised or unsupervised learning
Philosophy of Learning
Error
Initial weight vector

Local minima Global minima

Weight vector
Error

w2 Error surface

w1
Figure : Hypothetical 2-D error surface
Perceptron Learning Rule

 Invented by Rosenblatt (A psychologist) in


1958. It is the first neural network.
 It is supervised.
 Learning signal is the difference between
desired output and actual output. (dk-ok)
 This rule can be stated as
k 1
Wi  Wi  Wi
k

k 1
Wi  Wi  c  r  x
k k

k 1
Wi  Wi  c  (d k  ok )  x
k k
Diagram of Perceptron LR
Explain role of learning rate
x1
w1
x2 w2 TLU

. ok

net
. wn Wi
xn
x dk

(dk-ok)

c
Features of Perceptron LR

 Learning:-Supervised.
 Weight initialized:- ANY
 Neuron type:- Binary (uni and bipolar )
 Used:- Classification and recognition
Problem.
Initial weight vector W1=[1,-1,0,0.5]
Use Perceptron Learning rule to
update weights for following three
inputs use c=1 and signum
function if the desired outputs are
1,-1 and 1 respectively

X1=[1,-2,1.5,0]
X2=[1,-0.5,-2,-1.5]
X3=[0,1,-1,1.5]
Answer

1. w=[ 1,-1,0,0.5]
2. W=[-1,0,4.0, 3.5]
3. W=[-1.0,0,4.0, 3.5]
Applications of neural network
 Pattern classification/ Recognition/clustering
 Prediction and forecasting
 Fault diagnosis.
 Correlation.
Advantages of neural networks

1.Capability to learn and learn on fly.


2. Superior for cognitive task.
3. Fault tolerant ability.
Reference Book:-
Title:- “An introduction to Artificial neural systems”
– By Jacek M. Zurada.
Single layer Perceptron Classifiers
wi , j - weight connecting jth input to the ith neuron
w1,1
x1 o1
w1,2

x2
w1,3
o2
x3 w1,n
. .
.
w1,( n 1)
.
xn
oR

bias  1 wn1  Threshold


Representation of pattern classes
1. Local :- each neuron represents a class
2. Global:- a specific output of all the neurons
represents a class
Weight matrix W is of size R x (n+1)
 w1,1 w1,2 ... w1,( n 1) 
w w2,2 ... w2,( n 1) 
W 
2,1

 .. .. .. .. 
 
 wR ,1 wR ,2 ... wR ,( n 1) 

Desired output d i is of size (R x 1)

 di ,1 
d 
di   
i ,2

 .. 
 
 di , R 
R- class Single layer discrete Perceptron training
algorithm
R- class Single layer discrete Perceptron training
algorithm

 Pattern classes must be pairwise linearly separable

 For non-linearly separable patterns we need multi-layer neural


networks
Multi-layer perceptron
x1

x2

Input
input layer Output

Output layer
xn

Hidden layers

Error back propagation training algorithm is used


53
A sample 3 –layer neural network architecture for handwritten
digit recognition

Reference:- http://neuralnetworksanddeeplearning.com/chap1.html
Deep Learning Neural networks
• Neural networks/Architectures with thousands of hidden
layers are called “deep architectures” and their learning is
called “deep Learning”
• They need considerable computing power and thus generally
implemented on high performance computing platform
(>1 TFLOPS) with many CPUs and GPUs
• Human brain is itself a deep architecture which is motivation
behind deep learning.
• Deep learning machines exhibited super human capabilities
for a specific cognitive tasks.
• Tensor Processing Unit (TPU) is designed specifically for
deep learning architectures with library “Tensor Flow”. TPU
is highly optimized for tensor operations.
• Some new NVIDIA GPUs also provide “Tensor Cores” for
accelerating tensor operations on GPU (e.g Tesla V100, has
640 tensor cores and provides 100 TFLOPS)
Course code: IT4006
(Uncertainity) (7 Hrs)

Dr. Priyadarshan S. Dhabe,


Ph.D, IIT Bombay,
Assistant Professor in Information Technology
Syllabus-
 Non Monotonic Reasoning, Logics for Non
Monotonic Reasoning, Justification based Truth
Maintenance Systems, Semantic Nets, Statistical
Reasoning.
 Fuzzy logic: fuzzy set definition and types,
membership function, designing a fuzzy set for a given
application.
 Probability and Bayes’ theorem, Bayesian Networks.
Non-monotonic reasoning

 Definition:-
 Reasoning effectively even when complete, consistent and constant
model of the world is not available. (Read ABC murder story from Rich
and knight page 195)
 Conventional systems (first-order predicate logic) are designed to work
systems that has three properties.
 Completeness:- It is complete wrt to domain of interest
i.e all the facts necessary to solve a problem are either present in the
system or can be derived
 It is consistent.
 New facts added never contradicts previous one
 If any one of the property is not satisfied then conventional logic
system becomes inadequate.
 Reasoning under uncertainty is called non-monotonic
reasoning/Defeasible Reasoning.
Non-monotonic reasoning and statistical
reasoning

 Reasoning in which the axioms and/or rules of


inference are extended to make it possible to reason
with incomplete information. At any moment a
statement is believed to be true, false or not believed
to be either.
 Statistical reasoning- in which representation is
extended to allow some kind of numeric measure of
certainty (rather than only true or false) to be
associated with each statement.
What is Monotonicity???
Let  be the set of formulae and  ' be the superset
of , (i.e    ' ) ( ' is  plus some other facts)
then
If    (i.e if  is logically followed from )
then it is also true that  '  .
Interpreta tion : -  and  ' are consistent ( monotonici ty)

https://plato.stanford.edu/entries/logic-nonmonotonic/
Logics for Non-monotonic reasoning

 Non-monotonic logic
 Default logic
 Abduction
 Inheritance
 Closed world assumption
https://plato.stanford.edu/entries/logic-nonmonotonic/

The term "non-monotonic logic" covers a family of formal frameworks devised to


capture and represent defeasible inference, i.e., that kind of inference of everyday
life in which reasoners draw conclusions tentatively, reserving the right to
retract them in the light of further information. Such inferences are called
"non-monotonic" because the set of conclusions warranted on the basis of a given
knowledge base.
Logics for Non-monotonic reasoning

 Non-monotonic logic:- is extension to the language


of predicate logic with model operator M, which can
be read as “is consistent”
x,y:Related(x,y)  M GetAlong(x,y)  WillDefend(x,y)

Problems:-
1.What is meaning of “is consistent”? is un-decidable in first
order logic
2. Multiple non-monotonic statements taken together may be
inconsistent
Logics for Non-monotonic reasoning
2. Multiple non-monotonic statements taken together may be inconsistent

x: Republican(x)  M Pacifist(x)  Pacifist(x)


x: Quaker(x)  M Pacifist(x)  Pacifist(x)
Republican(Joe) Pacifist ( Joe)

In-
consistent
Quaker(Joe) Pacifist ( Joe)

Pacifist- A person believing that war and violence are


unjustifiable
Quaker- A peaceful religious person
Logics for Non-monotonic reasoning
 Default Logic:- An alternative logic used for performing
the reasoning based on default assumptions. Proposed
by Canadian logician Raymond Reiter. It provides a new
inference rule of the form.

A: B
C
If A is provable and it is consistent to assume B then
conclude C

Bird ( x) : Flies ( x) Default rule about the birds

Flies ( x)
Logics for Non-monotonic reasoning
 Abduction:- is using the implication in reverse order
x : Engineer ( x)  Literate( x)
Engineer ( Ram) we can deduce Literate(Ram)
Given Literate(Shyam) we can infer Engineer(Shyam)
by Abduction (Abductive reasoning)
Abduction- deriving conclusions even though they are not more
appropriate

Malaria  Hydroxychl oroquine


Covid19  Hydroxychl oroquine
Logics for Non-monotonic reasoning

 Inheritance:- “ An object inherits attribute values


from their classes”. In a broader way

BaseBall  Player ( x) : height(x, 6)


height(x, 6)

•Closed world assumption


(i.e Reasoning based on everything you don’t know is false)
e.g. 1 Is there water on planet Mars? No
2. If there is no direct flight between Pune to Kanpur in
the database; travel agent will say no flight assuming
database as complete .
Statistical reasoning

 Statistical reasoning tools


 Fuzzy logic
 Probability and Bay’s theorem
Need of Fuzzy Logic

 Human brain computes with imprecise


information. (9.1435+10.1111234=~20)
 Uncertainty is related with most of the
information used for computation.
 Precise information is rarely available and not
needed for most day to day problem solving
 Some facts involve vague terms like “More”,
“Better”, “Taller” etc.
 Some task can not be performed in a precise
manner. e.g classifying Good/bad persons
Uses of Fuzzy sets and fuzzy Logic

 To provide a way for representing imprecise


things
 To handle uncertain situations other than
randomness.
 To capture vagueness in natural languages.

In domain wit h n events randomness is


1.P ( E1 )  P( E2 )  ...  P( En )
2.P( E1 )  P( E2 )  ...  P( En )  1
Uses of Fuzzy sets and fuzzy Logic
 Handling uncertainty other than randomness

Uncertainity

Randomness

What happens ??? if


1.P( E1 )  P( E2 )  ...  P( En )
2.P( E1 )  P( E2 )  ...  P( En )  1
Introduction to Fuzzy sets
 Set theory; which we have been using was
proposed by a German mathematician George
Cantor in 1870.

 Sets with which we are already


familiar are termed as crisp set.
 The membership function of crisp set
returns only two values, either 1 or 0.
1- member A  {1,2,3}
0- Non meber.  A( 2)  1 and  A(5)  0
Introduction to Fuzzy sets
 Fuzzy means imprecise/vague/difficult to perceive
 Prof. Lotfi Zadeh, 1965, university of California,
Berkley, proposed “Fuzzy sets”, which are
generalization of crisp sets, such that
membership function returns values in interval
[0,1], including ZERO and ONE.
 1- means a full member
 0-non member
 O<membership<1 -Partial members
Fuzzy membership function
 A function that takes input x and returns out put
as membership grade [0,1], for it is called as fuzzy
membership function.

 A( x ) -Read it as “ membership of
input x in the fuzzy set A”

https://www.researchgate.net/figure/Difference-between-Crisp-and-Fuzzy-
Sets_fig6_311419824
Plot of fuzzy Membership function

 A( x )
1

x
Types of fuzzy sets
 There are 4 types of fuzzy sets based on the nature
of fuzzy membership values.
 Normal fuzzy sets
 Subnormal fuzzy sets
 Convex fuzzy sets
 Non-convex fuzzy sets

Normal fuzzy set:- A fuzzy set is called as


normal fuzzy set, if at least one of its member
has attained highest membership value 1, other
wise it is called as subnormal fuzzy set.
Normal and Subnormal fuzzy sets
 A( x )  A( x )
1 1

0 0

x x
 A( x )  A( x )
1 1

0 0

x x
Convex and non-convex fuzzy sets

 Convex fuzzy set:- A fuzzy set is called as convex


fuzzy set if the membership values are either
monotonically increasing or monotonically
decreasing, otherwise it is called as non-convex
fuzzy set.
 The property of monotonically increasing or
decreasing is called convexity.
Convex and non-convex fuzzy sets

 A( x )  A( x )
1 1

0 0

x x
 A( x )  A( x )
1 1

0 0

x x
How to define Fuzzy sets.
 A fuzzy set with finite members having
non-zero membership is represented as
 0.4 0.6 1 
A  , , 
 1 2 3

 Ifthe there are infinite members having non-zero


membership then use a fuzzy membership function
to define the fuzzy set as shown below

 A( x )  { formula containing x
Operations on fuzzy sets

 Following are the operation on fuzzy sets


 1. Union
 2. Intersection
 3. Compliment
Union of two fuzzy sets
Let A and B be two fuzzy sets, then their
union is defined as

 A B ( x)  max (  A( x ) ,  B ( x ) )
Intersection of two fuzzy sets

Let A and B be two fuzzy sets, then their


intersection is defined as

 A B ( x)  min (  A( x ) ,  B ( x ) )
Compliment of a fuzzy set

Let A be a fuzzy set then its compliment


can be defined as

 A ( x)  1   A( x )
Exercise 1 on Fuzzy sets
Consider following fuzzy sets A and B
 0.4 0.1 0.55 0.6 .7   0.5 0.6 0.7 0.7 
A , , , ,  B , , , 
 1 2 3 4 5  4 5 6 7 

1. Compute following things


1. Intersection of A and B
2. Union of A and B
3.Compliment of A and compliment of B
2. Which of the fuzzy set A and B is Normal? Why?
3. How can we prove that fuzzy set B is convex?
Fuzzy Membership values

 Are used to reason about similarity of a test


condition with previously known situations.
 Can be used to reason about class label of a test
pattern using previously learned patterns.
 Washing machine to decide initial torque based on
weight of cloths.
 Fuzzy controllers to take better decisions than crisp
controllers.
1.Design a fuzzy set for numbers close to 5
Let A be the fuzzy set & x be a number whose
membership is to be calculated

 5 x
 1 if   0
 max( x,5) max( x,5)
 5 x 5 x
 A ( x)  1    if 0    1
 max( x,5) max( x,5) max( x,5) max( x,5)
 5 x
 0 if   1
 max( x,5) max( x,5)
Role of sensitivity parameter gamma

 A( x ) Core part

 3
 1
0

Support
x
2. Fuzzy set for HCR matching
Vref  (a1 , a2 ,..., ak )
a i - is the ith feature

Vtest  (b1 , b2 ,..., bk )


Distance d between tw o images
can be computed as
1 k
d   (ai  bi )
k i 1
2. Fuzzy set for character matching

-A and B are characters to be matched

1 if   d ( A, B)  0

 A ( x)  1    d ( A, B) if 0    d ( A, B)  1
0 if   d ( A, B)  1

-d-isthe Euclidean distance between


features of character A and B
1. Problems on operations on fuzzy sets
2. Problems on fuzzy set design.

Reference
 Book
 “fuzzy logic with engineering
 applications”
-By Timothy J. Ross
Structured Knowledge Representation

 Weak slot and filler structures


 Semantic Nets
 Frames.
 Strong Slot and Filler structures
 Conceptual dependency
 Scripts.

A baby dog is called as __________


What are “Slot and filler structures”?

 They provide a way of representing real world


facts in a more structured manner than
predicate logic (unstructured).
 Used for representing entities and their
attributes.
 They supports inheritance along isa and
instance.
 Inheritance can be performed more easily
than the pure logic.
 They support object orientation.
Weak and strong structures.

 Weak slot and filler structures:-


if they do not have straight forward method of
reasoning (semantic nets, frames)
 Strong slot and filler structures:-
they have straight forward method of reasoning
(CD, Scripts)
Semantic net

 Basic philosophy- “Meaning of a concept comes


from the way in which it is connected to other
concepts”.
 In semantic net knowledge is stored as set of
nodes connected to each other by a set of arcs.
 Arcs represents relationship and nodes
represents class, subclass or object.
Represent above facts using semantic net.

isa ( person, mammal)


insatnce(abc, person )
haspart ( person, nose)
bike(abc, honda)
uniformcolor (abc, blue )
Binary predicates
mammal

isa
Has a part

def person nose


instance
instance

blue abc honda


Uniform
bike
color

haspart (def , nose) Can be easily


inferred
instance (def , mammal)
Intersection search in semantic net
 In semantic net intersection search is used to find
out relation between any two nodes.
e.g. what is relationship between “mammal” and “nose”.
mammal

isa
Has a part

def person nose


instance
instance

blue abc honda


Uniform
color
Another example

http://www.eecs.qmul.ac.uk/~mmh/AINotes/AINotes4.pdf
Representing multi-arity predicates in semantic net
gives(John, Mary, Book)

http://www.eecs.qmul.ac.uk/~mmh/AINotes/AINotes4.pdf
Problem on semantic net

 Represent following fact using semantic net.


 “Hilbert is a hippo. Like other hippos he eats grass and
likes swimming”.
Partitioned Semantic net.

 They are used to represent universally quantified


facts.
 In Partitioned Semantic net, each partition
corresponds to scope of variable and spaces are
hierarchically classified.
Statement “The dog has bitten a postman” can be
represented with a semantic net without partition as
follows.

Dogs bite postman

isa isa isa

d b m
actor victim
Statement “Every dog has bitten a postman” can be
represented with a semantic net partition as follows.
Existentially
Universal sets instances quantified

SA

GS
Universally
quantified Dogs postman
bite
isa

form
isa isa isa

g d b m

 actor victim s1
GS is a set of general statements in this
universe.
-Every element of GS has two attributes
1. A form:- which states a relation.
2. one or more “for all” 
connectives, for each universal
quantifier.
Advantages and drawbacks of Semantic net.

Advantages
1. Explicit and easy to understand
2. Support default reasoning in finite time
Drawbacks
1. Incomplete to handle procedural knowledge
2. Not temporal can not define sequence and
time
Conceptual Dependency (CD)
- CD is proposed as a model of Natural Language
Understanding (NLP) By Roger Schank, in 1969 at
Stanford university.
-Motto
-Used to acquire knowledge from natural language input
– “Two sentences identical in meaning, would have a
single representation”
-Knowledge representation is independent of language.
- Allow inferences
- Knowledge is represented using conceptual primitives
and dependencies

https://en.wikipedia.org/wiki/Conceptual_dependency_theory
https://users.cs.cf.ac.uk/Dave.Marshall/AI2/node69.html
Conceptual Dependency (CD)
Following are the primitive acts used in CD
ATRANS -- Transfer of an abstract relationship. e.g. give.

PTRANS-- Transfer of the physical location of an object. e.g. go.

PROPEL-- Application of a physical force to an object. e.g. push.

MTRANS-- Transfer of mental information. e.g. tell.

MBUILD-- Construct new information from old. e.g. decide.

SPEAK -- Utter a sound. e.g. say.

https://www.slideshare.net/JismyKJose/conceptual-dependency-70129647
Conceptual Dependency (CD)

Following are the primitive acts used in CD

ATTEND-- Focus a sense on a stimulus. e.g. listen, watch.

MOVE-- Movement of a body part by owner. e.g. punch, kick.

GRASP-- Actor grasping an object. e.g. clutch.

INGEST-- Actor ingesting an object. e.g. eat.

EXPEL-- Actor getting rid of an object from body. e.g. Cry.


Conceptual Dependency (CD)
Following are the Conceptual categories used in CD

PP-- Real world objects. (picture producers)

ACT-- Real world actions. (any one primitive act)

PA -- Attributes of objects. (picture aiders)

AA -- Attributes of actions. (action aiders)

T-- Times.

LOC-- Locations.
Conceptual Dependency (CD)
Other components used in CD
- Arrows indicates direction of dependency ()
-Double arrow indicate two way link between
actor and action ( )
- O- for object case relation
- R-Recipient case relation
- P-for past tense
-D-for destination
Conceptual Dependency (CD)
Following tense and moods are used in CD
p Past tense
f Future tense
t transition
ts Start transition
tf Finish transition
k continuing
? interrogative
/ negative
Absence of any modifier
indicates present tense
Rules in Conceptual Dependency (CD)

Rule 1: PP  ACT
Relationship between actor and action . A p/f
written on link indicates tense.
p
ex1. John ran John  PTRANS
f
ex2. John will run John  PTRANS

Rule 2 : ACT  PP
Relationship between act and PP (object).

o
ex1. John pushing bike John  PROPEL  bike
Rules in Conceptual Dependency (CD)

Rule 3 : PP  PP
Relationship between two PPs (objects)
ex1. John is a doctor John  doctor

Rule 4 : PP  PP
Relationship between two PPs (objects), one
provides info to other of 3 types
1. POSS-BY- possession POSS- BY
2. LOC- location ex1. John' s dog dog  John
3. CONT- physical containment LOC

-Arrow is towards concept 2. Train at Pune Pune  train


CONT
3. Pen is in the pocket pocket  pen
Rules in Conceptual Dependency (CD)

Rule 5 : PP  PA
Relationship between PP (object) and PA
(attribute or state of PP)
ex1. John is fat John  weight ( 80)

Rule 6 : PP  PA
Relationship between PP (object) and PA
(attribute of PP)
ex1. Smart John John  smart
Rules in Conceptual Dependency (CD)
 PP ( to)
Rule 7 : ACT  R
 PP ( from)
Relationship between ACT and source and recipient
of the act PP (object) . R indicate recipient case
relation
ex1. John take the book from mary

John
(to)
John  ATRANS  R
0
Mary
book (From)

https://www.slideshare.net/JismyKJose/conceptual-dependency-70129647
Rules in Conceptual Dependency (CD)
 PA( to)
Rule 8 : PP 
 PA( from)

Relationship between attributes (PA) of an object


(PP)
ex1. Tree grows

 size c
tree 
 size c
Rules in Conceptual Dependency (CD)
{x}
Rule 9 : 
{y}

Relationsh ip between one concept


to other that causes it
i.e {x} causes {y}
{x} Bill shot Bob

{y}Bobs health is poor
https://www.slideshare.net/JismyKJose/conceptual-dependency-70129647
Rules in Conceptual Dependency (CD)

{x}
Rule 10 : 
{y}

Relationsh ip between one concept


to other that is happening when one is in progress
i.e {y} is happening while {x} in progress
{x} while going home

{y}I saw snake

Reference-
https://www.slideshare.net/JismyKJose/conceptual-dependency-70129647
Inferences in Conceptual Dependency (CD)

Inferences can be taken directly from


primitive ACT
-Inferences are stored with primitive acts
-INGEST
-- Object is no longer in previous form
-- Actor has less hunger now
-- Physical position of object can be changed
and thus PTRANS can be inferred
Conceptual Dependency (CD)
Advantages
-Using primitives need fewer inference rules (IR) and IR are
represented in CD structure
- Stores knowledge in a language independent manner
- Multiple statements using different words having same
meaning use same representation
Disadvantges
-Difficult to find correct set of primitives for a situation
-Knowledge must be decomposed in to low level primitives
-Representation of even a simple sentence can be very
complex in CD
CD theory is used in MARGIE (Memory, Anlysis, Response
Generation and Inference in English) system developed for
NLP
http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.73.9307&rep=rep1&type=pdf
Reading list
 Justification based truth maintenance system
 Bays theorem and conditional probability
 Bayesian networks
Probability and Bays’ theorem
Exercise 1 on Fuzzy sets

https://youtu.be/fQtWxEJazuo
intro to fuzzy sets

https://youtu.be/qKOyFr7dRrY

Consider following fuzzy sets A and B

 0.4 0.1 0.55 0.6 .7   0.5 0.6 0.7 0.7 


A= , , , ,  B= , , , 
 1 2 3 4 5  4 5 6 7 

1. Compute following things

1. Intersection of A and B

2. Union of A and B

3.Compliment of A and compliment of B

2. Which of the fuzzy set A and B is Normal? Why?

3. How can we prove that fuzzy set B is convex?

Pl. circulate my slide handouts for the current weekly plan.

1. Study Resolution in predicate logic(as

we already learnt about propositional logic) and the unification process.

2. Following examples of resolution need to be studied carefully


a. Joe, sally, Bill and Ellans example

b. Example of Marcus

c. West is a criminal example

3. For AI LAB i suggest to use SWI-PROLOG tutorial and write your own expert system for any
real application (PROLOG-2 lab assignment). It should not be copied from internet sources.
Prolog 1 lab assignment is exercise of KB1 to KB5. I will set its deadline as 23 rd March for both
lab assignments.

4. brushup fundamentals of predicate logic, conversion to clause form and etc

Pl. circulate this message in your class.

All AI students are informed to prepare a short note about "Difference between resolution in
propositional and predicate logic". Complete it by 23 rd March. You are also informed to
complete AI home assignments. Contact me for problems, if any

Circulate this email in your class.

All AI students are informed to complete the following portion of module -5 Lecture on 23 rd
March(planning and ANN). - Planning definition, Blocks world domain, Components of planning
system, STRIPS- operations, ADD, DELETE and PRECONDITION lists associated with each
operator. Pl. take help of my you tube videos also

Planning and ANN- part1 - https://youtu.be/M12JlHF4I1g

Planning and ANN- part2 -https://youtu.be/Ey40Zj2xzmg

They are not very good videos but can be used for reference purpose in addition to the slides.

Pl. circulate following message in your class.

Prepare a short note on "distinguish between monotonic and non-monotonic reasoning with
some real examples"
Pl. circulate following exercise to your class.

Q.1. Use semantic net to represent the following things. Hilbert is a hippo and like other hippos
eats grass and likes swimming.

Q.2. What is the purpose of partitioned semantic net?

https://youtu.be/UwTZYwJHdzk

intro to semantic net

Dear all;

Solve following class exercise

Pairwise distinguish between following action primitives used in CD

ATRANS, PTRANS

MTRANS, MBUILD

You might also like