0% found this document useful (0 votes)
9 views74 pages

AI Endsem Notes by DK?

The document provides study materials and resources for engineering students, including links to Telegram, WhatsApp, and Instagram channels. It covers topics in propositional and predicate logic, including syntax, semantics, and inference rules, as well as the Wumpus World agent problem in artificial intelligence. Additionally, it discusses knowledge engineering processes and the steps involved in constructing a knowledge base.

Uploaded by

gta4228k
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)
9 views74 pages

AI Endsem Notes by DK?

The document provides study materials and resources for engineering students, including links to Telegram, WhatsApp, and Instagram channels. It covers topics in propositional and predicate logic, including syntax, semantics, and inference rules, as well as the Wumpus World agent problem in artificial intelligence. Additionally, it discusses knowledge engineering processes and the steps involved in constructing a knowledge base.

Uploaded by

gta4228k
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 74

Study material provided by: Vishwajeet Londhe

Join Community by clicking below links

Telegram Channel

https://t.me/SPPU_TE_BE_COMP
(for all engineering Resources)

WhatsApp Channel
(for all Engg & tech updates)

https://whatsapp.com/channel/
0029ValjFriICVfpcV9HFc3b

Insta Page
(for all Engg & tech updates)

https://www.instagram.com/
sppu_engineering_update
clAsSMAte
Date
Page
UNIT-I
Knauledge
* fzapositional Laqic -
ChakacteistHcs -
1 Pscpasthonal loqic is declasative
in) Pxapasthanal lagic allous paxhal disjuncfive
interence

hi Psopositional logic is compositional


n) Meaning in proposiionallogic is context
independant.
Daawbacks
has ioN) imited expiessive pawex

i Soneknauledoe is hazd impossible to encode in


psoposiional lagic.

-
Syatax of Popositanal logic
’ 1) Sumbols -
Theyaxe prapasifiona calcaulus Symbals
) Psediate Symbals
" Used to xepxesent xelaian in daman.

By Dk
domain tother"
cdAsSMAte
EATHER
sumbols uhich discourse
sentence
xepkesent
to in xams
DatePage
entits (xam)
abaut ta
MoTHER
constant FATHER
OK of
massied
ahiects indetinite domain False
be he
axe (Xam)
book!uill
pxedicate xefened is uill
book book (
READS
) in TXue
sepkesent be mather
SumbalL LmoTHER
Aunchon
uant
upIf ds funchans
Sumbals
xeads : sunbals
to be - be
Dk sumbalsand mARRED
Sumbols
C ISeLS Rams
to Can Connectlves
READS ta Dk
"DkSimple is Denate
mARRIED
UsedEq.
onstant m)Vaxiable Finchon
Allau) Eq Tsuth
entity
H) 2
alassMAte
Date
Page

* Connectives -
i) AND Cannective ( a :
.Used to sepxesent Compound statement:
Eq, DR weaxs black dxess "
RS (Dk Dxess) A CoLOUR (Dxess, Black)

Foxmula buit bs cannecting A axe called


Canjunc:tians
ii) OR connecttve (y):
Used to xepresent inclusire Mox"
.Eq DR lass cxicket ax tennis"
PLAYS (Dk Caicket) y PLAYS pk Tennis)

Foxmula built bs cannecting'' axe called


disjunchans
NoT Connectire ( ) :
Used to negate txuth values of omula
change T to FK vice eisa
e EqDk did not xead book" is shoun gs
READ (Dk Book)

iy) If Connectve (’):


" Jsed to sepoesent ifthen statements
Eg "If DR buus shixt, then its caloux
is
black " is shoun asS.

Auys (pk Shiat ’ CoLO0R (Shint Black)


Data
Page

BlCONpITIONAL annective )
Used wheneuex P 8 and P axetauo
Eq Dk beomes happ tt BR eats icecxPam!

(Dk Happy)
BECOMES (Dk, Happy) EATS Dk Tceczeom)

