Professional Documents
Culture Documents
iq/dep-cs
3rd Class
Artificial Intelligence
.. :
2.1
2.1.1
DEFINTION
PROPOSITIONAL CALCULUS SYMBOLS
The symbols of prepositional Calculus are, the prepositional symbols:
P. Q. R,S,T....
truth symbols
true, false
and connectives:
, , ,
Q is sentence.
R = P v QvR
(P
Q)
This is our original sentence, which has been Constructed through a series of applications of
legal roles and is therefore well formed.
DEFINITION
PROPOSITIONAL CALCULUS SEMANTICS
An interpretation of a set of propositional is the assignment of a truth
value , either T or F , to each propositional symbol .
The symbol true is always assigned T, and the symbol false is assigned F .
P Q
P pvQ
Q P Q (pvQ)=( P Q)
T. T
T F
F T
F F
F
T
T
F
T
T
F
T
T
T
T
T
F
Figure
2.22 Truth tabble demonnstrating th
he equivallence of ( P Q) and
d
(pvQ)
By demonstrating that they have identical truth tables, we can prove the following prepositional calculus
equivalences. For prepositional expressions P, Q, and R;
(P) = P
(P v Q)=( P
Q)
Q)=( Q
R) = ( P
P) and ( P v Q ) = ( Q v P )
(Q R))
R) = ( P v Q)
(Q v R) = ( P
(P v R)
Q) v (P
R)
2-
3.
4-
go(tom, mountains).
tall (X))
likes(X, anchovies)),
ride(beggars).
X likes(X,taxes).
a v b. This transformation
X b X
4. Move all quantifiers to the left without changing their order. This is
possible. because step 3 has removed the possibility of any conflict
between variable names. (iv) now becomes:
,
After step 4 the clause is said to be in prenex normal form, because all
the quantifiers are in front as a prefix and the expression or matrix
follows after.
5. At this point all existential quantifiers are eliminated by a process called
skolemization. Expression (v) has an existential quantifier for Y.
When an expression contains an existentially quantified variable, for
example, ( Z)(foo(...Z,...)), it may be concluded that there is an
assignment to Z under which foo is true. Skolemization identifies such a
value. Skolemization does not necessarily show how to produce such a
value; It is only a method for giving a name to an assignment that must
exist. If k represents that assignment, then we have foo(.K.).
Thus:
We note that the existentially quantified Z was. Within the scope (to the
right of) universally quantified X and Y Thus the skolemassignment is a
function of X and Y but not of W. With skolemization (v) becomes:
b X
c X,I
or
must be
8. Now call each conjunct a separate clause. In the example (viii) above
there are two clauses:
,
,
9. The final step is to standardize the variables apart again. This requires
giving. The variable in each clause generated by step 8 different names.
This procedure arises from the following equivalence:
Which follows from the nature of variable names as place holders. (ixa)
and (ixb) now become, using new-variable names U and V:
,
,
Ex (3): As a final example, suppose:
"All people who are not poor and are smart are hippy. Those people who'
read are not stupid. John can read are is wealthy. Happy people have
exciting lives. Can anyone be found with an exciting life?"
a) First change the sentences to predicate form:
We assume
and get:
Poor X
read (john)
poor (john)
(happy (Z)
exciting (Z)
The negation of the conclusion is:
W (exciting (W))
b) These predicate calculus expressions for the happy life problem are
transformed into the following clauses:
poor (X) smart (X) happy (X)
read (Y) ......
smart(Y)
read (john)
poor (john)
happy (Z)
exciting (Z)
exciting (W)
The resolution refutation for this example is found in Figure (3-4).
exciting(W)
happy(Z) )
exciting (Z)
(Z/W)
happy (Z)
poor (X)
smart (X)
happy (X)
(X/Z)
poor (X)
smart (X)
read (Y)
smart(Y)
(Y/X)
poor(john)
(john/Y)
read(john)
(
read (john)
)
1IntelligentSearchMethodsandStrategies
Search is inherent to the problem and methods of artificial
intelligence (AI). This is because AI problems are intrinsically complex.
Efforts to solve problems with computers which human can routinely
innate cognitive abilities, pattern recognition, perception and
experience, invariably must turn to considerations of search. All search
methods essentially fall into one of two categories, exhaustive (blind)
methodsandheuristicorinformedmethods.
2StateSpaceSearch
The state space search is a collection of several states with
appropriate connections (links) between them. Any problem can be
represented as such space search to be solved by applying some rules
withtechnicalstrategyaccordingtosuitableintelligentsearchalgorithm.
What we have just said, in order to provide a formal description of a
problem,wemustdothefollowing:
1 Define a state space that contains all the possible configurations
oftherelevantobjects(andperhapssomeimpossibleones).Itis,
of course, possible to define this space without explicitly
enumeratingallofthestatesitcontains.
2 Specify one or more states within that space that describe
possible situations from which the problemsolving process may
start.Thesestatesarecalledtheinitialstates.
3 Specifyoneormorestatesthatwouldbeacceptableassolutions
totheproblem.Thesestatesarecalledgoalstates.
Whenasolutionisfound,isitguaranteedtobeoptimal?
What is the complexity of the search process in terms of time
usage?Memoryusage?
How can the interpreter most effectively reduce search
complexity?
How can an interpreter be designed to most effectively utilize a
representationlanguage?
Togetasuitableanswerforthesequestionssearchcanbestructured
into three parts. A first part presents a set of definitions and concepts
thatlaythefoundationsforthesearchprocedureintowhichinductionis
mapped.Thesecondpartpresentsanalternativeapproachesthathave
beentakentoinductionasasearchprocedureandfinallythethirdpart
present the version space as a general methodology to implement
induction as a search procedure. If the search procedure contains the
principles of the above three requirement parts, then the search
algorithmcangiveaguaranteetogetanoptimalsolutionforthecurrent
problem.
3GeneralProblemSolvingApproaches
Thereexistquitealargenumberofproblemsolvingtechniquesin
AI that rely on search. The simplest among them is the
generateandtest method. The algorithm for the generateandtest
methodcanbefom1allystatedinthefigure(1)follow.
It is clear from the above algorithm that the algorithm continues the
possibilityofexploringanewstateineachiterationofthe repeatuntil
loop and exits only when the current state is equal to the goal. Most
importantpartinthealgorithmistogenerateanewstate.Thisisnotan
easytask.
ProcedureGenerate&Test
Begin
Repeat
Generateanewstateandcallitcurrentstate;
Untilcurrentstate=Goal;
End.
Figure(1)GenerateandTestAlgorithm
If generation of new states is not feasible, the algorithm should be
terminated. In our simple algorithm, we, however, did not include this
intentionallytokeepitsimplified.Buthowdoesonegeneratethestates
of a problem? To formalize this, we define a four tuple, called state
space,denotedby
{nodes,arc,goal,current},
where
nodesrepresentthesetofexistingstatesinthesearchspace;
an arc denotes an operator applied to an existing state to cause
transition to another state; goal denotes the desired state to be
identifiedinthenodes;andcurrentrepresentsthestate,nowgenerated
for matching with the goal. The state space for most of the search
problemstakestheformofatreeoragraph.Graphmaycontainmore
than one path between two distinct nodes, while for a tree it has
maximumvalueofone.
To build a system to solve a particular problem, we need to do four
things:
1. Definetheproblemprecisely.Thisdefinitionmustincludeprecise
specifications of what the initial situation(s) will be as well as
what final situations constitute acceptable solutions to the
problem.
2. Analyzetheproblem.Afewveryimportantfeaturescanhavean
immense impact on the appropriateness of various possible
techniquesforsolvingtheproblem.
3. Isolate and represent the task knowledge that is necessary to
solvetheproblem.
4. Choosethebestproblemsolvingtechnique(s)andapplyit(them)
totheparticularproblem.
Measuring problemsolving performance is an essential matter in
termofanyproblemsolvingapproach.Theoutputofaproblemsolving
algorithmiseitherfailureorasolution.(Somealgorithmmightgetstuck
in an infinite loop and never return an output.) We will evaluate an
algorithm'sperformanceinfourways:
Completeness: Is the algorithm guaranteed to find a
solutionwhenthereisone?
Optimality:Doesthestrategyfindtheoptimalsolution?
Timecomplexity:Howlongdoesittaketofindasolu on?1
Spacecomplexity:Howmuchmemoryisneededtoperform
thesearch?
4SearchTechnique
Having formulated some problems, we now need to solve them.
Thisisdonebyasearchthroughthestatespace.Therootofthesearch
treeisasearchnodecorrespondingtotheinitialstate.Thefirststepisto
testwhetherthisisagoalstate.Becausethisisnotagoalstate,weneed
to consider some other states. This is done by expanding the current
state; that is, applying the successor function to the current state,
therebygenerating anewsetofstates.Nowwe mustchoosewhich of
thesepossibilitiestoconsiderfurther.Wecontinuechoosing,testingand
expanding either a solution is found or there are no more states to be
expanded. The choice of which state to expand is determined by the
search strategy. It is important to distinguish between the state space
and the search tree. For the route finding problem, there are only N
states in the state space, one for each city. But there are an infinite
numberofnodes.
There are many ways to represent nodes, but we will assume that a node is
a data structure with five components:
STATE: the state in the state space to which the node corresponds
PARENT-NODE: the node in the search tree that generated this
node
ACTION: the action that was applied to the parent to generate the
node
DEPTH:thenumberofstepsalongthepathfromtheinitialstate.
5SearchTechniqueTypes
Usuallytypesofintelligentsearchareclassifiedintothreeclasses;
blind, heuristic and random search. Blind search is a technique to find
thegoalwithoutanyadditionalinformationthathelptoinferthegoal,
with this type there is no any consideration with process time or
memory capacity. In the other side the heuristic search always has an
evaluating function called heuristic function which guides and controls
the behavior of the search algorithm to reach the goal with minimum
cost,timeandmemoryspace.Whilerandomsearchisaspecialtypeof
search in which it begins with the initial population that is generated
randomly and the search algorithm will be the responsible for
generatingthenewpopulationbasesonsomeoperationsaccordingtoa
specialtypefunctioncalledfitnessfunction.Thefollowingsectionshave
detailsofeachtypeofsearchwithsimpleexamples.
5.1BlindSearch
There many search strategies that come under the heading of
blind search (also called uniformed search). The term means that they
havenoadditionalinformationaboutstatesbeyondthatprovidedinthe
problem definition. All they can do is generate successors and
distinguishagoalstatefromanongoalstate.
Thus blind search strategies have not any previous information
aboutthegoalnorthesimplepathsleadtoit.Howeverblindsearchis
not bad, since more problems or applications need it to be solved; in
other words there are some problems give good solutions if they are
solvedbyusingdepthorbreadthfirstsearch.
Breadth first search is a simple strategy in which the root node is
expanded first, then all the successors of the root node are expanded
next, then their successors, and so on. In general all the nodes are
expanded at a given depth in the search tree before any nodes at the
next level are expanded. Breadth first search can be implemented by
calling TREESEARCH with any empty fringe that is a firstinfirstout
(FIFO) queue, assuring that the nodes that are visited first will be
expanded first. In other words, calling TREESEARCH (problem,
FIFOQUEUE) result in a breadth first search. The FIFO queue puts all
newlygeneratedsuccessorsattheendofthequeue,whichmeansthat
shallownodesareexpandedbeforedeepernodes.
Depth first search always expands the deepest node in the current
fringe of the search tree. The search proceeds immediately to the
deepestlevelofthesearchtree,wherethenodeshavenosuccessors.As
those nodes are expanded, they are dropped from the fringe, so then
the search backs up to the next shallowest node that still has
unexplored successors. This strategy can be implemented by
TREESEARCHwithalastinfirstout(LIFO)queue,alsoknownasastack.
AsanalternativetotheTREESEARCHimplementation,itiscommonto
implementdepthfirstsearchwitharecursivefunctionthatcallsitselfon
eachofitschildreninturn.
Initialstate
Goalstate
Figure(2)BlindSearchTree
Thepathsfromtheinitialstate(A)tothegoalstate(H)are:
UsingBreadthfirstsearch ABCDEFGH
UsingDepthfirstsearch ABDGEH
5.2Heuris cSearch
Classicallyheuristicsmeansruleofthumb.Inheuristicsearch,we
generally use one or more heuristic functions to determine the better
candidate states among a set of legal states that could be generated
from a known state. The heuristic function, in other words, measures
thefitnessofthecandidatestates.Thebettertheselectionofthestates,
the fewer will be the number of intermediate states for reaching the
goal.However;themostdifficulttaskinheuristicsearchproblemsisthe
selectionoftheheuristicfunctions.Onehastoselectthemintuitively,so
thatinmostcaseshopefullyitwouldbeabletoprunethesearchspace
correctly.
The search processes that will be described in this chapter build on
the fact that the search does not proceed uniformly outward from the
start node: instead, it proceeds preferentially through nodes that
heuristic, problemspecific information indicates might be on the best
pathtoagoal.Wecallsuchprocessesbestfirstorheuristicsearch.Here
isthebasicidea.
1. We assume that we have a heuristic (evaluation) function, f. to
help decide which node is the best one to expand next. This
functionisbasedoninformationspecifictotheproblemdomain.
Itisrealvaluedfunctionofstatedescriptions.
2. Expand next that node, n, having the smallest value of f(n).
Resolvetiesarbitrarily.
3. Terminatewhenthenodetobeexpandednextisagoalnode.
A function which applies such an algorithm to nodes and assigns a
value to them accordingly is a heuristic function. Determining good
excellentpathtobeoverlooked.But,ontheaverage,theyimprovethe
quality of the paths that are explored. Using good heuristics, we can
hope to get good (though possibly nonoptimal) solutions to hard
problems,suchasthetravelingsalesman,inlessthanexponentialtime.
There are some good generalpurpose heuristics that are useful in a
widevarietyofproblemdomains.Inaddition,itispossibletoconstruct
specialpurpose heuristics that exploit domainspecific knowledge to
solveparticularproblems.
Performance of the search can be drastically improved by using
specificknowledgeaboutasearchproblemtoguidethedecisionsmade
where to search. This knowledge can be presented in the form of
heuristicsrulesthatguidethedecisionmakingduringthesearch.This
givesusanotherclassofheuristicsearchalgorithms.Itisquiteobvious
thatheuristicswilldependverymuchontheclassofsolvableproblems.
The heuristic rules class is considered one of the more important and
complex way to guide the search procedure in which to reach the
solution (goal state) such class usually used in embedded system so to
formwhattodayknownassearchingwithheuristicembeddedinrules.
Thesearchforplansisguidedbyheuristicsthatprovideanestimate
of the cost (heuristic value) that are extracted automatically from the
problem encoding P. In order to simplify the definition of some of the
heuristics, we introduce in some cases a new dummy End action with
zerocost,whosepreconditionsG1,...,Gnarethegoalsoftheproblem,
andwhoseeffectisadummyatomG.Insuchcases,wewillobtainthe
heuristic estimate h(s) of the cost from state s to the goal, from the
estimateh(G;s)ofachievingthedummyatomGfroms.Inthesection
3.7adetaildescriptionabouttheheuristicsearchalgorithmswithsimple
examples.
5.3RandomSearch
Random Search is a method of searching with no planned
structure or memory. This method has the same intent of the typical
intuitive search, but the opposite strategy to achieve it. A random
technique may be preferred if it takes more time to devise a better
technique,ortheadditionalworkinvolvedisnegligible.
Random Search (RS) is a populationbased search algorithm. It is
first proposed by Price and also called Price's algorithm. RS first
randomlygeneratesapopulationofsamplesfromtheparameterspace,
andthenusesdownhillsimplexmethodtomovethepopulationtowards
the global optima. Suppose a ndimensional objective function is to be
optimized,thebasicRSalgorithmcanbedescribedasfollows:
1. Randomlygenerateapopulationofmpointsfromtheparameter
space.
2. Randomly select n+1 points from the population and make a
downhillsimplexmove.
3. If the new sample is better than the worst member in the
population, then the worst member is replaced with this new
sample.
4. Repeat the above process until a certain stopping criterion is
satisfied.
InRS,randomsamplingisusedforexplorationanddownhillsimplexfor
exploitation. Its balance strategy first executes exploration and then
switchescompletelytoexploitation.Sinceexplorationisonlyperformed
inthebeginningofthesearch,theconvergencetotheglobaloptimais
notguaranteed.Theproblemofgettingtrappedinalocalextremecan
be alleviated by using a large population or introducing new members
intothepopulationwithrandomsamplingduringthesearch.Despiteof
this disadvantage, RS has proved to be very effective in practice and is
widelyused.Inaddition,sincethereisnolocalsearchmethodinvolved,
RSismorerobusttonoiseintheobjectivefunction.Besidesitsfailingto
provide the convergence guarantee, another disadvantage is its low
efficiency. Especially in the beginning, the population is composed of
randomsamples
andRSessentiallyperformslikeapurerandomsampling.Therefore,for
manysituationsinpracticewhereitisdesiredtoobtainagoodsolution
quickly,RSmaynotbeabletofulfilltheobjective.
TomakesurethatRSbeingwithsuitablesolutionsthealgorithm
mustbeevolvedtodecidethefollowingfeatures:
High efficiency is required for the desired search algorithm. More
specifically,theemphasisofthesearchalgorithmshouldbeonfindinga
betteroperatingpointwithinthelimitedtimeframeinsteadofseeking
thestrictlyglobaloptimum.
High dimension isanotherfeatureinsolveproblems.Highdimensional
optimization problems are usually much more difficult to solve than
lowdimensionalproblemsbecauseofcurseofdimensionality.
6HeuristicSearchAlgorithms
In this section, we can saw that many of the problems that fall
withinthepurviewofartificialintelligencearetoocomplextobesolved
by direct techniques; rather they must be attacked by appropriate
searchmethodsarmedwithwhateverdirecttechniquesareavailableto
guide the search. These methods are all varieties of heuristic search.
They can be described independently any particular task or problem
domain.ButwhenappliedtoParticularproblems,theirefficacyishighly
dependentonthe waythey exploit domainspecificknowledgesincein
and of themselves they are unable to overcome the combinatorial
explosion towhichsearchprocessesaresovulnerable.Forthis reason,
thesetechniquesareoftencalledweakmethods.Althougharealization
of the limited effectiveness of these weak methods to solve hard
problems by themselves has been an important result that emerged
from the last decades of AI research, these techniques continue to
provide the framework into which domainspecific knowledge can be
placed,eitherbyhandorasaresultofautomaticlearning.
Hill climbing is a variant of generateandtest in which feedback from
thetestprocedureisusedtohelpthegeneratordecidewhichdirection
tomoveinthesearchspace.Inapuregenerateandtestprocedure,the
test function responds with only a yes or no. but if the test function is
augmented with a heuristic function that provide an estimate of how
closeagivenistoagoalstate.Thisisparticularlynicebecauseoftenthe
computationoftheheuristicfunctioncanbedoneatalmostnocostat
the same time that the test for a solution is being performed. Hill
climbing is often used when a good heuristic function is available for
Step1
Step2
B
Step3
(3)
(5)
(1)
(3)
(5)
(7)
(6)
Step4
A
(3)
(5)
(7)
(2)
E
Figure (3) Hill Climbing Search Tree
(1)
Step1
Step2
(3)
(5)
(5)
(4)
(1)
Step3
Step4
(3) C
(4)
(5)
(6) F
(6)
(5)
Step5
A
(6)
(5)
(5)
(4)
(2)
(1)
(6)
Theeffectivenessofthealphabetaproceduredependsgreatlyon
theorderinwhichpathsareexamined.Iftheworstpathsareexamined
first,thennocutoffsatallwilloccur.But,ofcourse,ifthebestpathwere
7A*Search:minimizingthetotalestimatedsolutioncost
The most widelyknown form of bestfirst search is called A*
search (pronounced "Astar search"). It evaluates nodes by combining
g(n),thecosttoreachthenode,andh(n),thecosttogetfromthenode
tothegoal:
f(n)=g(n)+h(n).
Sinceg(n)givesthepathcostfromthestartnodetonoden,andh(n)is
theestimatedcostofthecheapestpathfromntothegoal,wehave
f(n)=estimatedcostofthecheapestsolutionthroughn.
Thus,ifwearetryingtofindthecheapestsolution,areasonablethingto
tryfirstisthenodewiththelowestvalueofg(n)+h(n).Itturnsoutthat
this strategy is more than just reasonable: provided that the heuristic
function h(n) satisfies certain conditions, A* search is both complete
function at node x, denoted by f(x), is the sum of g(x) plus h(x). The
generation cost g(x) can be measured easily as we generate node x
through a few slate transitions. For instance, if node x was generated
fromthestartingnodethroughmstatetransitions,thecostg(x)willbe
proportionaltom(orsimplym).Buthowdoesoneevaluatetheh(x)?It
may be recollected that h(x) is the cost yet to be spent to reach the
goal from the current node x. Obviously, any cost we assign as h(x) is
through prediction. The predicted cost for h(x) is generally denoted by
h'(x).Consequently,thepredictedtotalcostisdenotedbyf(x),where:
f'(x)=g(x)+h'(x).
7.2A*Procedure
Here are the basic steps that are considered to implement the A*
proceduretosolveproblemsinanintelligentmanner:
1. Operations on states generate children of the state currently
underexamination.
2. Eachnewstateischeckedtoseewhetherithasoccurredbefore
therebypreventingloops.
3. Eachstatenisgivenanfvalueequaltothesumofitsdepthinthe
searchspaceg(n)andaheuristicestimateofitsdistancetoagoal
h(n).
4. Statesonopenaresortedbytheirfexaminedoragoal.
5. As an implementation point, the algorithms can be improved
throughmaintenanceofperhapsasheapsorleftisttrees.
8TheAlphaBetaSearchAlgorithm
Theideaforalphabetasearchissimple:ratherthansearchingthe
entire space to the ply depth, alphabeta search proceeds in a
depthfirst fashion. Two values, called alpha and beta, are created
during the search. The alpha value associated with MAX nodes, can
never decrease, and the beta value associated with MIN nodes, can
neverincrease.Tworulesforterminatingsearch,basedonalphaand
betavalues,are:
1. SearchcanbestoppedbelowanyMINnodehavingabetavalue
lessthanorequaltothealphavalueofanyofitsMAXancestors.
2. Search can be stopped below any MAX node having an alpha
value greater than or equal to the beta value of any of its MIN
nodeancestors.
Alphabetapruningthusexpressesarelationbetweennodesatplyn
andnodesatplyn+2underwhichen resubtreesrootedatleveln+
1 can be eliminated from considera on. Note that the resul ng
backedup value is identical to the minimax result and the search
savingoverminimaxisconsiderable.Withfortuitousorderingstates
in the search space, alphabeta can effectively double the depth of
the search considered with a fixed space/time computer
commitment.Ifthereisaparticularunfortunateordering,alphabeta
searches no more of the space than normal minimax; however, the
searchisdoneinonlyonepass.
8.1TheAlphaBetaCutoffProcedure(TreePruning)
c(n)=M(n)O(n)
WhereM(n)=numberofmypossiblewinninglines.
Now, we will discuss a new type of algorithm, which does not
require expansion of the entire space exhaustively. This algorithm is
referred to as alphabeta cutoff algorithm. In this algorithm, two extra
ply of movements are considered to select the current move from
alternatives. Alpha and beta denote two cutoff levels associated with
MAXandMINnodes.AsitismentionedbeforethealphavalueofMAX
nodecannotdecrease,whereasthebetavalueoftheMINnodescannot
increase.Buthowcanwecomputethealphaandbetavalues?Theyare
the backed up values up to the root like MINIMAX. There are a few
interestingpointsthatmaybeexploredatthisstage.Priortotheprocess
of computing MAX / MIN of the backed up values of the children, the
alphabeta cutoff algorithm estimates e(n) at' all fringe nodes n. Now,
the values are estimated following the MINIMAX algorithm. Now, to
prunetheunnecessarypathsbelowanode,checkwhether:
The beta value of any MIN node below a MAX node is less than or
equal to its alpha value. If yes. prune that path below the MIN node.
The alpha value of any MAX node below a MIN node exceeds the
beta value of the MIN node. if yes prune the nodes below the MAX
node.
Based on the above discussion, we now present the main steps in the -
search algorithm.
NewProgramming
Expert
Methodfor
Figure(1)thevectorsofexpertsystemdevelopment
AsshowninFigure(1),thedevelopmentofexpertsystemsisbased
ontwodistinct,yetcomplementary,vectors:
a.Newprogrammingtechnologiesthatallowustodealwithknowledge
andinferencewithease.
b. New design and development methodologies that allow us to
effectivelyusethesetechnologiestodealwithcomplexproblems.
The successful development of expert systems relies on a well
balancedapproachtothesetwovectors.
Expertsystems
programming
Procedural
i
Figure(2)threekindsofprogramming
In traditional programming (procedural programming), the
computerhastobetoldingreatdetailexactlywhattodoandhowtodo
it.Thisstylehasbeenverysuccessfulforproblemsthatarewelldefined.
Theyusuallyarefoundindataprocessingorinengineeringorscientific
work.
AI programming sometimes seems to have been defined by
default, as anything that goes beyond what is easy to do in traditional
procedural programs, but there are common elements in most AI
programs.Whatcharacterizesthesekindsofprogramsisthattheydeal
with complex problems that are often poorly understood, for which
there is no crisp algorithmic solution, and that can benefit from some
sortofsymbolicreasoning.
goto
dowhile
procedurecalls
repeatuntil
sequentialexecution(asdefault)
AIprogramsareusuallywritteninlanguageslikeLispandProlog.
Program variables in these languages have an ephemeral existence on
the stack of the underlying computer rather than in fixed memory
locations. Data manipulation is done through pattern matching and list
building.Thelisttechniquesaredeceptivelysimple,butalmostanydata
structure can be built upon this foundation. Many examples of list
buildingwillbeseenlaterwhenwebegintouseProlog.AIprogramsalso
useadifferentsetofcontrolconstructs.Theyare:
procedurecalls
sequentialexecution
recursion
Defineproblemsandgoals
Designandconstructprototype
Test/usesystem
Analyzeandcorrectshortcoming
Aredesign
assumptions
still correct
No
No
Readyfor
final
evaluation
Yes
Final
evaluation
failed
Figure(3)Theexploratorycycleforexpertsystem
Explanation
processor
User
Interface
Inference
engine
Knowledge
base
Working
memory
Figure(4)Expertsystemarchitecture
Theuserinteractswiththeexpertsystemthroughauserinterface
that make access more comfortable for the human and hides much of
the system complexity. The interface styles includes questions and
answers,menudriver,naturallanguages,orgraphicsinterfaces.
Thesystemneverneedstoaskforadditionalinformationwhenit
is working in the upper parts of the tree. These nodes represent
conclusionsthatthesystemhasfiguredout.ratherthanaskedfor.soa
WHYquestionisnotpertinent.
To be able to make the conclusions at the top of the tree,
however,isthepurposeforwhichallthereasoningisbeingdone.The
system is trying to deduce information about these conclusions. It is
appropriatetoaskaHOWquestionwhenthesystemreportstheresults
ofitsreasoningaboutsuchnodes.