Ai Spectrum U-2
Ai Spectrum U-2
UNIT for
theLogo theTitf
2
Propositional Logic
SIAGROUP
OUSHFOUC
SIA GROUP
Syllabus
Adversarial Search: Games, OptimalDecisions in Games,Alpha-Beta Pruning,
Imperfect Real-Time Decisions.
Constraint Satisfaction Problems: Defining Constraint Satisfaction Problems
,Constraint Propagation,Backtracking
Search for CSPs, Local Search for CSPs,The Structure of Problems.
Propositional Logic: Knowledge-based Agents,TheWumpusWorld,Logic,Propositional
Logic, Propositional Theorem
Proving: Inference and Proofs, Proof by Resolution, Horn Clauses and Definite Clauses,Forward and Backward
क Chaining,Effective Propositional ModelChecking, Agents BasedonPropositional Logic.
LEARNING OBJECTIVES
INTRODUCTION.
Agame is asearch problem where two players or agents perform certain actions or moves, such that
the looser gets
their actions are against each other.Whenthegamecompletesthe winner gets points and
situations . Byapplying
penalties. Gamesarestudiedtocapture and represent the behavior of strategic
(moves) andachieve
principles of gametheory,onecananalyze the problem,select appropriate choices
which leadsto а
success. The minimax procedure is arecursive procedurethat finds an optimal strategy
win state in agivengametree. Alpha-beta pruning is asearch algorith
m that improvesthe efficiency of
to beevaluated in the search tree.
minimaxalgorithm byreducingthenumber ofnodes
The Constraint Satisfaction Problem (CSP) can be described as asetofvariables K,,K₂...K and
setof
Ageneric knowledge-based agent or simply aknowledge based agent is an agent that knows
about
the world, reasons the possible courses of actions and learns to adapt changes. In propositio nal logic,
statements arerepresented aspropositions whosevalues are eithertrue or false but not both. This makes
it easierto draw inference fromthe given statements.
UTIONS
PART-A SHORTQUESTIONSWITH SOL
A
ent s ofagame?
Q1. Whataretheformalcompon
Mode
lPape 1.
Answer: r-1,Q1
(c)
e are asfollows,
Theformalcomponents ofagam
f
1. Initial State
3. TerminalTest
inal state.
Thestatewhere the game ends is
called term
Itchecks whenthe gameis over.
4. Utility Function
valuedetermines theoutcomeor result ofthe game.
It returns anumericvaluefortheterminal states.This
Q2. Listsomeapplications ofgametheory.
ModelPaper-4,Q1(
Answer: d)
WARNING:Xerox/Photocopying of thisbook isaCRIMINAL detAnyone found guilty is LIABLE toface LEGAL proceedings.
UNIT-2 ProblemSolving bySearch-IIandPropositional Logic 45
Answer:
28
Model Paper-Il, Q1(d)
3. Implementation Level
Implementationlevelisthelevelatwhichthelogicalsentencesarerepresentedasphysical
sentencesbyquotingthemorby
placing1fortheirentryina3-dimensional table.Therepresentationusedat implementation level affects theagent'sperformance.
However,the representation doesnot mattertotheknowledgelevel orlogical level.
Answer :
Universal Elimination (UE) or UniversalInstantiation (UI) rule foruniversalquantifiers statesthat auniversal sentence
can be eliminatedbyreplacing (substituting) avariable with aground term(termwithoutvariables). This is done byusing a
notationcalled substitutions. ConsiderSUBST(, B), where џis thesubstitution applied to sentence ẞ. Based onthis, UErule
canbe symbolicallyrepresentedas,
VuB
SUBSTITUTE({u/g},B)
Here,uis thevariable andgis the groundterm.
0% Example
ber
VaPlays(a, Football)can bewrittenasPlays(Ronaldo, Football)with{a/Ronaldo} assubstitution.
a-be
Describe amethod ofsolving frame problem.
resut
Q8.
a
Frameproblemcan becategorized twotypes.Theyare,
Str
(a) Representational frameproblem
(b) Inferentialframeproblem.
LSEAR CH ve
2.1 ADVERSARIA mo
r
whe
ir
timal Decisi onsin Games the
2.1.1 Games,Op ga
me
4. Utility Function
awinand-1meansaloss.
Forexample, inchessthevalue0means draw, +1 means
Types ofGames
Example
Innon-zero-sum games,thesum
oftotalbenefits andlosses ofplayers
maybegreaterorlessthanzer
oneplayermaynot
necessarilybe equal tothelosses o, i.e, the benefitsof
ofanotherplayer.
(ii) Single-Player andMultiplayerGames
AD.SPECTRUMALL-IN-ONEJOURNALFORENGINEERINGSTUDENTS
ARTIFICIALINTELLIGENCE [JNTU-HYDE
IN
RABAD]
N
48
10
A
andallthe possible(legal)successivemovesofeachplayercann be
thegameand
search tree defines the initial state of 30
follows,
nas
drawnthepartialgametreeoftictoc toecanbe show
#(Initial state)
PlayerMax(X)
非
Playermin
(Ο)
##
Playermax Algo
(X)
………
Step
XIOX Step
(Terminal state)
OIXIO
+1 -1 0
(Utility value)
Step
Figure(2): Partial SearchTreeforTic-tac-toe Game
Anyoneplayerhassuccessfullyplacedthree X'sorO'sinarow/column/diagonal.
(ii)
Afterreachingterminal state,theutility function calculatestheutilityvalue.Inthefigure (2),the utilityvaluesofdifferent
nodesare shown.Highutilityvalues aregoodforplayer'max'andbad forplayer'min'.Similarly, lowutility valuesaregoodfor
player 'min'and badforplayer 'max'.Theleafnodes(terminal states) withutilityvalue 0(zero)represents atie (matchdraw).
Theplayerscan determinethebestmovebysearchingthegametree.
It is the movegenerator function that generates all possible movesthat player 'P_name' can performfrom the positioa
'Pos'.It returns alistofnodesrepresentingthepossible moves
. Sol
2. EVAL-FUNC(Pos, P_name)
gam
It is the static evaluation functionthatdetermines howpromisingaposition 'Pos'isforthe player'P_name".Itreturnsa
numberthatrepresents thepromisingvalue. ו
Step4:IfSUCCESSORSsetcontains
nodes,then examine eachnode andkee
doneasfollows: ptrackofthe most promising one,whi
chcanbe
(i) Initialize the variable 'Promisin
g-score'to minimumvalue that functi
updatedinthe later steps. onEVAL-FUNC()canreturn.Thi
svariable will be
(ii) Foreachnode'N'present inSUCCES
SORSset,perform the steps (a)through
(c)
(a) RES-SUCCESSOR Minimax-Procedure
=
(N, Depth +1, opposite playe r'sname)
This is arecursive callthatwill perform
thefurtherexplorationofsuccessor node
N.
(b) Assign, New-Value =- VALUE(RES - SUCCESSOR)
Thevariable ‘New-value'will, now
contain theadvantage (or meri
t) ofposition from theperspective of
player forthe nextlower level. opposite
(c) IfNew-Value>Promising-score,thenit meansthata
thenodesexaminedtill now.Thissuccessor
successor node is discovered (or position)that is better than
node is examinedasfollows.
Promising-score = New-Value
Promising-Path =PATH(RES-SUCCESSOR)+Node'N'
Step5:Atthispoint all the successornodes ofthe game tree are examined. Therefore,
wewillreturn the structure with its
componentsas,
Value =Promising-Score
Path =Promising-Path.
SolvingTic-tac-toe Usin
gMinimaxSearch
Drawing
andanalyzingthecompletegametreeofTic-tac-toegameis
gametree asshow
ninfigure.
quitecomplex.Therefore,wewillconsideratrivial
3SPECTRUMALL-IN-ONEJOURNALFORENGINEERINGSTUDENTS