Same legal sentences (WEF's in pxopasifional


logic isSentence
Negation of Sentence
Eg, 1p and false axe Sentence

Conjunction Aot twa sentence is sentence


Eq P A ¬P igentence

Disjunction ('y oF two Sentence is aentence


Eg PV p is Sentence

4) Tmplicatian sentence tram anathex is


Sentence
Eg P’6 isSentence

Eouiuale nce o two sentenceiss sentence


Ea PVQ F R is sentence
Date
Page

Wumpus Wosld Agnt


WumpusWoxldis a classic axifcial intellignce
pxoblem used to demonstxate Vaxious 0spects
based Simulation as well as other AT
Concepts

hlumpus an eaxly Computerqame in which


an
agent had to explore Cave made up tom
Sexies of inteconnected Xooms

PEAS Descaiphan
1 Pofo1mance
Death : - 100o
per step -10 tox usinq

Enuixanment:
Squaxes adjacent to Waumpus Smells.
.Squaxes adjacent to pit Laxe bxeegy
Gittex qald is in Same Squaxe
Shocting kills Wumpus you axe facing it.
It CXeamS
Shoating uses anly axkouw
Gzabbing picks up gold iE in Same squake
Releosing dsops gald in Same squaxe
You 'bumpif yau walk into a wall
Date
Page

l) Actuatoxs
Left tuxn Riq ht tnn oxuaxd guab
xelease shoot

Sensars
Stenchbxeege, gittex bump, Scxeam

"Wampus Woxld chaxactexigahan -


Detexministc :
Yes outcomes eznctly spectied
Static:
Yes hlampis K Pite do natmave

Discxete:
Yes

4) Sngle - Agent
Yes - Waumpus is esentialls angtuual teahure
5) Full Obseuable
No- onls (ocal peaceptian
Bietae
Senh
-B1COge
Pf

o Bic0ae understand
alAsSMAte
Date
Page

t Tnteience Rules in Psopasitional Logic-=


Tnteience xules axe standazd xules that an be
applied to dezie chains of conclusions that lead
to desixed qaal.

4 Modus Ponens -
Tt isxepsesented as,

It meanS that wheneuex any sentences at


and qiven then
Sentence B an be infeed.
.Eq (Signal Pole AheadA Signal Red ’ Stop
le (Signal pale ahead A Signal Red)axe
giren then Stop" can be inteued

2) And- elimination
Tt says that trom conjuncthon any conjuncts
Can be inteed

. Tt s sepsesented. as

Eq (Signal Pale AheadA Slanal Red


Eg
the interence, Siqnal Red" can be draun
ASSMAte
Date
Page.

3) Unit Rescluion IPy 1P]i


"Unit xesolution ule takes
A Clause - A disjanchon ot itexals x
a litenal and pxoduce n e cause

Rule is
R4 v..vli-4 V2it: V. vlk

wherels iteral K m complementaxu.


iterals Iie one ss negahan of ather 11
4 Rosalutian

Unit xesaltion be genexaligd to tull


KeSolition ule.

Rule s

uohere Km Complementag lterals.


deaing uith clauses af length 2
32 can wwsite t as
clAsSMAte
Date
Page

t Resoluion Algosithm -
Tt takes input as knouledae Base (sentence
in pisapositional logic) and oCquey in pxoposihona
logic)
T) Tts autput. is Taue False ie Roouwledqe base
do xesolves
It shows that K8 l=dtox this t wilL
be shoun that (KB A 18

Steps axe
CKB A 1a is tst conueted n CNE

Resolutian xule is applied to NSulting clauses.

© Each paix that contains complementaslitexals


is xesolved to pxoduçe ne clause

This neu clause is added to set not paesent

Step (b) to d) axe Xepeated until one o


tollawing tuo sttuatian accuus

1 Thore ase no neu) clause that can be added


in which case does nat entaila

Appli caticn o xesalution sule deives emptu_douse


a case a entails 6
in uhich
Date
Page

Exet Csdex Logic LPsedicate logic1


expxessive lanquage bich has
" I t is a
Semantics
uell defned suntax and

It USes & thinqs to xepxesent woxld madel:

Relations
i) Funchons

Eg Tuo plus fve Tio,


equals seven
tive, seren
Here ObËects
Relations - equals
Funchon - plus

Psopexties
) I has abilits to xepxesent. tactsabaut some
all of cbiects in universe
Ox all

)T enables SA to sepresent law x xules


extiacted tiam xeal uoxld

usehul lanqunge xepxesentatian in Maths


Philascphs s AT Relds
FoL makes ontalegqcal cammitment
clAsSMAte
Date
Page

Typesof FoL
1Tempoxal Logic.
Tt asSumeS that tacts hold at some paaticulax
fimes
Thesetmes also haue axders

High oxdex laqc


.It vìÇus xelatons fonchans xetered by
FGL chËect in themselves

* Compasison -
Rsaposithanal logic (PL) Pxedicate logic (FoL)
A It deals with simple i) FoL additianally cauers
declaxative pxopasthons pxedicates & quantiicaticn

