0 ratings0% found this document useful (0 votes) 25 views30 pagesAi 3 - 4
aritificial inteliigince unit 3 and 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here.
Available Formats
Download as PDF or read online on Scribd
Adversarial Search 7
and Games
3.1 + Game Theory, Optimal Decisions in Games,
Heuristic Alpha-Beta Tree Search, Monte Carlo Tree
Search, Stochastic Games, Partially Observable
games, Limitations of Game Search Algorithms
playing ‘optimally’ Justify ‘using suitable example.
‘Ana: « Minimax assumes a perfec rational opponent, th so
{ates optimal ations However in practice, most human opponent
dlpat from rationality. In this cae, the best move a 257 gn
Step may not be one that is indicted by Minimax and an
igen that takes into consdertion human imperectons vl
perform beter.
1 IF the te isto lange to fly explore, then there is posslty
that suboptimal move could fake Max into an area of the ft
he hadnt considered that is worse than he thought could SPH.
but as Stuart said in class, how to deal with suboptimal play it
‘his Stang is lan open research question. Most lgoritns
crane chor progae awe an optimal opponent, 22
joes seem to hut them very much-but that's an empl
theoretical, result, fb th 7
+ Optimality sil well defn, even if your opponent isnt payeE
well Moreover the game ti rll enough that your age!
fully explore then the optimal player really doesnt care what th
her one dows.
SS
Aaversarial Search and Games
Artificial intligence
«Lets say Max goes first. What will Max do? He will look at every
possible game sequence. He will then take the action which
fuarantecs that he will get a score of atleast X. No matter what
Min does in subsequent moves, Min can never get a score less
than X. So Mav's score will only go up if Min doesnt play well
02 We have two players: MIN who plays first and can make 4
Gases, MAX who playe second and can make 2 moves. Suppose
hat efter 1 turm, the values of the leaves are av inthe Fig. Q2.1
crop et sti, nme eo
Sa tector sa ari
ct dis aia fa
‘Mf we perform an alpha-beta pruning. :
‘Ans, : Now, applying alpha-beta pruning algorithm,
Role of Beta (B)- For root A, the minimizer, value ~ 8, is assured by:
‘moving to node D. This value is compared with nodes B, C and E
This value of B is now used as reference point. Any node whose
vvalue is less than or equal to B value is acceptable else are
‘Teected that is pruned. (As shown in the Fig. Q2.1(a))
Role of alpha (a) - for, root as D, the red
>, the maximizer is assured by node
having value ~8. Ths is compared with other leaf node Any node
"utc or Eaten SenSean,
Sener ge. (AS hon in eg 2th
une
4 Q
Nig
mnt
6
A
Fig. 02.48)
G3 Consider the game tee of Fig. Q.3.1 i
scores are from fat players ew. Sup
“ om fot lasers point of iw, Sup
Dbackedup values in the tre. What
ree. What move will
the nodes are expanded from left to right,
{aan
© d4|
)
6
which the ae
08 the fet pax
‘search, shew hy
the MAX chow 1
what nodes woud wt
‘be wisted using alpha-beta pruning.
“Git or Enger A |
Adverarial Seach and Games
“
al nteligece
‘Ans. Applying min-max algorithm,
ot
fax
mh
dagadadqogoede
7AWHHAAIOAGRHaS
of
/
Applying Alpha-Beta pruning
DHAHDHAHBOAHS
4 Explain Minx enrch proce wth an example
Ana.
1. Given a game tre the optimal stategy can be detained by
examining the minimax value of each node
“A Gee for Eninering Suds2 The minimax vale of node isthe wlity (FF player cay
Man) of being inthe coresponding state, ASSuming that fog
players pay optimally from this stage tothe end ofthe game
4, The minimax vale ofa terminal state is just its uty.
4 Given a choice, MAX will perfer to move to a state of maximum
Value, whereas MIN prefers a state of minimum value
MiniMax Algorithm : The minimax algorithm computes the
minimax decision fom the cen state It 5 used a8 a Searching
technique in game problems. The minimax algorithm performs ©
complete depth rst exploration ofthe game-tree.
The Algor
1. The start node is MAX (player 1) node with current board
‘configuration,
2 Expand nodes down (pla) to Some depth of lookahead inthe
seme
3. Apply evaluation function at each ofthe lea nodes.
4. "Back up values for
“Bask "vale fr ach none nodes un eomputed forthe
5 AUMIN (layer 2) nodes, the backed
nx 8p value is the minimum
Of the values associated with its children
6 AE MAX node
(MAX nodes, the backed up value i the maximum ofthe
associated with its children
25 Conder the ftlows whieh
following 2 player game sree in
Sammast given from the first player's yoint of view ; a
roe ch, fist player le the maximiziog player What move
oven ? Why ? Use minbmax search to soe mt
‘lain limitations of im
paonly nkimax search. HOW 0 overcome, nies
liom %
35
nd Games
Artificial Intelligence
‘Ans. : A disadvantage of the minimax algorithm is that each board
state has to be visited twice : One time to find its children and a
second time to evaluate the heuristic value.
‘During the process of searching for the next move, not every
move (ie. every:node in the search tree) needs to considered in
order to reach a correct decision. In other words, if the move
being considered results in a worse outcome than current best
ppossible choice, then the first move that the opposition could
= “Aut for Engincering SuenArtificial Inteligence
‘Adcersarial Seth and Gang
‘make which is less then the best move will be the last move
‘one need to look at, as the opposition will at least choose thay
+ Mamas tens to be fo slow for games such a chess.
tum the plyer has mary choices to decide on, the brnchay
factor of a game of chess is huge and therefore the deeper we ge
the slower it ges. On average, the branching factor for chen
tends to 30. This is, 30 subtrees per tur are created
t
}
i
cr Eng Sa
a8 Adversara Search and Games
method is better minimx version which
‘minimax algorithm. Alpha beta
jed and therefore We
“Alpha beta. pruning
Gvercomes the Limitations of
ojaces the number of nodes to be expands
Feduce the branching factor.
dae Explain alphacbetn cut off ecarch with an example, State *
28 Ehen to-do alpha pruning:
‘Ans. : cB Pruning
a problem with sinimax algorithm search is thatthe name?
The Phe mates it as to examine i exponential in the umber of
2. ee propo
{eattout looking at every
Stops in Alpha-Beta Pruning
PeRAX player cuts off search when he knows
force @ provably bad outcome
2. MIN player cuts of search when he knows MAX-player can
force provably good (for MAX) outcome.
4, Applying an alpha-citoff means we stop search of a particular
cern because we see that we already have a better
‘opportunity elsewhere.
4. Applying beta-cutoff means we stop search of = particular
Dench because we see that the opponent already has a better
‘opportunity elsewhere.
5. Applying both forms is alpha-beta pruning.
a= Pruning Example :
Step 1:
wes to compute the correct minimax algorithm decision
node in the game te.
13 MIN-player can
Max move 23
Mun meve 3
7 Re
Fig. 2.6.1 Pruning example ()
|!
= Ge for Bnginering Sader,aU Adverearal Search and Gang | gical intelligence 3:10 __Adverearial Search and Games
"as 1 Minimax provdure i a game playing strategy in which
pam Mopt ose soaegies which wil maximize Wer gas
Step 2:
wows - Awhile minimizing their losses.
4 The minimax search procedure is a depth-first, depth-limited
aN move search procedure, The idea isto start at the current position and
3 32 tice the plausible ~ more generator to generate the set of possible
Niecessor positions, Now by applying the static evaluation
wax meve oO function to those positions we can choose the best one. After
aria xk Going 20 we can back that value upto the starting position to
iil Intlgnce
C F luation of it. The starting position is exactly as
(062 Pruning example represent our eval f os
cha Senet food as the postion generated by the best move we can make
eae | onext.
axon 2a Assuming thatthe static evaluation function retums large value
— ihiicate good situation for us, 20 our goal is to maximise the
pes ate value of static evaluation function of the next board position. It is
3 ca | simple look bead strategy for two person gameplaying
rxmove |
a x x
ae 8 2 eee anit
Fig. 2.8.3 Pruning example (i) woven — iss
| teen
|
the minimax procedure for game playing. Find out the tee —e fT.
Filtg of the nodes starting from node A to”. as shown In
sing minimax procedure ‘aauming that root node le sunt — [5]
= Aa ae
A
r ee SHON SE a
oho m
Oa & oo peconee ee
SGI catarhin ALIARIC Cai | RAs sge mse wat me vata nin vate wou
Fig. 07.1
———
co Tana eaten | SF 7 apr Brgy Sateiil Intelligence 3-12 Adversrial Search and Games
‘Step 4: Max moves
A ©
fe]
td
ee
Ga gn Gees GECo aa
Fig. 7.8
@ Fl ® gy 8
[eh \(H @ (Wl
SHS HEE
Fig. 73
Final value at root node is value 11.
as Explain - f pruning procedure. Mark the nodes in the
28. SB Sasch wt pre out
i ang, i
EHO SAE
i}
ae
Ana. : Alpha-Beta Pruning,
1 The problem with minimax algorithm search is that the number
of game states it has to examine is exponential in the mumber of
2. ai proposes to compute the correct minimax algorithm decision
‘without looking at every node in the game tre.
—_—_
7 “A Gul for Engineering Sten+8 Afversaril ea ng
epsmtgee _*® Se
a yning
wap Pe
tM
Fae a peo ba utc r
search when he knows Max.
ape of .
a ye (NK ote Ply
ee ct ns fp seach of
frdh ect we sce tat we already have 4 4!
@
opportunity elsewhere
‘apg Bett means we stop search of a
tech base we se Bat the opponent already has a hu,
opportunity elsewhere
5: Applring both forms is alpha-beta pruning,
Solon to pruning for Fig. 81
ole of Alpha (0) - For node A the maximizer, a value of 1
assured by moving to mode B. We c: : _
= an compare this value
Cit mit A goin wll palo |
spear than 1, Hence, this value 8 being the leat tht
‘maximizing node can obtain, is set a the value of a. ‘
Tis value of is ow use
as referenced point. Any node wios
vale is
sete than is ac
ares han a ae plable and all nodes whose vs
maa mors, it is known that C node
value, Hence entire subtee
ely rejected.
has value 2 which is
tinder node Cis comple
afc tligence
comparing. The minimizer would be
peta ( B) is passed to E for
than E. Hence entire tree under E is
benefited by only moving to D
pruned
a9 How can
“Ans. : In @ game of chance we
e search tree. These no
1m element,
‘uses probability P attached with chance
flue. Successor function § (N, di) give
minimax also be extended for game of chance ?
‘can add extra level of chance nodes
ides have successors which are the
‘outcomes of randor
‘The minimax algorithm
rode di based on this ¥
roves from position N for outcome
2.10 What lo game ?
‘ans :4 The term game means a sort of conflict in which n
inuividuals oF groups (known as players) participate
«+ Game theory denotes games of strategy.
acknowledged as father of game theory.
‘John Von Neumann is
theory in 1928 and established the
Neumann defined game
‘mathermatical framework for all subsequent theoretical
developments
with other
1 Game theory allows decision-makers (players) to cope
decision-maker (players) who have different purposes in mind. In
other words, players determine their own strategies in terms of
the strategies and goal of their opponent.
«+ Games are integral attribute of human beings. Games engage the
{intellectual faculties of humans.
+f computers are to mimic people they should be able to play
games.
11 What is game tree ?
‘Ans. : The game tree : The inital state and the legal moves for
teach side, define the game tree for the game.
—_——_———
“A Guide for Engineering SudensAdve Search nd Gay
Arpt etelignee
game tree.
A
& 7 3
«+ Description ofthe
tS
Fig. 0111 Example of game tee
1 Root node -
Represents board conf
‘hati the bes single
¥ my tum to move,
indicating i is my tum,
iguraton and decision, required as to
next move,
then the root is labeled a MAX node
2 Arcs Represent the
Possible legal moves for the player that the
A Gade for Eninering Sinden
Artifical Intelligence 3:16 Adversarial Search and Games
4 Since moves altemate, the nodes at level are of opposite kind
from those at level i+ 1
012 What are properties of mintmax ?
‘Ans: Properties of Mini-Max
1. Minimax provides a complete solution for nite tree
2 Minimax provides optimal strategy against an optimal opponent.
3, The time complexity is 0 6"
4k The space complexity is Ofbm) for depth-first exploration where
algorithm generates all successor at once, of O(m) for an
algorithm that generate sucessors one ata te.
2.13 What te a made-up game ? What 6 ply ?
‘Ans: The ‘made-up! Games and Concept of ‘ly’
‘For study purpose we can form a game # tree which is
constructed up to certain level (Le. upto certain depth). This is
called as a made-up game, The term ply refers to depth of the
tree.
+ For example - ply 4is level at depth 4 below the root node.
example
Ato ply game tee, for game oftctactoe.
1. Assume that two players named MIN and MAX who are
playing the game
2. MAX is playing fist.
3. The possible moves for MAX atthe root node are labeled a3
and a3
4. The possible replies toa for MIN are by, by and 50 on.
5. This particular game ends ater one move each by MAX and
MIN.
6 In game parlance, we say that this tee is one which, moves
deep consisting of tworhalf-moves, each of whichis called a ply
A ale for npicig Sensgree
7
N
R
3
ROBERT
1. Letinially "Des! so DYD=T" therefore "T=0' & '<5s1.
E-9
2 In column 5‘O¥Es0' as ‘TY so E cannot be 0, therefor'ty | p= 7
(0-90 i possible if 21’. Therefore ‘<2=1'. o3
3. tn column 3 'A+A=9, but addition of any 2 same nubei) T = 0
SIS, sen tut adtionis|9 which is poute Wl Q1s sete fatonag crptathmetic problem with appropiate
there is carry. Therefore ‘ete’ 0 ‘Af
strategy /stepe
4 Remaining numbers to be assigned are (123674:
{ONRBLG).
5 We have E47 & 21’ so from column 5 we get ‘ele
from columd we have ‘LaLtc5=R’ where ‘Sel therefore I
Sh B can be order. As ‘DaG does not genenie ct) A
shown in column 6 so R cann
‘oer. 1ot be Jor3. Therefore | ga
6 We have staat
‘Lar'* 7 0 from conn 2 we have ‘LaLete, te
APPLE
7. From columa 3
there ‘ng, "BP AYAScte and go there is 0) Here ye know that Tis na 0, a8 ToT i nt equal to T. The case is
8 From column 4 we fame with A. After that we have to solve every letter for the
‘Nera sett NeReetep 27 & 44) problem making each letter unique, The steps ae below.
Or therefore ‘Napag ne WE have Ro7 & AE aking a
es 10 saisly he wih remain ,
int “NoBag’ we $$
“A Guide for Engineering Sens
Tonite fr Baeas
+ 9HAS
APPL
89
+ 99
APPL
a9 I
+ 9HI9 |
APPSE
819
+9219
AN
ais
+919
1038
FINAL
| ANSWER: EAT = 819, THAT = 9219, APPLE 10038
e——_ 4
“A Gd for Engineering Swle®
Artificial Inteligence 3-20 _Adversaral Search and Games
He?
p-0
L-3
‘até Discuss AO* algorithm. Give one example where AO" le
friable t0 apply.
‘Ans. © AO? is useful for searching game trees, problem solving
Aes put in most cases more domain specific search algorithms (¢.
Sipha-beta pruning for game tees, general or domain specific
planing algorithms) are used instead.
‘in particular, AI uses Knowledge-intensive approaches and in
practical applications heavy use is made of domain specific
Knowledge or problem conditions to produce better (faster or
more optimal solutions).
«+ Game search is an example where full-breadth search is standard,
but this may because of the small (relative to other domains) size
of the search space. Even in game tree search, extensive use is
rade of problem specific features, ie. often search is terminated
only in quiescent states (je. not during a forced exchange or
when there is a check).
‘In planning, often knowledge is used to guide a search of a
‘generated solution space rather than doing a state space search.
‘This gives non-optimal solutions but for many domains it yields
reasonable solutions at much less cost.
117 Solve the following Crypt arithmetic problem :
BASE
+BALL
“A Guide for Engnerng Sodengit
sf seesmtene
Aversarial Search and Games
Adversarial Search and
sen_Afeereat a Con
a We can say
seit _—
a distinct digits ee Seis ta M should be either 8 or 9
Fen warasseion! ble cary overs when x= 0
ving 2 nunberss0 possible CAMY OVETS aT ith
As we ate just a4 9 when x= 1
Lord. jome carry that is suming M=
ne we dng BB ges ws some cay Ca is greg assuming M= 8
Ba an we et ait mmbrs odd uP FM 8 BE da ay x 0
sanber seLty-E
Hence, G cat be 280 eat eye
506-1 SeLey+Lelotyss
ike this
Now ou question wil ok somewhat ik Pe
BASE | where y can take either 0 of 1
lane | ify = 0 then L = 0 then S$ and E are not distint which is not
a | possible according to question.
1 AMES p
tye
The then L = 45 which is again not possible as L must be a single digit
if 2B are added and they are giving us value greater than equal] TOE 9 to 9
So, M=8 is not possible
10
Then, B must be greater than equal to 5 Sojour question further reduces to 1
Consider B = 9 ist 74SE
+ 74LL
4B =9 then A= 8 which snot possible as then B + B + 1is rl
equal to A
ifB 8 then A =6 which is not possible for same reason
Take B ~7 then A» 4 which is possible
which is as itis not leaving 287
‘carry over. Gan
50,
14988
Now,
S+L=101+E=10+E, and
E+Letty+s
So,
hhere y can take maximum and minimum values of 1 and 0
respectively,
——$—_——______.
<= “A Guide fr Engineering Stier
carry over from E + L
‘rowing the fat that x and y can take maximum value of 1 204
‘minimum value of 0
“A Gute for Engineering Soeia
Advesrial Search and Can
pl tee
Ey
ayo
Then,
E+Les or Sob*
and
S+L=10+E Q
Adding both we Be |
rg=2E+10
E oy
SeE+5
Subang equation from 2 we get
mL=10
oLes
Soour question farther reduces to 10
14S
+785
HSS
%,
E45=5,and
S+5+0=E +01
S+5=E+10
S=Es5
Now we have to choose
athe than 1479 and SES HOMO, 1, 2 3, 4,5, 6, 7, 8 and)
Some cn take va
lke vats of E and S fom 023,68 such that § = B*8
Os there 5 cant be chosen
2s there 7 cant be chosen
“A Ge for Enginerng Sui
Artifical Intlignce Adversaral Search and Games
6 is there 11 can't be chosen
8 is there 13 cant be chosen
so, only possible pair left is 3 and 8 which satisfy our constraints.
Hence,
$=8and E=3
10
| and
Meo
18 Solve the crypt - arithmetic problem with the followin
Constraints. Give solution atepe,
Sonatas 1) Use decimal arthmetl t) No two lates posese
“A Gale for Engineering SuenAdverse Search ond Gang
18
angsariont
an Hee OS
62513
a ae o-n
we “5,
Cra
30)+5}=RI6)
|
'
waoss
$0) Di1}=€14)
sna he 8
02) +418)= 67)
Ie) +42) = a)
uatces
C18} +RI6)= 1+ Cary 5)
|
eta
Artifical Intligence
19 What do you mean by constraint satisfaction problems ?
Explain constraint propagation algorithm using suitable example
‘Ans. : 1. A constraint satisfaction problem is defined by a set of
Variables Xy,Xp,.,Xq and a set of constraints Cy,Cy,..., Cy.
2. Each variable X, has a nonempty domain D, of possible values,
53. Each constraint C, involves some subset of the variables and
specifies the allowable combinations of values for that subset.
4A slate ofthe problem is defined by an assignment of values to
some or all of the variables. (X; = Vi,X) = Vj.)
5. An assignment that does not violate any constrains is called a
consistent or legal assignment.
6A complete assignment is one in which every variable is
mantained and a solution to a CSP is, a complete assignment
that satisfies all the constraints
7. Some CSPs also require a solution that maximizes an objective
function
Consider graph colouring problem as shown in Fig. Q.192.
Constraints are -
©
Fig. 0.19.1 Graph colouring problem
1. We have three colours for colouring a vertex.
2. No two adjacent vertices have same colour.
—_—
“A Gude for Engineering Soe
a5 “4 Golde forEnpnering SernAdversarial Search and Gay,
one ‘Allowable combination fo,
approsh popes information from assigned ty
2. The forward CNG Po avoid or detect all failure.
ales ba
anton peel efores constants lea,
a0 : fast method of
J he sof arc conssterey proves 3 of constraint
propagation ha ssa STONES than forward checking
re festa deed arin the constraint graph |
constant Propagation using Are Consistency |
11 This fast method of constraint propagation. |
2 X 4+ Y is consistent if (for every value of X there is some |
‘owed vale Y. For example (VV, i8 consistent if
Vy +Re, Vy = Bu) efor evry value of x in X there is some |
lowed valve y in Y}. This is directed property example - |
Mey |
Vy = Vp is consistent iff |
V, = Red and V; = Blue
as
mcd ares between variables represent the domains of
4 Conn ‘Yarables, they are consistent with each other.
raint propagation i
Fegan cm he ppd as prepraceing |
pial Intelligence
3-8
‘constraint propagation using
1. Arc consistency is not caps
Partial assignments [V = Red, V2
2. Keconsistency is very strong form
3, A CSP is K-consistency
any consistent assignment to those variable a
‘Adversarial Search and Games
K-consistency
able of detecing all inconsistencies.
= Red] are inconsistent.
of constraint propagation.
if for any set of K-1 variables and for
consistent value
‘can always be assigned to any K" variable,
END...
‘A Guide for Engineering Sale
<=
a
“A Gale for Enincering StatenMagn 2 Snevin
a2 Knowledge
rifical nelgence
Pompeian (x) indicates that x is @ pompeian. Next symbol "+ is
‘implies ie, means and roman (x) indicates that is Roman
In other words we say that all x i. all pompeians were Roman,
iy Caesar was ruler
ruler (Coesar)
Here, one can ignore the fact that proper names are often not
references to unique individuals, since many people share the same
name. Sometimes desiding which of several people of the same name
is being refered to in a particular statement may require «fair mount
of knowledge and reasoning
iy “All romans were ether loyal to Caesar or hated him
‘x: Roman (x) = loyalto (x, Caesar) vate (x, Caesat)
ln English, the word "OR" sometimes metns the logical inclsive-OR
and sometimes means the logical exclusive-OR (XOR),
Here, inclusive interpretation is used.
Bu, if one considers it as ‘exclusive-OR’ then presentation would be
Some what different a follows =
x Roman (x) ~» [loyal (x, Caesat) v
hate (x, Caesar) 0
4m complex sal word problems sich as shopping on internet orbit ~Uoyalto (x, Cats)» hate (x, Caesay}
se_emeene. pe ‘nore “gral an. 2th) scpene sl oa
eesti, We ned 10 eee ropesenition® which concentate a
general concepts such as Actions, Time, Physical Objects and Bel 5y | loyato (9).
Sch nos many ince Psi Mere, can we Both the quis Le. + > univer auntie
and 3 existential quanti.
2 Represent positional ogc.
Present following facts using propositional logic. So, one can read above presentation as for all x, there exists a y such
emis) Ca a al that loyal toy of indietly we say
wer ther loyal t Cassar or bated him. e :
in) Everyone loyal to some a. "Everyone is loyal to someone
©) People ely 1 ana rar i But here one can understand a diferent meaning i, ther is someone
oae rulers they are no loyal.
i) Mares tried ta ‘0 whom everyone is loyal, whi vwiten as
P Marcos tried snasinate cease. earprus oa, ante dl © WHOM everyone is loyal, which would be wien
3y : vx : loyal (x, y)
Am. 1) Al pompeins were Romans
“*: Pompeian (2) + Roman (a) "Now read it as, there exists y, such that forall x, x is loyal toy.
Or
tn tis presentation iver
"aie OF 1, forall sm aiege * # Wed 0 presen
ints, Knowledge-Based Agents, The
ce hepa Ts |
roving Efecive Propositional Model |
bed en een
Logie |
{24 How knowledge cam be representation ? Explain with example,
EE (SPPU + bert
Ans: Kaowiedge Representation ~ In toy problems the choice
representation isnot imperant because these problems have con
vcabuly
“everyone is loyal to y"
1) "People only try to assassinate rulers they are not loyal to
coors A Gude for Engineering Sudentsee
‘Syntax : 1 defines allowable sentences inthe model,
Propositional esleulus symbols :
Se Na es ed ge 4. Symbota
ee eer
mere eee FORKS on
tenets srs 4) Predicate symbols: They ae used to represent relition
“efor Enger SnFor example *
wa se
we wil ee
sent 8
Ive
te
READS IPH BO ym i EEO TEESE oj
nis may be Physica
anes ne Mc ees mS ee
ee oT eo
pa coer frm Dip a BOOK ae eau
For eae:
sya cvs ike FA 0 SYBOL, Thy ay
iy te mt bokeh tty 1 10 be rei |
ses be el
Sep READ (>)
in the domain of disco
Tey denote incions
+) Fan sys: Ted ae
ote is mai ie
for example: "Ras
fore woud be,
MARRIED (MOTHER (Ram), FATHER (Ram) where MOTHER,
FATHER and MARRIED are ftion symbols
2. Truth symbols
Tine, Fae
3. Comectves |
Not: Pepston! smtals dnote prepositions, or statements abou
word tt may be ether tue or fuse, such a5 "the car is red" or "wit
is ver.
15 What are propositional calculus sentences
Ans.
') Every prepostona smal an truth symbol is sentence.
For example : Tr, P,Q, R are sentences,
5) omic semen It i indivisible (aon-composite) sit)
slement, T consis of preposition symbol, Each such 5
stands for a Preposton tat can be tus or false
') Complex Seine 1s cesrated from simpler sents
logical connectives,
Artifical Inteligance 4s Knowledge
ae rodge
Note : Logical sentences are also called as well-formed formulas or
WEF,
26 Explain inference algorithm in propositional logic.
Ans
AA logical inferencing means to decide whether KB kc. for some
sentence
General Inferoncing algorithm (truth table enumeration algorithm)
1) This algorithm is used for deciding entailment in prepositional log.
2) It works like backtracking search algorithm,
3) It performs a recursive enumeration of a finite space of assignments to
‘tables,
4
This algorithm is sound, because it implements directly the definition
of entailment,
This algorithm is complete, because it works for any knowledge base
and ‘ct, and always terminates (As there are finite models to check).
Time complexity of algorithm is O(2") (assuming n symbol in all,
then there are 2 models)
1) Space complexity of algorithm is O(a),
depth first.
6
because the enumeration is
Note: Every known inference algorithm for prepositional logic has a
worst ease time complexity which is exponential inthe sizeof the inp
Note : Prepositonal entailment is CO-NP-complete. (CO-NP stands for
Complement ~ Nonpolynomial time, where as CO-NP-complete means
hardest problem in CO-NP)
‘The functions for truth table enumeration algorithm :
Function TT Entalls (KB, o) Retums True or False
Inputs: (KB, the knowledge base),
(@ sentence in prepositional logic a),
the query, a sentence in prepositional logic.
Symbols A ist of the preposition symbols in KB
and &
‘eum TT CHECK-ALL (KB, o, symbols [] )
Recess
“A Gale or Egiering Sendenx deciding preposition
4) PLU west: eens is iin # mel
2 wie el eens 2 pail mdelan assignment 0 eh
some ofthe arable |
4) The foo eal EXTEND (P, tue, model) retums a new par
collin wich P has the valet
7 Represeat Wampus word wing propositional logic ale
inference proces.
(OR Write the algorithm for Wampus world agent to find pis
wampses and safe square,
oR Expai ia
Propositional loge,
fa: A wumpas nord agent:
ape Word iso
7 pus oe ‘ficial intelligence problem, which is =
oo ‘bused on simulation, as well as oe
Wamp nat an ety comp
sv ade op fo Se
ace based agent in Wumpus world based %
par fe in which an agent had to exBlie
interconnected rooms. In one ofthe 55
wot
“A Gd for Enginering SH
tfc Intelligence a8 Knowledge
cate cave there was a Wumpus which would kil the gent if tener
ia om. Some rooms contained pis, and the agent would die ff
tht td any of those rooms too. Tbe agent had one arrow with which i
‘The goal was to locate the gold that was hidden
ould Kill the Wumpus. r
sete wherein the cave and return to the start without geting Killed
«soe
jee
2 Sech is,
A
Fig. Q.7.1 A wumpus world agent and its environment
PEAS description :
+ Performance measure :
Gold : + 1000, Death : - 1000
~ I per step, —10 for using the arrow.
+ Environment :
+ Squares adjacent to Wumpus are smelly
+ Squares adjacent to pit are breezy.
Glitter iff gold is in the same square.
Shooting ills Wumpus if you ae facing
it, It screams, a
= Shooting ses only arrow.
~ Grabbing picks up god if in same square
Releasing drops the gol in same square
= You bump if you walk into wall.
—
=) “Gale for Eninecrng Sader2) sae
ys-W
3) Dist
ws
4) Sage
ves Wasi
esily 0 natural fate
ing the wurpus word |
Ess ge neal consis te res ofthe envionment
2 in pe Oe, Bap, Se]
Se a
aces
aS ee G = Gilter gold
OK ‘Stench
a fat an Tat Visited
‘Wumpus
Laxlo{ | |
Fig. Q72 Exploring wumpus world-1
Action : Move to safe cel (2,1)
3) Location: 2,1}
_2eo > Senc,Brez,~ Gite, Bump, — Sereat)
eo
Atal Intelligence “0 Knowledge
Artificial mtelligenee Ar
infer : Breeze indicates that there is a pit in (2, 2] or (3,1)
ion Return to (I, 1) ty next safe el
ae pe eT
3 = Greco |
ps pe ps fas G = Glitter gold
ok = Sof equa
aa ae eee =
ime Bs 3 = Stonch |
omg ea Vo = Viiaa
v |e w= Wonpus |
| ox |
Fig. @.7.3 Exploring wumpus world - 11
4) Location : (1, 2]
Percept: (Stench, Breeze, — Gliter, + Bump, — Scream],
Inger : Wampus in (1, 3} oF [2,2]
YET... notin (1, 1]
“Thus. notin (2, 2} oF stench would have been detected in [2, 1)
Thus .. Wampus is in (1,3) [2,2] is safe because of lack of breeze
in(,2]
Thus pit in (3, 1]
Action : Move to next safe cell [2,2
ia Bae ae
D = Aen
is fess as pee
wh & = Gitergou
Ok = Sot square
fag 22 [aa P= Pt
S
ox | o« oe lon
it te aa [at Y= Vites
wp ape Wo = Wompus
St a
Fig. Q.7.4 Exploring wumpus world - I
cess A Gul for Engineering SatetsWorld
“4 urs like a general
~ Agent sled bse HAE & BNET oy
inorance based ABO od "el
inet
kes
tase aE 7
sword ay about te Fain of Bits (P),
a sl
1) Tas an (> oa
sale ates the "physige
ma se oe Oe Physics
2 bis
” snp wth seaon fom a squate KNOWN t0 be safe,
4) Tega bis 187
=Ry:3
“aio
4 Fereey st eee ;
Sr Beg Payer Pet Party Y Peay
Seen apace yet sea
-Ryg Ruy © Buy 6 Payot ¥ Paget ¥ Party ¥ Panty)
6) How dow ees ee is erty one Wampas ?
Wea ese in 2 eMeE,
2) Tae at et ne Was Rs
Way Wave Waa
Fara mo sures ne mus be Wamp,
i) Ts est fr ey pif squaes
ii o(o-1))2 numberof sentences
Rye Wy Wy
Ry WV Whs
“Ris
7 We hve wel tt aol inthe mowledige bate
urpus-Werégent program
1) ASK-Easinest compan
TT-Entils would have to enumerate 24
DPLLWALKSAT petonm
A Gude for Engineering
et
fia Inteligence “2 Knowledge
) For a large Wumpus world, the number of sentences in the knowledge
base will be huge
) We could not capture the propery “breeze in a square indicates pit in
atleast one of directly adjacent square”
ation,
entation In wumpus world
Of ty 1) Can we add proposition like,
Lj, * Facing Right » Forward > La.
2) Knowledge base will ental both Ly, and Lz, by using inference
nes
5) What we intended to captre is this
FU 9 Facing Right « Forward +L
Facing Right « Tum Left ) — Facing Up (+)
14) Fox every times sep, one such statement 22?
Assuming the problem is solvable in 100 times steps, then 10
thousands of addtional sentences are needed
8 Explain how to have inference using propositional logic. Also
plain resolution uslg propositions! logi.
s.£ 1) Modus ponens
is represented as,
= Bia
B
‘means that whenever any sentences ofthe form a=
lsd care given then the sentence canbe infeed
on)
[For example -
‘Wo statements,
(Signal Pole Ahead » Signal Red) = Stop
) (Signal Pole Abead » Sigal Red) are given then "Stop" can be
And-elimination ; It says that ffom conjunction any conjunets ean be
Ted.
is represented as,
“A Guide for Eninering Suenog
”
eo
Knowledge
exo
po yA sentence epee conjunction of junction of lita isd
i cave a to be in Conjunctive Normal Form (CNF).
rt se isu fr ening ste
oot eps for converting preposional logic seatences into CNF
ieee Fim, epiing em i (= B-2)
eee eae eaeee ees eas
cate amn VO it By 2 Pi2v Pai)
a jin of ne
uta stcion SMS gi he ec,
os (By, 1 9 Py,2¥ Paya (Py,2¥ Pa.) Baa)
Eliminate —, replacing 8 with - av B
(By av Ph.2¥ Poa) Alv(Py,2)¥ Pay Biv)
CONF requires —to appear only in literals, so we "move ~ iawards" by
hy.
aes vier hed seta
od mare complementary Titeal. (1 mea
1
oiteers lowin equivalences :~
pSeepsst ate can te genni gy “Tanai fhe lowing ded equal
fp oven: The wt sion le -\( 6) = 4 (clouble ~ negation elimination)
reso (48) = Gay oP) (De Morgan)
yy amy oo Mn
avy | Ty isc aa =P De Moran
V1 MeV oA Mig
In the example, we requir just one aplication ofthe last rue.
(Biav Pav Pad a U2 Pe vy By)
‘Now we have a sentence containing nested © and v operators applied
lids | to literals. We apply the distibutvity law, distributing v over
Serra | wherever possible.
: (6 Buy Ph.2v Pai) AGPL.2 (Pai Biv By,1)
‘That is, resotion takes two clauses and produces a new »
containing all the literals of the two original clauses except *" Arove semtence is now in CNF.
ee
Teorey WY
he adm ae complementary ites. IF we are dealing cay
Clases of length two we could write this 28
comple tes
mh olution rule forms the basis for a family of complete inference
Ii a single iene rie, tat yields a complete inference dures.
when coupled wih ay complet seach algorithm.
Clablte da ate ‘Refutation completeness:
Gerace LI gaia ca tele ta cal al
CcTirn iin ee in ont ie
mae eolaton agri
ery Sentence of sD) takes,
postin lgie is vale input as knowledge base [a sentence in prepositional logic]
Conjunction of dsuncons af tents PAY 8 and cc (it is query - which is a sentence in prepositional logic).
A Guide for Enginerng Sudens16 Knowledge
4h
ridge base do a tiger
‘pt taowtedae Se do ayy, SY ari
ee
It has atmest one positive literal.
Hor clause with exactly one position literal are called definite
litera
‘The positive literal is called HEAD of the clause
The negative itera is called as BODY of the clause
‘A definite clause with no negative iterals is called as fact.
* Hom clause with no postive literals can be writen as an
implication whose conclusion is the literal false, Such hom clause
can be used to represent integrity constants (conditions) in the
So
or averted in CNF
pd a api it eg CES
ins complenenaty TIS aay
ined me
ito set iit ist aleady prese,
isa
nse
wy Ti anil one of the two
4) Sip (i) 0 G8) ae Pete databases,
ses 0 in whic 5) lnfrensing with HORN clause - For inferecing with Hom clase
enw ins tha cn be eed 0 WICH ae gg Er Ee tes
: Forward Chaining Method
eu on
resotion rule derives the empty
ty An apliain of he rst ta
‘The concept :
1) Iris general concept of data-driven reasoning in which the focus of
attention stars with known data,
2) It can be used within an agent to derive conclusions fom incoming
percepts.
3) I is used for determining whether a single proposition symbol Q (the
query) is entailed by the knowledge base of Hom clauses,
4) It initially stars fiom known facts (positive literals) in the knowledge
base,
5) Ital the premises of an implication are known then its conclusion is
added to the set of known facts,
For example :
TE Ly and breeze are known and (Lj 0 Breeze) => By, isin the
KB then By, can be added,
©) This process continues until the query Q is added or until no further
inferences can be made,
Forward chaining algorithm
Function PL-FC-ENTAILS ? (KB, q)
returns true or fal
Inputs : KB, the Imowledge base, a set of propositional Horn clauses,
the quory, a
—
‘4 Gude for Enincering Suen
whic ase celal B
Completeness of resolution
The algorithm of resotion i complete. It means that it wi
poacs a result checking all clauses in KB and all the clauses,
ffom them, It finds closue set of clauses set which has all
clauses fom exiing clauses set It checks the input query aging
closure set
Ground resolution theorem
4 states tht ~ "fa set of clauses is unsatisfiable, then the
lou of tine clawes cnn the empty clause.
The ground reson trem is called as completeness thee
rection
Boia forward chaining concept and algorithm aloag
As: Tho Hom Clause
Uta fled Contains simple restricted clauses called
coe epee” SH i «disjunction of literal of which #Know
ler ol
ech Hor
cous
coun
ig HEAD fel =
ust (EAD el, agen)
sen
rps fran caning gr
1) Forward caising algorithm 38 sound
ren tt very nln is eset
eos
2) Frat hig expe
1 meas at cey eatiled sonic sentence will be dein
Algorithm constructs infered table for final state. In this ‘able cath
fl el ig poss eval and fae fi al
5) Fr ewope
Cowie
aa ple knowledge base of Hom clause, as given below.
2BACoA
Gally an application of modu
DiBsc
el nels
418 Knowledge
“AND - OR graph for above Horn cause knowledge base
1) Mulple Kinks joined by are indiate =
conjunction
2) Multiple links without an are indicate
1 disjunction.
3) The links should be proved.
14) Inforce propagates up the graph
4) Before proceeding ahead, from
conjunction point, the propagation
carte until all the conjuncts are Fig, 91 AND-OR graph for
Hom clause KB
known,
The order of clauses considered by forward chs
inferencing query Q:
1) E and D are given tre.
2) E and D implies B also B and A implies B.
3) D and B implies C.
4) B and C implies A.
5) A implies Q.
6) Therefore Q is tue.
a.10 Explain backward chaining concept and algorithm.
‘Ans. +The concept :
1) Tt works backwards from the query i.e if query Q is known to be tut
then no work is needed.
2) Algorithm finds those implications in the
conclude Q.
If all the premises of one of those implications can be proved tue (by
‘backward chaining) then Q is true.
1) Backward chaining works down the graph starting at Q until it reaches
1 set of known facts that forms the basis for « proof
4) Backward chaining is a form of goal-directed reasoning.
5) Iris useful for answering questions such as "what action should T do
sow"?
— ——————
Sco 14 Gude for Engineering Stents
ining algorithm for
Knowledge base thatwe
iil ee eS
= ard iin es only relevant facts), "2 :
6c wat ees eso smple :
: sesame mowed BAC considagy | in he thee clawes (A v ~B), (By 0), (Cv A) A and B ae
pure, Cis impure.
sao ree
Make a pure symbol literal tue
ein) chaining
Sed scone by baka Algo
1 eee ey a tsk SO) = Unit clause heuristic :
ee Unit clause: Tes a clase which have only one feral in the clause.
isi oa
ee ‘The ony literal ina uit clause must be te.
aera ty Bad Aas well a E and D. + If the model contains B = false, then (B v -C) becomes 3
3 isp by clase becaute iti equivalent 10 (false v —C) or just sC.
4. Cis by Eat ‘The DPLL algorithm for checking satisibilty of a sentence In
Sand D agente in knoledge base. pe een
6 Tere fo Q we od iplaons Sequence that conclu g | Function DPLL-SATISFIABLE (6) returns trv o false
Inputs: S, «sentence in prepositional logic
Clause ~The aot of clauses in the CNF representation ofS.
Therefore Q is ve
{211 Discus backtracking algorithm used in propositional logic,
(OR Discuss Davis Putaum Lopmann-Loveland Algorithm (DPLL).
symbols «A list ofthe preposition symbols in S.
retum DPLL (clauses, symbole, ||)
Function DPLL, (clauses, symbols, model)
returns true or false
‘fevery clause in clauses ie
true in model then return true
if some clause in clauses is false
‘Ans: The concept:
1 Takes apa a sentence in conjunctive normal form, which isa
of ss
2) Ie douse dept fst emerson of possible models
3H dtemines if ipa propositional logic sentence (in CNF) i
sata,
PLLA improved a ‘in model then return false
— P, value « FIND-PURE-SYMBOL (symbol
‘model)
This ler
fir pop ante eater general inferencing algo
inpovements oe eas ~ Entals algorithm). There are three
desrbed been, Swameraton (TT ~ entails algorithm) 8
1 rnin
1 Ae ay ng
scm eye
2) Pure symbo} ‘heuristic : we
‘iP is non-null then retum DPLL
(clauses, symbols, -P, EXTEND (P, value, model)
P value «- FIND-UNIT-CLAUSE (clauses, model)
\fP is non-null then retum DPLL
(clauses, symbols-P, EXTEND (D, value, model)
P FIRST (eymbols); ost REST (symbols)
return DPLL (clauses, r0st,
EXTEND (P,true, model)) or DPLL (clauses, res,
* Pure symbot a
"W905 appears with the same "Si
EXTEND (, false, mode!)a
ying gg fiction which
ef sh Teta
0 1 To
“sues FN i 2s fetion which
0 ga USE rng f
) Outputs are registers corresponding to actions
}) Circuits are evaluated ina data low model
LUNI sll
iy FN nate) 5) Value stored at each preposition symbol gives the truth value of the
ase OT ppt TOF CHECKING satin, |) comspondingsymbl atte cen tine
ae Oe es et ee ties rece
al ‘state given a stream of percepts.
Walesa 2 aor
Jementation for it }) For logic based systems : Maintain a representation of the set of all
a atin sen ‘asta,
logically possible world states, given axioms and percepts.
nis: yaLKSAT algorithm = ) Basic trick + Suecessor-state axioms define truth of preposition at +1
carats ‘from prepositions at t
aise oe For example
2 en p's irsonlict Hes of mining Alive! e» Seream! » Alive!
ees a aeeeetamt
aan os emeen ectness and randOrIDesS ena aA
: _ el when we expect 2 solution to exist. for eg 9 (Ly «(Facing Down" 4 Forward*“!))
4) his ee : it a
Yolen (U5 acing Left“! Forward!)
5) Its incomplete alge. Ik return satisfying model when it,
the nfea i fit ha poblem, When algorithm fails to ah
reve i ay ent int infinite Toop because of infinite vt
acl
6) exh seach alg ke WALKSAT, cannot aay
zai, wich is very necessary for deciding entaime,
Fer example
‘As age cat rely ws local serch to prove that a sau i
in he Was wer
13 Exphia circuit based get in Wumpus world bas!
ropositional lop
A: Ths ae
y fiance M® MSA chat ogi expession diet
Beeze O
genet O
iter
Fig. 0.134 Part of a circult based agent forthe wumpus word.
Figure depts circuit for grabbing the gold andthe circuit for
‘determing whether the wumpus is ave
Charts of chet bed
; Hells agent wih ste, sown eg
it meena
‘ots are inputs to sequential cireyi. delays are shown as small.
has network of gates and registers,
“ie for Erineig Skene
“ute for Engineen e
Knowl
“ere
again
Oeil act) and has 00 ‘moved, tried but bump,
4 en and moved forward,
same tv
' Bump")
i
«The agent was i
was at [1,2 sing
eas at [2 1 fing Ft
Uh <> Uys Forward
(ted a (Facing Down!” 1 9 Forward!)
(us! Facing Let!” 9 Forward!" ')
a Fowaed
wt (enter)
ao OD Tar]
am —
sem aaa}
“Peon A
Fig. 0.122 The cult for determining ifthe agent Is at [1,1]. Exch
locaton and orentation register has a similar circult attact
A pot oe to heute agent
‘itil ent ale coin in,
‘The agent cannot se a tth value for it :
tific Intelligence au
1) Conciseness
Krowletge
Aas.
IBA ~ It require seperate copies of its knowledge base for every time
sep
‘CBA ~ It do Hot require seperate copies ofits knowledge base for every
tame step.
ih agents requires phys
sure and
5 engeed a sexes or Seis) fo rey
thf ey went se fr le see oanen
jy computatona tlney
Bee aie erpeunlal tne einer
I cil eset omanber of yl)
(CBA - It takes linear time for inferencing which is dependent on circuit
3) Completonoss
Wa:
(Time grows,
1) Iis complete but with huge time requirements for completeness.
2) I also stores previous states/percept therefore memory requirement is
also more.
cpa
1) Its incomplete for various reasons
8) Acyclicty restriction in circuit itself which is practically not
possibles,
4b) For a complete circuit CBA will take exponential time with respect
to circuit size,
2) It forgets all previous states therefore can not draw conclusions based
(on previous states/percepts.
4) Ease of construction
IBA - As environment and conditions are simple and clear. It is easy to
Tepresent in propositional logic language.
CBA - The envionment considered is limited therefore a circuit is small
acyclic and semicomplete. Hence describing it is easy when relation
Detween percepts and action is simple and straightforward, It is easy to
describe and construct knowledgebase for such agents
aac ee RESCH EEE
‘Gacooay
Geo ee; ledge
artificial Intelligence 4-26 Knowledge
3, It can take up value from allowable objects, relation or function set.
|| A term without variable is called as ground term.
ji) The sentence
¥xP ,
Say that P is true for every object x, where P is a logical expression.
For example :
a) “All Princess are Person" can be represented as,
x Princess (x) => Person (x)
b) "If the universe of discourse is people, then this means that
everyone is happy" can be represented as,
v x Happy (x)
iv) '¥ can make statement about every object.
y) '=" is natural connective to use with '¥'.
vi) Common mistake to avoid : Do not use ~ as the main connective
with V.
For example :
v x At (x, IT) ~ Smart (x)
It means that "Everyone is at IIT and everyone is smart.”
It is mistake because you wanted to say "everyone at IIT is smart.”
Q.17 What is existential quantifier ?
Ans. : Existential Quantifier (3 )
i) These are used to make statement about some objects and not just for
all,
ii) The objects are not named,
iii) The sentence, 3 x P says that P is true for atleast one object x.
For example :
‘) "Princess Cindrella has crown on her head" can be expressed as,
3x Crown (x) a OnHead (x, Cindrella)
[Crown is a crown and it is on Cindrella's head]
b) "If the universe of discourse is People, then this means there is at least
one happy person", can be expressed as,
3x Happy ()
@uconrepe
a
pat _—_—
x such that...”
wtoere exists
itis pronounced
oR :
por same Xo"
+ is natural conned
‘i Common mistake 1
wih 3.
wis
Fox empl
3x At(e UD = Smart
a
‘48 Teast thse sete
1 Je ike al ind of 008
2 Apple ae fod
23. Chicken is food.
“Anything anyone ents and isn't Kiled-by is food.
Bil eas peanuts distil ave.
6 Sees eveything BU ats
‘Aas: Tete execs int oul in predate logic
1 et ke lin fd
"Y Liks (on, x) Food (x)
OR / x food (x) — like (John, x)
2) Apple are food.
Fou Ape
3) Cie sot
fod (itn
4) Antigen as di ed by fod
TREE) A= food Q)
) i tue if there is anyone Who is no,
ces into formulas in predicate logic.
mh a ae iy
) Se everyting Bil ents
“8 (Se) eat (Bil, x)
anil Intelignce 48 Knowledge
0.19 Convert the formulas derived in above question 18 into clauses.
Prove that John likes peanuts using resolution.
‘Ans. : Conversion of formulas derived in Q.19.1 into clauses.
ike Uahn, Peansts)] [= Food (Peanuts) v ike John, Pana) |
Food (Peanus)
False Contradiction
Fig. 2.194
1) Ye food (x) like (John, x)
~ food (x) like (John, x) i)
2) Im above equation (i) we substitute
x = Peanuts
~ food (Peanuts) v like (John, Peanuts) O)
We need to prove,
“John likes Peanuts’ ie, like (john, Peanuts)
We prove by resolution, we add negation of goal / result in out set of
statements, ~ like John, Peanuts) ii)
Resolving equations (ii) and (i)
Hence, goal ~ like (John, Peanuts) is false.
Hence, the proof like (John, Peanuts)
0.20 Using the formulas derived in Q.18 prove John likes peanuts
‘using forward chaining as well as backward chaining,
‘Ans. : Using wif derived in QS.
We prove now that,
= "Tohn like Peanuts! using forward chaining
= "ohn like Peanuts! using backward chainingSova Fil teligence 90 Krowiede
“ans. : Consider argument,
= Socrates is 8 man this can be represented as,
‘MAN (Socrates)
= Men are widely distributed ovgr the earth is
represented a5,
oa Poo)
DISTRIBUTED - ON - EARTH - MAN
Ee ror Sets wily dae ne
as don, Pou earth is represented as,
| DISTRIBUTED - ON - EARTH (Socrates)
re (Hence the proof In above case it fils to capture the relationship between any individual
‘az04 ting ‘ta! and that individual being diseibuted on earth, To do tat there
ne is need of variable and quantification unless there is need to write
vas tn, Peas) Seperate statements about the ‘distibutonship’ of ‘every man’ known
present on earth
-=+ The facts described by these sentences can be
represented a5 a set of wif in predicate logic as
Foaa (Pent) ‘sm
eS 0 Sn i ert be
fats Paanus) Kile (y, Peanuts) mi 0) ed oer)
i) Soerates is @ man
MAN (Socrates)
ii) Socrates is widely distributed over the earth.
xs (8, Peanuts) —_—Kied (8, Peanuts)
MAN (Socrates) -» distributed - over - earth
| | (Socrates).
Ae ue 2.22 Explain the algritim of preicate logic resslation
tree pean Ant: The resoltion inference rule
Fig. 0.202 1) Two clauses, which are assumed are to be standardized apart so that
221 What is wrong wit they share no variables, can be resolved if they contain complementary
Sores tape they
oc tied oe the earth 2) Firat order literals ae complementary if one unifies wih the negation
mn the oer.
Their, Socrates :
Seca wi 3 ference rule is
eae Bee
represen : eVincW tae
“stn le vo that thin pratt gptiese sentences YF SUBST OI WoW V, has VoWh Ven. VosVng Wager)on
al
te ee a
ete Oe
ye
Loves (9) sill
I pecoapennny a Les (ES) 3) tod Loy
ace te resalvent clase
‘ils (0
en is the Bary resolution rule, becage
‘he binary resolution re by ise el
‘5,1: Inference in First-Order Logie, Propositional vs.
First-Order Inference, Unification and First-Order
naj ane Pae Bee eer foaagi eee acme
(ce ett ot gf [nen ns ne co
ite . :
rer ppoxh is end actrig. Factoring Means the remon
9 dae ern inode cse.Propostional factoring red
‘Re teal o one if hey are identical; frst order factoring reduc
oe oe i heya nial
Soe prvi by eatin
ein pes tt KB F by proving KB» — a unsatisiable, ig
Oy dag apy clase Ha prof By contraction
Fai a ken neon ot,
1) Coen al probe statements to fst order logi.
2 Coe ot ene sein conuntvenonoal form.
2) Asset te oegton of the goa
(1 Consider the following fact
1) The member of the St. Bridge club are Joe, Sally, Bill and Ellen.
i Joe is married to Sally.
ii) Bill & Ellen's brother.
Jn) The spouse of every married person in the club is also in the
7b
) The last meeting ofthe club was at Joe's house,
1) Translate the above sentences into formulas in predicate logic.
2) Prove that Ellen is not married,
‘Aas. : (step 1) Predicate logic
1) MEMBER(oe, ElmStBridgeClub)
[MEMBER(Sally, FlnStBridgeClub)
MEMBER(Ellen, ElmStBridgeChub)
MEMBERGill, EImStBridgeClub)
2) MARRIED(oe, Sally)
3) BROTHER(Ellen, Bill)
4) Vix vy MARRIED( MEMBER
, ElmstBridgeChub))
5) LastMeetingtHouse(Joe))