It is collection ot dec - ) Itis expression c one


lasative senteces that has ox moie vaiables defned
erthex Tsue!! ox l Fase" OnSome ne specifc domain
tauth values

Tt is_ most basic and ) Tt is an extension to


im
widely used logic plapasitionallagie

i It includes ceitaints a s )Tt includes cbjects, funchions


ell as unceitainty &xelations beth obËects
V As different thom PL
seasoning. which lacks quanti£iens
Date
alassmate
Page

i) Tt is nat i) It is camplex due to


compex inclusion af quantties
& pLedicates

Vù) Toterence sules axe hased vi) Toterence sules axe


on tuth table & aules or quantiiers
logical cannective s K pxedicates

* Syntnx tox Fsst Osdex Loqic

madel af logim lanquage axe foxmal stxuctures


that conshtute possible uwosld under consideratian
2) Domain of madel
Tt is nan-- empty sets ot abiects in madel,
also xsetered domaio elements
Relation
- Tt is the aSsociation
Tt s sepresented as Tüple
anang ahjects
4) Funchon
is special tupe at xelation in uhich
gqven cbect. Must be xelatod to exactls
cbject.
alAsSMAte
Date
Page

5) Symbcls
Ihey are Smallest Syntattic element that
stand fox cbiectsselations nchans
Follausinq axe ROL Symbols.:
a Tauth symbals - Töue Fase
b) Constant sumbols A8 Ram Red, etc (Specifed)
c) Yaziable Symbols- X,Y, z te (urspecited cbjects).
d) PxedcateSunbols Stepsiste likes (xelatians)
e) Fanchon symbols - Fathe OE calaxoF (tunctions)
t Semantic of FOL

Once Constant Symbols, selations & tunctions


axe decided, one need the nterpretations to
selate uaxious Symbas FOL

Let Oomain D be non -empts set

An inteipxetation aue Dis assignment oF


entities af 0 to each of constant, paedcate, etc
Such that:

Each constant is casiqned element of D


)
Fach Uasiable s aasigned to non= empts Subset o D

a) Each finctian of aity 'm' is defned on m


arquments ofo
Definesmappingtiom0into
ham
cAsSMAte
Date
Page

4) Each pkedlcate p f abity nia delined an n


axqumentso D &
Rom Dn into EIE
Defnesmapping9
Knauledge Engineesing Its SBeps -
"The pxacess ataF constxucting knauledge base
is calledas knouledoe base engineexing
These knawledae base
base eng1neeangpaject
enqinee sing nsy
widely in Cantent scape dicults
Stepsin Knaualedge Enginsexing Psocess
) Tdentify the task
The knowledge engingex must delineate the
Sanqe of questions
questions that Rnoledqe base will
Rnauledae
Suppost
.Eg, Does he humpus Rnouledqe base need to
be able to choose actions
ns Qx s it xequixed
ansujer auesions
auesions onls abaut content ot
enuisanment
clAsSMAte
Date
Page

L) Assemble the xelevant knowledqe -


This is the
the piocess a knowledae acquisiian

At thisstep, knouledqe is gathered..


This step helps us to undenstand houw domaio

EqEg Tn
Th Wumpus woxldset ot sules xelate d
actions are undestaod in this phase

Decide vocabulaxs of psedicates tunctians


Canstants -
Damain level concepts axe txanslated into logic
level names

The txanslated version ot psablem domain


Rnouledgewil Contain psedicatestunchons
Constants

Encode Rnouledge ahout domain


Knauledge engineex wites doun the aziams
fox all vocabulaiy teims
V) Encode descaiption of Simple psoblem instance
speche atomic sent ences
It invalves wsiting
about instances of vasious concepts paat
ot ontalogy
cAssmate
Date

Page

Eixe quesies to interence pxoceduie get


outputs
Th this txials (demos) of queiuing the
base ase onducted
Rnauledae

v Debuq the knauledaebase


Ansuex to queies wiL seldom he
an fsst

* Waitepxapasitianal legic toxthe statement


i) All bixds t
Evexs- Man Xespects his paxents"

"All bixds
Psedicates
2 bind

The shatement MAl bads fy can be


wstten as

Fox all a i t a isa bisd then


classMate
Date
Page

Evexs man
Psedicates
xespects
axe :
his paxents "
man

a Sespects y
P(,) y is paaent at

The statement Evexs Man xespects his paxents "


iS witten

Fox all a man_then tor all


4is panent ofathen
xespects

Considex follauing axams


IF iseeelees tziangle is isosceles then its tuo
sides A8 and AC equal,
A8 and AC axe equal then angle 8 and C are
equal
ABc is equilatea tiangleat

Repxesent these tacts in Predicate' Logic


) We define the pxedicates
An isosceles tìangle
ECa) -D S an equilateral thiangle
o
Sa,y,z)- yKz ae sides o tiangle
lassmate
pate
Page

eqla,bl and b axe equal


equalL
eangle (a, b) AnglesLa and b aue
aqual
T Nau me xepiesent each aziom using these
pxedicates

Aaiom 1 T¾ aa taangle is is Osceles hen its tuo


side AB K AC equal

Aiom9:TE AB and Ac. equal hen amales


Band Ciaxe equal

ta (ea (AB, Ac)’ eq_angle (8,c))


Aziom3! ABC equil.atexal txiangle
EABc)
bo

] ite follauiag sentences in FoL (any 2l


Cueing types of quantifes)
i Euexu numbex is either negative ox has a
SQuase xoot
in Ejey Connected and cisCuitit- hee
hee quaph is.
i) Some peaple axe either xeligious x piais
iThe1e is babexwho shaues all menin
tousn wha do not shave themselves.
alAsSMAte
Date
Page

Euesynumbexis eithex ngqgative ax has a


Squase Koot -

We define the fallousing piedicotes


Hon N x l - 2 iSigNumbex
NegCa) negative
Has Squae Raat (z) has a squaxe K00t

The statement can be waitten

Y Na) ’(Neg (al y HasSquae Rogt (xl))

i) Same people axe eithex eligious pious


We define follauingpsedicates
Pa) a pesan.
Religious (a)
Pious C ) ais pious

Statement can be xitten

(p(a) A CReligiaus()y Plous (alN)


xescltion ikilled is
killed
ot
qiaph aliye Rajesh,)
DatePage
nt allve
sillBananas.
ueingXesalutianls
not
food Rad food foad ahll
and andis is
by
bs of eats Rkes FoL o Likes
and is
kindwegetables
Suitable
statement and
Apple peanuts in kind vegetables eats A Peanuts)
Aneuthinq.anyane
i Rajesh Statement (Vegetables) peanuts
all all H)Angthing
anyane killed
CAay)
Dxaw (a)
(Food
Ya Apple)
Faod(
eats likes Eats(Aiay
follauingikes
Raiesh
i a and eabe
alqasithm. Ajaythat Eapxess Food
Raiesh Apple Aay
food
9Solve Psoue
n
Date
Page

I Conuext to CNE :

1 ta C¬Faod (a)y ikes (ojesh,{a))


H) Foad (Apple)
Food( Veqetables)

This can be Xewxitten as

Ya ty (Eats (u,a y Killed(y) v Food(a)


Eats CAlau Peanuts)
¬killedAjay

) Negate the qoal to CNE

¬Likes (Rajesh, Banana)

Collect allclauses
all x)
TFood (a) y Likes ( Rajesh, x) (for
Food CApple)
z) Food (Vegeta bles) Food(a)
4) JEats (y, a) y Killed Cu)
5) Eats (Ajay Peanuts)
C)Killed CAjay)
) Lkes (Raesh Banana)
Date
Page

Resolution -
Eats (A]as.. Peanuts)

) kiled CAjay
Applying Clause 4

¬Eats (Aiay2) y kiled CAjay) v Food (ol


Subshtute swith Aay a with peanuts

MEts ( Aau Peanuts) y killed (Ajay)y Food(Peanuts)


since Eats (AGu Peanuts) is Fsue
nkiled CAiay) is Toue
Food (Peanuts)

iy)l Fsom
TFood Cal y ikes (Rajesh, x)
Substitute uwith peanuts
TFocdCPeanuts) V Likes (Rajesh Peanuts)
since Food (Peanuts)s Taue

Likes (Rojesh, Peanuts)


classMate
Date
Page

) Similazlyapply Same
apply ame logic for Bananas as
Bananas ase also onsidered Fogd.

Assuminaq Eats (Rajesh, Bangnas) y_ killed(Rajesh) yv


Foad (Bananas). implies Food(Banangs)
Fòod (Bananas)

vil Applying clause 1 :


1Food Cl y likes (Rajesh, x)
Sibstitute with Bananas
1Food Bananas ) y ikes (Rajesh Bananas
Since Food (Bananas is toue:
Likes (Raiesh Bananas)
Hence we seach goal.

You might also like