专家系统

专家系统[20200907172443]
I.介绍
专家系统是源自计算机科研领域中被称为人工智能(AI)的的I.个分支计算机程序系统.
人工智能的科学目标是通过建立具有智能行为的计算机程序来了解智能这个概念.这与符号推理,或者通过计算机来解释问题的概念和方法有关,此外,计算机主机将致力于如何让应用知识来推理的工作.
当然,智力这个概念涵盖了各方面的认知识别技能,包括解决问题,学习和理解语言的能力.AI可以实现这些功能.但是大多数进程在解决问题这I.方面不断地更新----建立合理解释问题的方式和方法,而不是简单地计算出I.个解决方案.
借助于不断积累关于特殊任务的知识,从而在任务领域解决问题时,能达到专家级水平的人工智能程序被称为知识型系统或者人工系统.通常,专家系统用于存储I.些程序,而这些程序的知识库包括人类专家使用的知识,而不是从教科书或者非专家人士收集来的知识.往往,专家系统与知识型系统两者被当作I.样来使用,被I.起视为被最广泛使用智能应用系统.在专家系统中捕捉到的人类智能尝试,我们称之为任务域.任务涉及到I.些目标导向以及解决问题的方式.领域与任务执行的区域有关.其中较典型的任务有判断,分析,时序安排,配置与设计等.
建立I.个专家系统主要是知识工程学方面的工作,而做这些工作的人被称作知识工程师.知识工程师必须确保计算机配有所有解决I.个问题所需要的知识信息.知识工程师必须选择I.个或者更多在计算机存储区域内将所需的知识转化成符号模式的形式.其必须确保计算机可以有效的从I.系列推理方法中选择使用.我们将在之后的内容中描述计算机工程学的实践.首先,我们对专家系统进行描述.
II专家系统的构建块
每I.个专家系统包括两个主要的部分:知识库和推理,或称为推论,工具.专家系统的知识库包括事 *好棒文|www.hbsrm.com +Q: 3 5 1 9 1 6 0 7 2 
实性知识和启发式知识.事实性知识是指知识广泛共享的任务领域,通常在教科书或期刊中可以看到,而且在特定领域中,基本上这些知识被也I.致认可.
启发式知识在操作方面没有这么严格,但是需要更多的经验,更多的判断能力.与事实性知识相比,启发式
知识少有被讨论,主要是个人进行操作研究,并集合了良好实践能力,高效的判断力和貌似合理的推理.
知识表达形成并将知识进行组织.生产式规则或者简化规则是应用比较广泛的.I.个规则由I.个IF(如果)部分和I.个(那么)部分构成.(也称为条件和功能).如果规则的IF部分没有问题,那么IF部分在逻辑合并中列出I.些列的条件就与开发中的推理这I.条线路有关.因而,THEN部分可以进行推断或者可以采取解决问题的方式.在规则形式中所代表的专家系统的知识就是规则的系统.
另I.种被广泛应用的表达叫做单元(也可称为框架,纲要或者清单结构).单元I.个更消极的知识观点,也是待展示的实体
另I.个广泛使用的表示,称为单元(也称为框架,模式,或列表结构)是知识的更消极的观点,集合了I.些待展示的相关联的象征性知识
典型情况下,I.个单元由I.个实体的属性列表和这些属性的相关值组成.
因为每个任务域包含许多涉及各种关系的实体,属性也可以用于明确关系.这些属性的价值是其他通过关系来连接的单元的名称.I.个单元可以表示另I.个单元的特例"知识,或者说I.些单元可以是另I.个单元的某些"部分.
解决问题的模式组织并控制着解决问题所需要的步骤.I.个常规而又非常有效的模式涉及形成I.系列论断的如果-那么"规则的链接,进而得出结论.我们称此方法为正向推理.如果结论是已知发(举例来说,I.个目标是可实现的)但是得出结论的方式是未知的,那么这种推理称为逆向推理.在知识库中控制并使用知识从而形成I.系列推理的推理工具或者推理流程编入了这些解决问题的方式.
I.个专家所使用的知识库就是他在学校所学,工作中向同事所学以及多年生活工作经验所学.据推测,他的经验越多,他大脑中存储的知识也就越多.知识使得他能够诠释自身知识库提供的信息,从而更好的运用于诊断,设计和分析.
尽管专家系统主要包括I.个知识库和I.个推理工具,其他I.些特征也值得I.提:不确定性推理和I.系列推理的诠释.
知识本身总具有不完全性与不确定性.要处理不确定的知识,必须借助置信因数或者权重的规则进行协助.我们将I.系列使用不确定性知识兼不确定数据的方式称为不确定性推理.其中I.个重要的不确定性推理子集叫做"模糊逻辑,使用这个逻辑的系统即为"模糊系统
因为专家系统使用不确定或探索性的知识(就如我们人类所做的)其确实性往往就在问题中(与人类的案例I.样).当I.个问题的答案可疑的时候,我们往往想知道理由.如果理由看似是可信的,我们倾向于相信这个答案.专家系统也是如此.大多数专家系统有能力回答形式意义上的问题:为什么答案是X?系统可以通过由推理引擎追溯I.系列推理来解释原因.
不管在任何专家系统中,知识都是最重要的部分.专家系统的作用在于其包含的关于任务域的特定的,高水平的知识.AI研究人员将不断致力于开发并丰满现有的知识表述和推理方式的清单.由于知识在专家系统中的重要性以及现有的知识兼并方式很缓慢很乏味,专家系统的将来很大层面上取决于打破知识兼并的瓶颈和编辑,表达I.个宏大的知识结构.
I *好棒文|www.hbsrm.com +Q: 3 5 1 9 1 6 0 7 2 
II知识工程
知识工程是设计与建成专家系统的艺术灵魂,而知识工程师是其实践者.就我们之前所述,知识工程师是人工智能科学的I.个应用部分,而这相应地,也是计算机科学的I.部分.理论上来说,这样I.来,知识工程师就是I.个知道如何设计和执行构成人工智能科技程序的计算机科学家.知识工程的本质是改变,然而,也在孕育I.代新新的知识工程师.
尽管存在不同的知识管理风格和方法,基本的方式还是I.致的:I.个知识工程对I.个或I.组人类学专家进行面试和观察,从而了解到这些专家专业于什么以及他们是如何用自己的知识来进行推理的.工程师随即将其知识转换编辑为计算机语言,然后设计I.个相应的推理引擎和I.个恰当使用知识推理结构.他同时也决定着如何在推理过程中整合不确定性知识的使用,以及何种解释将会对最终用户有用.
接着,程序员对表述知识以及解释所需的推理引擎和方法进行编程,同时I.步步进入知识域.也许是推理引擎正好不正确,执行任务所需的对应知识表述的形成遇到了尴尬的局面.专家可能会讨论决定那部分知识是错误的.等发现这些问题,并随即I.步步调整,最后专家会逐步变得完整.
机械推理及知识表述的技术的发现和积累通常也就是人工智能研究工作的核心.任务域的知识的发现和积累是领域专家的负责研究的范畴.领域知识由正式的,书面知识和经验累积的知识-专家的专业知识组成.
如果你认定你的问题是可以解决的,你需要从专家那里获得所需的知识然后使用你的专家系统外壳来表述它.这是知识工程师的工作,但是涉及到专家们和最终使用者的紧密合作.
知识工程师是就是人工智能语言,而且也是其表述专家.他/她应该能够为项目选择I.个合适的专家系统外壳(或者其他工具),从专家那里获取知识,并在I.种正确有效的知识库中使知识生效.
要从专家那里获得知识,知识工程师首先,必须至少在某种程度上,也许通过介绍性文字或者与专家谈话等方式,对问题领域很熟悉.典型情况下,专家设下I.系列的问题,并会解释他们解决这个问题所用的推理.知识工程师会从这些解释中获取总体的规则,并会与专家I.起核实这些规则.
正如在大多数应用中I.样,如果使用者对此不满意,那么这个系统就是废弃了.所以发展必须涉及到与潜在使用者的紧密合作.正如在介绍中提到的那样,基本的发展循环必须涉及到I.个初始原型快速的发展,反复测试和与专家(核实规则的有效性)和使用者(核实他们可以提供必要的信息,并对系统的性能和诠释满意,并且这个系统使他们的生活变得更简单方便而不是更麻烦)对那个原型的修正.
为了发展初始的原型,知识工程师必须对合适的知识表述和推理方式(如,规则或者规则+框架;正向链接或者逆向链接)做出临时的决断.
为了测试这些基本的涉及决定,第I.个原型必须只解决整个问题的I.小部分.如果使用的方式在那个值得投资的I.小部分问题上看上去效果很不错,其他知识的表述方面的尝试将会遵从同样的形式.
VIII.I.Introduction
ExpertSystemsarecomputerprogramsthatarederivedfromabranchofcomputerscienceresearchcalledArtificialIntelligence(AI).AIsscientificgoalistounderstandintelligencebybuildingcomputerprogramsthatexhibit
intelligentbehavior.Itisconcernedwiththeconceptsandmethodsofsymbolicinference,orreasoning,byacomputer,andhowtheknowledgeusedtomakethoseinferenceswillberepresentedinsidethemachine.
Ofcourse,thetermintelligencecoversmanycognitiveskills,includingtheabilitytosolveproblems,learn,andunderstandlanguage;AIaddressesallofthose.ButmostprogresstodateinAIhasbeenmadeintheareaofproblemsolving--conceptsandmethodsforbuildingprogramsthatreasonaboutproblemsratherthancalculateasolution.
AIprogramsthatachieveexpert-levelcompetenceinsolvingproblemsintaskareasbybringingtobearabodyofknowledgeaboutspecifictasksarecalledknowledge-basedorexpertsystems.Often,thetermexpertsystemsisreserved
forprogramswhoseknowledgebasecontainstheknowledgeusedbyhumanexperts,incontrasttoknowledgegatheredfromtextbooksornon-experts.Moreoftenthannot,thetwoterms,expertsystems(ES)andknowledge-basedsystems(KBS)areusedsynonymously.Takentogether,theyrepresentthemostwidespreadtypeofAIapplication.Theareaofhumanintellectualendeavortobecapturedinanexpertsystemiscalledthetaskdomain.Taskreferstosomegoal-oriented,problem-solvingactivity.Domainreferstotheareawithinwhichthetaskisbeingperformed.Typicaltasksarediagnosis,planning,scheduling,configurationanddesign.
Buildinganexpertsystemisknownasknowledgeengineeringanditspractitionersarecalledknowledgeengineers.Theknowledgeengineermustmakesurethatthecomputerhasalltheknowledgeneededtosolveaproblem.
Theknowledgeengineermustchooseoneormoreformsinwhichtorepresenttherequiredknowledgeassymbolpatternsinthememoryofthecomputer--thatis,he(orshe)mustchooseaknowledgerepresentation.Hemustalsoensurethatthecomputercanusetheknowledgeefficientlybyselectingfromahandfulofreasoningmethods.Thepracticeofknowledgeengineeringisdescribedlater.
Wefirstdescribethecomponentsofexpertsystems.
VIII.IITheBuildingBlocksofExpertSystems
Everyexpertsystemconsistsoftwoprincipalparts:theknowledgebase;andthereasoning,orinference,engine.Theknowledgebaseofexpertsystemscontainsbothfactualandheuristicknowledge.Factualknowledgeisthatknowledgeofthetaskdomainthatiswidelyshared,typicallyfoundintextbooksorjournals,andcommonlyagreeduponbythoseknowledgeableintheparticularfield.
Heuristicknowledgeisthelessrigorous,moreexperiential,morejudgmentalknowledgeofperformance.Incontrasttofactualknowledge,heuristicknowledgeisrarelydiscussed,andislargelyindividualistic.Itistheknowledgeofgoodpractice,goodjudgment,andplausiblereasoninginthefield.Itistheknowledgethatunderliestheartofgoodguessing."
Knowledgerepresentationformalizesandorganizestheknowledge.Onewidelyusedrepresentationistheproductionrule,orsimplyrule.Aruleconsistsofan
IFpartandaTHENpart(alsocalledaconditionandanaction).TheIFpartlistsasetofconditionsinsomelogicalcombination.Thepieceofknowledgerepresentedbytheproductionruleisrelevanttothelineofreasoningbeing
developediftheIFpartoftheruleissatisfied;consequently,theTHENpartcanbeconcluded,oritsproblem-solvingactiontaken.Expertsystemswhoseknowledgeisrepresentedinruleformarecalledrule-basedsystems.
Anotherwidelyusedrepresentation,calledtheunit(alsoknownasframe,schema,orliststructure)isbaseduponamorepassiveviewofknowledge.Theunitisanassemblageofassociatedsymbolicknowledgeaboutanentitytoberepresented.Typically,aunitconsistsofalistofpropertiesoftheentityandassociatedvaluesforthoseproperties.
Sinceeverytaskdomainconsistsofmanyentitiesthatstandinvariousrelations,thepropertiescanalsobeusedtospecifyrelations,andthevaluesofthesepropertiesarethenamesofotherunitsthatarelinkedaccordingtotherelations.
Oneunitcanalsorepresentknowledgethatisaspecialcase"ofanotherunit,orsomeunitscanbepartsof"anotherunit.
Theproblem-solvingmodel,orparadigm,organizesandcontrolsthestepstakentosolvetheproblem.OnecommonbutpowerfulparadigminvolveschainingofIF-THENrulestoformalineofreasoning.Ifthechainingstartsfromasetof
conditionsandmovestowardsomeconclusion,themethodiscalledforwardchaining.Iftheconclusionisknown(forexample,agoaltobeachieved)butthepathtothatconclusionisnotknown,thenreasoningbackwardsiscalledfor,and
themethodisbackwardchaining.Theseproblem-solvingmethodsarebuiltintoprogrammodulescalledinferenceenginesorinferenceproceduresthatmanipulateanduseknowledgeintheknowledgebasetoformalineofreasoning.
Theknowledgebaseanexpertusesiswhathelearnedatschool,fromcolleagues,andfromyearsofexperience.Presumablythemoreexperiencehehas,thelargerhisstoreofknowledge.Knowledgeallowshimtointerprettheinformationinhisdatabasestoadvantageindiagnosis,design,andanalysis.Thoughanexpertsystemconsistsprimarilyofaknowledgebaseandaninferenceengine,acoupleofotherfeaturesareworthmentioning:reasoning
withuncertainty,andexplanationofthelineofreasoning.
Knowledgeisalmostalwaysincompleteanduncertain.Todealwithuncertainknowledge,arulemayhaveassociatedwithitaconfidencefactororaweight.
Thesetofmethodsforusinguncertainknowledgeincombinationwithuncertaindatainthereasoningprocessiscalledreasoningwithuncertainty.Animportantsubclassofmethodsforreasoningwithuncertaintyiscalledfuzzylogic,"andhesystemsthatusethemareknownasfuzzysystems."
Becauseanexpertsystemusesuncertainorheuristicknowledge(aswehumansdo)itscredibilityisofteninquestion(asisthecasewithhumans).Whenananswertoaproblemisquestionable,wetendtowanttoknowtherationale.Iftherationaleseemsplausible,wetendtobelievetheanswer.Soitiswithexpert
systems.Mostexpertsystemshavetheabilitytoanswerquestionsoftheform:WhyistheanswerX?"Explanationscanbegeneratedbytracingthelineofreasoningusedbytheinferenceengine.
Themostimportantingredientinanyexpertsystemisknowledge.Thepowerofexpertsystemsresidesinthespecific,high-qualityknowledgetheycontain
abouttaskdomains.AIresearcherswillcontinuetoexploreandaddtothecurrentrepertoireofknowledgerepresentationandreasoningmethods.Butinknowledgeresidesthepower.Becauseoftheimportanceofknowledgeinexpertsystemsandbecausethecurrentknowledgeacquisitionmethodisslowand
tedious,muchofthefutureofexpertsystemsdependsonbreakingtheknowledgeacquisitionbottleneckandincodifyingandrepresentingalargeknowledgeinfrastructure.
VIII.IIIKnowledgeengineering
Itistheartofdesigningandbuildingexpertsystems,andknowledgeengineersareitspractitioners.Westatedearlierthatknowledgeengineeringisanappliedpartofthescienceofartificialintelligence,which,inturn,isapartofcomputerscience.Theoretically,then,aknowledgeengineerisacomputerscientistwhoknowshowtodesignandimplementprogramsthatincorporateartificialintelligencetechniques.Thenatureofknowledgeengineeringischanging,however,andanewbreedofknowledgeengineersisemerging.
Thoughdifferentstylesandmethodsofknowledgeengineeringexist,thebasicapproachisthesame:aknowledgeengineerinterviewsandobservesahumanexpertoragroupofexpertsandlearnswhattheexpertsknow,andhowtheyreasonwiththeirknowledge.Theengineerthentranslatestheknowledgeintoacomputer-usablelanguage,anddesignsaninferenceengine,areasoningstructure,thatusestheknowledgeappropriately.Healsodetermineshowtointegratetheuseofuncertainknowledgeinthereasoningprocess,andwhatkindsofexplanationwouldbeusefultotheenduser.
Next,theinferenceengineandfacilitiesforrepresentingknowledgeandforexplainingareprogrammed,andthedomainknowledgeisenteredintotheprogrampiecebypiece.Itmaybethattheinferenceengineisnotjustright;theformofknowledgerepresentationisawkwardforthekindofknowledgeneededforthetask;andtheexpertmightdecidethepiecesofknowledgearewrong.Allthesearediscoveredandmodifiedastheexpertsystemgraduallygainscompetence.
Thediscoveryandcumulationoftechniquesofmachinereasoningandknowledgerepresentationisgenerallytheworkofartificialintelligenceresearch.
Thediscoveryandcumulationofknowledgeofataskdomainistheprovinceofdomainexperts.Domainknowledgeconsistsofbothformal,textbookknowledge,andexperientialknowledge--theexpertiseoftheexperts.
Havingdecidedthatyourproblemissuitableyouneedtoextracttheknowledgeromtheexpertandrepresentitusingyourexpertsystemshell.Thisisthejoboftheknowledgeengineer,butinvolvesclosecollaborationwiththeexpert(s)andtheenduser(s).
TheknowledgeengineeristheAIlanguageandrepresentationexpert.He/sheshouldbeabletoselectasuitableexpertsystemshell(andothertools)fortheproject,extracttheknowledgefromtheexpert,andimplementtheknowledgeinacorrectandefficientknowledgebase.Theknowledgeengineermayinitiallyhavenoknowledgeoftheapplicationdomain.
Toextractknowledgefromtheexperttheknowledgeengineermustfirstbecomeatleastsomewhatfamiliarwiththeproblemdomain,maybebyreadingintroductorytextsortalkingtotheexpert.Afterthis,moresystematic
interviewingoftheexpertbegins.Typicallyexpertsaresetaseriesofexampleproblems,andwillexplainaloudtheirreasoninginsolvingtheproblem.Theknowledgeengineerwillabstractgeneralrulesfromtheseexplanations,andcheckthemwiththeexpert.
Asinmostapplications,thesystemiswastediftheuserisnothappywithit,sodevelopmentmustinvolveclosecollaborationwithpotentialusers.Asmentionedintheintroduction,thebasicdevelopmentcycleshouldinvolvetherapiddevelopmentofaninitialprototypeanditerativetestingandmodificationofthatprototypewithbothexperts(tocheckthevalidityoftherules)andusers(tocheckthattheycanprovidethenecessaryinformation,aresatisfiedwiththesystemsperformanceandexplanations,andthatitactuallymakestheirlifeeasierratherthanharder!).
Inordertodeveloptheinitialprototypetheknowledgeengineermustmakeprovisionaldecisionsaboutappropriateknowledgerepresentationandinferencemethods(e.g.,rules,orrules+frames;forwardchainingorbackwardchaining).
Totestthesebasicdesigndecisions,thefirstprototypemayonlysolveasmallpartoftheoverallproblem.Ifthemethodsusedseemtoworkwellforthatsmallpartitsworthinvestingtheeffortinrepresentingtherestoftheknowledgeinthesameform.
ExpertsystemdevelopmentwasverytrendyaroundV-I.0yearsago,withunrealisticexpectationsaboutthepotentialbenefits.Nowsomecynicismhassetin.Expertsystemshellsareinfairlywideuse,butareoftenusedtosolvefairlysimpleproblems,andarechosenasmuchfortheiruserinterfaceanddevelopmentenvironmentsasfortheirinferentialabilities.
Tools,Shells,andSkeletons
Todaytherearetwowaystobuildanexpertsystem.Theycanbebuiltfromscratch,orbuiltusingapieceofdevelopmentsoftwareknownasatool"orashell."Comparedtothewidevariationindomainknowledge,onlyasmallnumberofAImethodsareknownthatareusefulinexpertsystems.Thatis,currentlythereareonlyahandfulofwaysinwhichtorepresentknowledge,ortomakeinferences,ortogenerateexplanations.Thus,systemscanbebuiltthatcontaintheseusefulmethodswithoutanydomain-specificknowledge.Suchsystemsareknownasskeletalsystems,shells,orsimplyAItools.
Buildingexpertsystemsbyusingshellsofferssignificantadvantages.Asystemcanbebuilttoperformauniquetaskbyenteringintoashellallthenecessaryknowledgeaboutataskdomain.Theinferenceenginethatappliestheknowledgetothetaskathandisbuiltintotheshell.Iftheprogramisnotverycomplicatedandifanexperthashadsometrainingintheuseofashell,theexpertcanentertheknowledgehimself.
Manycommercialshellsareavailabletoday,ranginginsizefromshellsonPCs,toshellsonworkstations,toshellsonlargemainframecomputers.Theyrangeinpricefromhundredstotensofthousandsofdollars,andrangeincomplexityfromsimple,forward-chained,rule-basedsystemsrequiringtwodaysoftrainingtothosesocomplexthatonlyhighlytrainedknowledgeengineerscanusethemtoadvantage.Theyrangefromgeneral-purposeshellstoshellscustom-tailoredtoaclassoftasks,suchasfinancialplanningorreal-timeprocesscontrol.Althoughshellssimplifyprogramming,ingeneraltheydonthelpwithknowledgeacquisition.Knowledgeacquisitionreferstothetaskofendowingexpertsystemswithknowledge,ataskcurrentlyperformedbyknowledgeengineers.Thechoiceofreasoningmethod,orashell,isimportant,butitisntasimportantastheaccumulationofhigh-qualityknowledge.Thepowerofanexpertsystemliesinitsstoreofknowledgeaboutthetaskdomain--themoreknowledgeasystemisgiven,themorecompetentitbecomes.
VIII.IVBenefitstoEnd-Users
Primarily,thebenefitsofESstoendusersinclude:
Aspeed-upofhumanprofessionalorsemi-professionalwork--typicallybyafactoroftenandsometimesbyafactorofahundredormore.
Withincompanies,majorinternalcostsavings.Forsmallsystems,savingsaresometimesinthetensorhundredsofthousandsofdollars;butforlargesystems,ofteninthetensofmillionsofdollarsandashighashundredsofmillionsofdollars.Thesecostsavingsarearesultofqualityimprovement,amajormotivationforemployingexpertsystemtechnology.
Improvedqualityofdecisionmaking.Insomecases,thequalityorcorrectnessofdecisionsevaluatedafterthefactshowaten-foldimprovement.
Preservationofscarceexpertise.ESsareusedtopreservescarceknow-howinorganizations,tocapturetheexpertiseofindividualswhoareretiring,andtopreservecorporateknow-howsothatitcanbewidelydistributedtootherfactories,officesorplantsofthecompany.
Introductionofnewproducts.Agoodexampleofanewproductisapathologyadvisorsoldtoclinicalpathologistsinhospitalstoassistinthediagnosisofdiseasedtissue.
Theexpertsystemsbusiness
Theindustry,particularlyintheUnitedStates,consistsofmanysmallcompanies,ordivisionsoflargercompanies,whicharesellingbothexpertsystemdevelopmentsoftwareandsupportservicesforassistingwiththeusageofthatsoftwareordevelopmentofexpertsystems.Typicalannualrevenuesforasmallcompanyordivisionofalargercompanyrangefrom$Vmillionto$II0million.Theaggregatetotalofsuchsalesworldwideisintherangeofseveralhundredmilliondollarsperyear.
Sellingconsultingservicesisavigorouspartoftheexpertsystembusiness.IntheUnitedStates,consultingisdonebymajorconsultingfirms,suchas
AndersonConsultingorSRIInternational.Thesemajorfirmscompetewithmanysmallfirms.InJapan,theconsultingisdoneprimarilybythecomputermanufacturersthemselves.Thereisnolongeraspecializedexpertsystemshardwarebusiness.Expertsystemsarebuiltformainframesandforworkstations(oftenUNIX-based).Itsfairtosaythatthetechnologyofexpertsystemshashadafargreaterimpactthantheexpertsystemsbusiness.Expertsystemtechnologyiswidespreadanddeeplyimbedded.
VIII.VCurrentBusinessTrends
AsexpertsystemtechniquesmaturedintoastandardinformationtechnologyintheI.IXVIII0s,theincreasingintegrationofexpertsystemtechnologywithconventionalinformationtechnology--dataprocessingormanagementinformationsystems--grewinimportance.ConventionaltechnologyismostlytheworldofIBMmainframesandIBMoperatingsystems.Morerecently,thisworldhasgrowntoincludedistributednetworksofengineeringworkstations.
However,itsalsotheworldofawidevarietyofpersonalcomputers,
particularlythoserunningtheMSDOSoperatingsystem.
Earlyinitshistory,commercialexpertsystemstoolswerewrittenprimarilyin
LISPandPROLOG,butmorerecentlythetrendhasbeentoconventionallanguagessuchasC.Commercialcompaniesdedicatedtoonelanguageortheother(e.g.,Symbolics,LispMachinesInc.,QuintusProlog)havegoneintobankruptcyorhavebeenboughtoutbyothercompanies.
Finally,theconnectionofexpertsystemstothedatabasesthataremanagedbyconventionalinformationtechnologymethodsandgroupsisessentialandisnowastandardfeatureofvirtuallyallexpertsystems.
Expertsystemsaremeanttosolverealproblems,whichnormallywouldrequireaspecialisedhumanexpert(suchasadoctororaminerologist).Buildinganexpertsystemthereforefirstinvolvesextractingtherelevantknowledgefromthehumanexpert.Suchknowledgeisoftenheuristicinnature,basedonusefulrulesofthumb"ratherthanabsolutecertainties.Extractingitfromtheexpertinawaythatcanbeusedbyacomputerisgenerallyadifficulttask,requiringitsownexpertise.Aknowledgeengineerhasthejobofextractingthisknowledgeandbuildingtheexpertsystemknowledgebase.
Afirstattemptatbuildinganexpertsystemisunlikelytobeverysuccessful.
Thisispartlybecausetheexpertgenerallyfindsitverydifficulttoexpressexactlywhatknowledgeandrulestheyusetosolveaproblem.Muchofitisalmostsubconscious,orappearssoobvioustheydontevenbothermentioningit.
Knowledgeacquisitionforexpertsystemsisabigareaofresearch,withawidevarietyoftechniquesdeveloped.However,generallyitisimportanttodevelopaninitialprototypebasedoninformationextractedbyinterviewingtheexpert,theniterativelyrefineitbasedonfeedbackbothfromtheexpertandfrompotentialusersoftheexpertsystem.
Inordertodosuchiterativedevelopmentfromaprototypeitisimportantthattheexpertsystemiswritteninawaythatitcaneasilybeinspectedandmodified.
Thesystemshouldbeabletoexplainitsreasoning(toexpert,userandknowledgeengineer)andanswerquestionsaboutthesolutionprocess.Updatingthesystemshouldntinvolverewritingawholelotofcode-justaddingordeletinglocalisedchunksofknowledge.
Themostwidelyusedknowledgerepresentationschemeforexpertsystemsisrules(sometimesincombinationwithframesystems).Typically,theruleswonthavecertainconclusions-therewilljustbesomedegreeofcertaintythattheconclusionwillholdiftheconditionshold.Statisticaltechniquesareusedtodeterminethesecertainties.Rule-bsedsystems,withorwithoutcertainties,aregenerallyeasilymodifiableandmakeiteasytoprovidereasonablyhelpfultracesofthesystemsreasoning.Thesetracescanbeusedinprovidingexplanationsofwhatitisdoing.
Expertsystemshavebeenusedtosolveawiderangeofproblemsindomainssuchasmedicine,mathematics,engineering,geology,computerscience,business,law,defenceandeducation.Withineachdomain,theyhavebeenusedtosolveproblemsofdifferenttypes.Typesofprobleminvolvediagnosis(e.g.,ofasystemfault,diseaseorstudenterror);design(ofacomputersystems,hoteletc);andinterpretation(of,forexample,geologicaldata).Theappropriateproblemsolvingtechniquetendstodependmoreontheproblemtypethanonthedomain.Wholebookshavebeenwrittenonhowtochooseyourknowledgerepresentationandreasoningmethodsgivencharacteristicsofyourproblem.
DesigninganExpertSystem
Inthissectionhowexpertsystemsaredesignedandwrittenwillbeexplained.
Firstthebasicarchitectureofanexpertsystemwillbereviewed,thenwewilldiscusshowsuitableproblemsforexpertsystemsarechosenandsystemsdeveloped.
Theuserinteractswiththesystemthroughauserinterface,whichmayusemenus,naturallanguageoranyotherstyleofinteraction).Thenaninferenceengineisusedtoreasonwithboththeexpertknowledge(extractedfromourfriendlyexpert)anddataspecifictotheparticularproblembeingsolved.TheexpertknowledgewilltypicallybeintheformofasetofIF-THENrules.Thecasespecificdataincludesbothdataprovidedbytheuserandpartialconclusions(alongwithcertaintymeasures)basedonthisdata.Inasimpleforwardchainingrule-basedsystemthecasespecificdatawillbetheelementsinworkingmemory.
Almostallexpertsystemsalsohaveanexplanationsubsystem,whichallowstheprogramtoexplainitsreasoningtotheuser.Somesystemsalsohaveaknowledgebaseeditor,whichhelptheexpertorknowledgeengineertoeasilyupdateandchecktheknowledgebase.
Oneimportantfeatureofexpertsystemsisthewaythey(usually)separatedomainspecificknowledgefrommoregeneral-purposereasoningandrepresentationtechniques.Thegeneral-purposebit(inthedottedboxinthefigure)isreferredtoasanexpertsystemshell.AsweseeintheFigureVIII.I.,theshellwillprovidetheinferenceengine(andknowledgerepresentationscheme),auserinterface,anexplanationsystemandsometimesaknowledgebaseeditor.
Givenanewkindofproblemtosolve(say,cardesign),wecanusuallyfindashellthatprovidestherightsortofsupportforthatproblem,soallweneedtodoisprovidetheexpertknowledge.Therearenumerouscommercialexpertsystemshells,eachoneappropriateforaslightlydifferentrangeofproblems.(Expertsystemsworkinindustryincludesbothwritingexpertsystemshellsandwritingexpertsystemsusingshells.)Usingshellstowriteexpertsystemsgenerallygreatlyreducesthecostandtimeofdevelopment(comparedwithwritingtheexpertsystemfromscratch).
FigureVIII.I.
VIII.VIChoosingaProblem
Writinganexpertsystemgenerallyinvolvesagreatdealoftimeandmoney.Toavoidcostlyandemabarrasingfailures,peoplehavedevelopedasetofguidelinestodeterminewhetheraproblemissuitableforanexpertsystemsolution:
I..Theneedforasolutionmustjustifythecostsinvolvedindevelopment.There
mustbearealisticassessmentofthecostsandbenefitsinvolved.
II.Humanexpertiseisnotavailableinallsituationswhereitisneeded.Iftheexpert"knowledgeiswidelyavailableitisunlikelythatitwillbeworthdevelopinganexpertsystem.However,inareaslikeoilexplorationandmedicinetheremayberarespecialisedknowledgewhichcouldbecheaplyprovidedbyanexpertsystem,asandwhenrequired,withouthavingtoflyinyourfriendly(butveryhighlypaid)expert.
III.Theproblemmaybesolvedusingsymbolicreasoningtechniques.Itshouldntrequiremanualdexterityorphysicalskill.
IV.Theproblemiswellstructuredanddoesnotrequire(much)commonsenseknowledge.Commonsenseknowledgeisnotoriouslyhardtocaptureandrepresent.Itturnsoutthathighlytechnicalfieldsareeasiertodealwith,andtendtoinvolverelativelysmallamountsofwellformalisedknowledge.
V.Theproblemcannotbeeasilysolvedusingmoretraditionalcomputingmethods.Iftheresagoodalgorithmicsolutiontoaproblem,youdontwanttouseanexpertsystem.
VI.Cooperativeandarticulateexpertsexist.Foranexpertsystemprojecttobesuccessfulitisessentialthattheexpertsarewillingtohelp,anddontfeelthattheirjobisthreatened!Youalsoneedanymanagementandpotentialuserstobeinvolvedandhavepositiveattitudestothewholething.
VII.Theproblemisofpropersizeandscope.Typicallyyouneedproblemsthatrequirehighlyspecializedexpertise,butwouldonlytakeahumanexpertashorttimetosolve(sayanhour,max).
Itshouldbeclearthatonlyasmallrangeofproblemsareappropriateforexpertsystemtechnology.However,givenasuitableproblem,expertsystemscanbringenormousbenefits.Systemshavebeendeveloped,forexample,tohelpanalysesamplescollectedinoilexploration,andtohelpconfigurecomputersystems.
Boththesesystemsare(orwere)inactiveuse,savinglargeamountsofmoney.
VIII.VIIRulesandExpertSystems
InthissectionwewillshowhowexpertsystemsbasedonIF-THENruleswork,andpresentaverysimpleexpertsystemshellinProlog.
Rule-basedsystemscanbeeithergoaldrivenusingbackwardchainingtotestwhethersomehypothesisistrue,ordatadriven,usingforwardchainingtodrawnewconclusionsfromexistingdata.Expertsystemsmayuseeitherorbothstrategies,butthemostcommonisprobablythegoaldriven/backwardchainingstrategy.Onereasonforthisisthatnormallyanexpertsystemwillhavetocollectinformationabouttheproblemfromtheuserbyaskingthemquestions-byusingagoaldrivenstrategywecanjustaskquestionsthatarerelevanttoahypothesisedsolution.
Anyway,inasimplegoal-drivenrule-basedexpertsystemthereareoftenasetofpossiblesolutionstotheproblem-maybetheseareasetofillnessesthatthepatientmighthave.Theexpertsystemwillconsidereachhypothesisedsolution(e.g.,has_cold(fred))andtrytoprovewhetherornotitmightbethecase.
Sometimesitwontbeabletoproveordisprovesomethingfromthedatainitiallysuppliedbytheuser,soitwillasktheusersomequestions(e.g.,haveyougotaheadache?").Usinganyinitialdataplusanswerstothesequestionsitshouldbeabletoconcludewhichofthepossiblesolutionstotheproblemistherightone.
ASimpleExample
Thisismuchbetterexplainedthroughasimpleexample.(Youshouldmaybelookbackatthenotesonrule-basedsystemifitisunclear.)Supposethatwehavethefollowingrules:
I..IFengine_getting_petrol
ANDengine_turns_over
THENproblem_with_spark_plugs
II.IFNOTengine_turns_over
ANDNOTlights_come_on
THENproblem_with_battery
III.IFNOTengine_turns_over
ANDlights_come_on
THENproblem_with_starter
IV.IFpetrol_in_fuel_tank
THENengine_getting_petrol
Ourproblemistoworkoutwhatswrongwithourcargivensomeobservablesymptoms.
Therearethreepossibleproblemswiththecar:problem_with_spark_plugs,problem_with_battery,problem_with_starter.Wellassumethatwehavebeenprovidedwithnoinitialfactsabouttheobservablesymptoms.Inthesimplestgoal-directedsystemwewouldtrytoproveeachhypothesisedproblem(withthecar)inturn.Firstthesystemwouldtrytoprove
problem_with_spark_plugs".RuleI.ispotentiallyuseful,sothesystemwould
setthenewgoalsofprovingengine_getting_petrol"andengine_turns_over".
Tryingtoprovethefirstofthese,ruleIVcanbeused,withnewgoalofproving
petrol_in_fuel_tank"Therearenoruleswhichconcludethis(andthesystemdoesntalreadyknowtheanswer),sothesystemwillasktheuser:
Isittruethattherespetrolinthefueltank?
Letssaythattheanswerisyes.Thisanswerwouldberecorded,sothattheuserdoesntgetaskedthesamequestionagain.Anyway,thesystomnowhasprovedthattheengineisgettingpetrol,sonowwantstofindoutiftheengineturnsover.
Asthesystemdoesntyetknowwhetherthisisthecase,andastherearenoruleswhichconcludethis,theuserwillbeasked:
Isittruethattheengineturnsover?
Letssaythistimetheanswerisno.Therearenootherruleswhichcanbeusedtoproveproblem_with_spark_plugs"sothesystemwillconcludethatthisisnotthesolutiontotheproblem,andwillconsiderthenexthypothesis:problem_with_battery.Itistruethattheenginedoesnotturnover(theuserhasjustsaidthat),soallithastoproveisthatthelightsdontcomeone.Itwillasktheuser
Isittruethatthelightscomeon?
Supposetheanswerisno.Ithasnowprovedthattheproblemiswiththebattery.
Somesystemsmightstopthere,butusuallytheremightbemorethanonesolution,(e.g.,morethanonefaultwiththecar),oritwillbeuncertainwhichofvarioussolutionsistherightone.Sousuallyallhypothesesareconsidered.Itwilltrytoproveproblem_with_starter",butgiventheexistingdata(thelightscomeon)theproofwillfail,sothesystemwillconcludethattheproblemiswiththebattery.Acompleteinteractionwithourverysimplesystemmightbe:
System:Isittruethattherespetrolinthefueltank?
User:Yes.
System:Isittruethattheengineturnsover?
User:No.
SystemIsittruethatthelightscomeon?
User:No.
System:Iconcludethatthereisaproblemwithbattery.
Notethatingeneral,solvingproblemsusingbackwardchaininginvolvessearchingthroughallthepossiblewaysofprovingthehypothesis,
systematicallycheckingeachofthem.AcommonwayofdoingthissearchisthesameasinProlog-depthfirstsearchwithbacktracking
VIII.VIIIExplanationfacilities
Mostexpertsystemshaveexplanationfacilitiesthatallowtheusertoaskwhyitaskedsomequestion,andhowitreachedsomeconclusion.Thesequestionsareansweredbyreferringtothesystemgoals,therulesbeingused,andanyexistingproblemdata.Toillustratethesortsoffacilitiescommonlyprovided,wellelaborateonoursimpleexampleabove,startingwithasimpleexampledialogueinvolvingwhyandhowquestionsandexplanations.
System:Istheregasinthefueltank?
User:Yes.
System:Isittruethattheengineturnsover?
User:No.
SystemIsittruethatthelightscomeon?
User:Why?
System:Iamtryingtoprove:problemwithbattery.
Ithasbeenestablishedthatitisnotthecasethattheengineturns
over.
Thereforeifitisnotthecasethatthelightscomeonthenthereisa
problem
withbattery.
Isittruethatthelightscomeon?
User:No.
System:Iconcludethatthereisaproblemwiththebattery.
User:How?
System:ThisfollowsfromRuleII:
IFNOTengine_turns_overAND...
NOTengine_turns_overwasgivenbytheuser.
NOTlights_come_onwasgivenbytheuser.
Providingsuchanexplanationfacilityinvolves,atleast,recordingwhatrulesareusedindrawingconclusions,andusingtheserecordstocomposeexplanationsliketheonesabove.Givingsimpleexplanationslikethoseaboveisnotverydifficult(theanswersalwayshaveasimplesetform),andissometimesquiteuseful.However,explanationfacilitiesinexpertsystemsareoftennotwidelyused,andwhereusednotviewedasacceptablebytheirusers.Thereareawholelotofreasonsforthis,motivatingcurrentresearchinthearea.Onereasonisthattheexplanationsjustreferencethesurface"knowledgeencodedintherules,ratherthanthedeep"knowledgeaboutthedomainwhichoriginallymotivatedtherules(butwhichisusuallynotrepresented).So,thesystemwillsaythatitconcludedXbecauseofruleIIIII,butnotexplainwhatruleIIIIIisallabout.(Intheaboveexample,maybetheuserneedstounderstandthatboththelightsandthestarterusethebattery,whichistheunderlyingrationaleforthesecondruleinourexample).Anotherstatedreasonforthefrequentfailureofexplanationfacilitiesisthefactthat,iftheuserfailstounderstandoraccepttheexplanation,thesystemcantre-explaininanotherway(aspeoplecan).Explanationgenerationisafairlylarge(andfascinating)areaofresearch,concernedwitheffectivecommunication:howtowepresentthingssothatpeoplearereallysatisfiedwiththeexplanation,andwhatimplicationsdoesthishaveforhowwerepresenttheunderlyingknowledge.MoreComplexSystems
Thefourrulesintheexampleaboveillustratethebasicideasofgoal-directedrule-basedexpertsystems.However,ingeneralofcoursetherewouldbehundredsorthousandsofrulesinthesystem,andeachrulewouldbeconsiderablymorecomplex.Ruleswillalmostcertainlyinvolvepatternswithvariables(e.g.,age(Patient,X)),ratherthanjustsimpleunstructuredpropositions(e.g.,age_fred_IIIII))andwillusuallyhavecertaintyfactorsattachedtothem(describedlater).
However,althoughrealsystemswillbemuchmorecomplexthattheabove,manyusethesamebasicreasoningandexplanationprocedures.OneearlysystemwhichusedthisbasicapproachisMYCIN,asystemfordiagnosingblooddisorders.Welldescribethissysteminalittlemoredetaillater.
AnExpertSystemShellinProlog
ThefollowingprogramisaverysimpleexpertsystemshellinProlog.Weintroduceitbothtoshowwhataverybasicshellmightlooklike,andtointroduceafewnewfeaturesofProlog.Ithasadifferentexamplerulebase.
Notethatinordertodefinethenspecialsyntaxfortherulesweusesomeoperatordeclarations(:-op..).Thisallowsustohaveexpressionslikeifsmall(X)andnice(X)thengood(X)".However,thesearereallyjustPrologfacts,whichcanbepatternmatchedasnormal.Togettheideaofthis,tryloadingtheprogramandtryingoutthefollowingquery:
?-(ifa(A)andBthenC)=(ifa(I.)anda(II)thena(III)).
Anyway,heresthemini-shell.
%%MicroExpertSystem.
%%AlisonCawsey,FebI.IXIXIII
%%Thisisaverysimplebackwardchainingrule-based
%%expertsystem.Givensomepossiblehypothesesitbackwardchainson
%%eachonetryingtofindoutifitistrueornot.Ifitcant
%%proveafactusingtherulesitwilljustasktheuserifitis
%%trueornot.Onceithasprovedoneofthehypothesesitwillpresent
%%itsconclusionstotheuser.
%-------------------------------------------------------------------
%OPERATORDECLARATIONS
:-op(IXVIIV,fx,if).
:-op(IXV0,xfy,then).
:-op(IXIIV,xfy,and).
%-------------------------------------------------------------------
%EXPERTSYSTEMRULES(EXPERTKNOWLEDGEBASE)
rule(ifeats(X,Y)andliving(Y)thencarnivore(X)).
rule(ifcarnivore(X)andbig(X)thendangerous(X)).
rule(ifhas_feathers(X)thenbird(X)).
rule(ifbird(X)andsmall(X)thengood_pet(X)).
rule(ifcuddly(X)thengood_pet(X)).
%-------------------------------------------------------------------
%TEXTTEMPLATESFORENGLISH
%qtext/II:ProvidesasimpletemplatebasedtranslationintoEnglish
%questions.
qtext(cuddly(X),[Is,X,cuddly?]).
qtext(has_feathers(X),[Does,X,havefeathers?]).
qtext(small(X),[Is,X,small]).
%atext/II:Templatebasedtranslationintorecommendations.
atext(good_pet(X),[Isuggestthat,X,wouldmakeagoodpet.]).
%------------------------------------------------------------------
%EXAMPLETESTCASE
find_good_pet:-
check_hypothesis([good_pet(lenny),
good_pet(eddie),
good_pet(tweety)]).
%------------------------------------------------------------------
%MAINEXPERTSYSTEMSHELLCODE
%check_hypothesis(+Hypotheses)
%Succeedswhenoneofthehypothesesisprovedtrue,orit
%hastriedthemall.
%Picksahypothesis,andusesb_chaintofindoutifitistrue.
%Ifitistruethenb_chainsucceedsandcheck_hypothesiswritesoutthe
%appropriaterecommendation.Iffalseitbacktrackstoontofind
%anotherhypothesistotry.
%Onceithastriedallthehypothesesitwillbacktracktosecond
%check_hypothesisclauseandwriteanappropriatemessage.
%(UsesMacPrologbuiltinpredicatesmessage/I.andon/II)
check_hypothesis(Hypotheses):-
on(Hypoth,Hypotheses),%getamemberofhypotheses
bchain(Hypoth),!,%b_chaintocheckiftrue.
atext(Hypoth,Text),%getholdofappropriatetext.
message(Text).%writeouttherecommendation
check_hypothesis(_):-message([Noneofthepossiblehypothesesseemtobe
true]).
%bchain(+Goal)
%SucceedsifGoalistrue,givenrules+factssuppliedbyuseras
%backwardchainingproceeds.
bchain(GI.andGII):-!,%GI.andGI.aretrueif
bchain(GI.),%GI.canbeprovedbybackward
chaining
bchain(GII).%andGIIcanbetoo.
b_chain(Goal):-
%Gstrueifitsafact!
userfact(Goal).
bchain(Goal):-%Goalistrueif
rule(ifPreconditionsthenGoal),%theresaruleconcludingit
bchain(Preconditions).%anditsPreconditionscanbe
%
proved
by
backward
chaining
bchain(Goal):-%Goalistrueif
user_says_its_true(Goal).%usersaysitstrue.
%user_says_its_true(+Goal)
%Trueifthereissometexttousetoasktheuseraboutit,
%andwhenyouasktheusertheysayyes.
%UsesMacPrologbuiltinpredicateyesno/I.
user_says_its_true(Goal):-
qtext(Goal,Text),
yesno(Text),
assert(userfact(G)).
%AddthefacttoPrologsdatabase.
ThemaintoplevelPrologpredicateischeck_hypothesis.Thispredicateusesbacktrackingtogothroughallthemembersofalistofhypothesestoseewhethereachcanbeprovedtruebybackwardchaining.Onceithasfoundoneitwritesoutanappropriatemessagetotheuser.Todothisitfirstlooksforabitoftextappropriateforaparticularconclusion(e.g.,good_pet(tweety))usingthepredicateatext/II,thenusesMacPrologsbuiltinpredicatemessage/I.towriteoutasuitablemessage.Messagetakesasingleargumentwhichshouldbealist,andpopsupawindowandwritesouttheitemsinthatlist.
Themainb_chainpredicatehasfourcases,dealingwiththecaseswherethereisaconjunctionofgoalstoprove;wherethegoaltoproveisjustafact;wherethereisarulewhoseconclusionmatchesthegoal(soitspreconditionsaresetasnewgoals);andthefactwheretheusersaysthatsomethingistrue.Theùser_says_its_truepredicateusestheMacPrologbuiltinpredicateyesno/I.whichpopsupadialoguewindowwithsometextandtwobuttons(yesandno)andsucceedsiftheuserclickson`yes.IftheusersayssomethingIStruethenthatfactisassertedintothePrologdatabase(whichwillthencontainthingslikeuserfact(has_feathers(tweety))").AssertisaspecialPrologpredicatefordynamicallyaddingthingstoyourprologdatabase.(Itshouldbeusedwithcare,andIwontaskyoutouseit).Youmaynoticevarious!"sscatteredaboutinthecode.Theyarecuts"andusedtocontrolbacktracking.Iwontaskyoutoknoworunderstandcuts,butifyoueverdoanyseriousPrologprogrammingyouwillprobablyhavetousethem.Notethatmessage"andyesno"areNOTstandardPrologi/opredicates.Thestandardonesarewrite/I.whichjustwritesoutanyPrologterm,andread/I.whichjustreadsinanyPrologterm(endinginfullstop)andbindsittoavariable.So,giventhequeryread(A),theusercantypein,say,fred."andAwillbeboundtotheatomfred.MacPrologprovideslotsofextrawindow/menu/buttonbasedi/opredicates,twoofwhichareusedabove.
Asampledialoguewiththeabovesystemisthefollowing(withS:andU:
indicatingsystemandusercontributions):
?-find_good_pet.
S:Doeslennyhavefeathers?
U:No.
S:Islennycuddly?
U:no
S:Doeseddiehavefeathers?
U:yes.
S:Iseddiesmall?
U:no
S:Iseddiecuddly?
U:no
S:Doestweetyhavefeathers?
U:yes
S:Istweetysmall?
U:yes
S:Isuggestthattweetywouldmakeagoodpet.
Theaboveobviouslyisn’tadequateasanexpertsystemshell.Forastartitonlyallowsyes/noanswers;doesn’tallowforrulesthatinvolvecertainties;anddoesn’thaveanexplanationfacility.Ifwewantanexplanationcomponentforthesystemweneedtorecordatraceoftherulesthathavebeenusedtomakeaconclusion.Asanabsoluteminimumwecouldjustrecordwhichruleshadbeenused,theniftheuseraskedHow"thesystemcouldwriteoutsomethinglike:
Iconcludedthattweetywouldmakeagoodpetusingthefollowingrules:
rule:has_feathers(X)==>bird(X)
rule:bird(X)&small(X)==>good_pet(X)
Sofarwehavegivenanideaofhowasimplebackwardchainingrulebasedsystem(shell)mightbewritten.Ingeneralanexpertsystemshellwillalsoallowforwardchaining,andwillallowsomeoftheknowledgetoberepresentedusingaframesystem.Forexample,wemightwanttohaveasetofframeswhichsay(amongotherthings)thatRobbieisawhiterabbitandrabbitsarealwayscuddly.
WecouldthencheckusingbackwardchainingtofindoutifRobbiewouldmakeagoodpet,butcheckusingourframesystemtofindoutifRobbieiscuddly(usinginheritancefromtherabbitframe).VIII.IXMYCIN:AQuickCaseStudy
Mycinwasoneoftheearliestexpertsystems,anditsdesignhasstronglyinfluencedthedesignofcommercialexpertsystemsandexpertsystemshells.
MycinwasanexpertsystemdevelopedatStanfordintheI.IXVII0s.Itsjobwastodiagnoseandrecommendtreatmentforcertainbloodinfections.Todothediagnosisproperly"involvesgrowingculturesoftheinfectingorganism.
UnfortunatelythistakesaroundIVVIIIhours,andifdoctorswaiteduntilthiswascompletetheirpatientmightbedead!So,doctorshavetocomeupwithquickguessesaboutlikelyproblemsfromtheavailabledata,andusetheseguessestoprovideacovering"treatmentwheredrugsaregivenwhichshoulddealwithanypossibleproblem.
Mycinwasdevelopedpartlyinordertoexplorehowhumanexpertsmaketheserough(butimportant)guessesbasedonpartialinformation.However,theproblemisalsoapotentiallyimportantoneinpracticalterms-therearelotsofjuniorornon-specialiseddoctorswhosometimeshavetomakesucharoughdiagnosis,andifthereisanexperttoolavailabletohelpthemthenthismightallowmoreeffectivetreatmenttobegiven.Infact,Mycinwasneveractuallyusedinpractice.Thiswasntbecauseofanyweaknessinitsperformance-intestsitoutperformedmembersoftheStanfordmedicalschool.Itwasasmuchbecauseofethicalandlegalissuesrelatedtotheuseofcomputersinmedicine-ifitgivesthewrongdiagnosis,whodoyousue?AnywayMycinrepresenteditsknowledgeasasetofIF-THENruleswithcertaintyfactors.ThefollowingisanEnglishversionofoneofMycinsrules:
IFtheinfectionispimary-bacteremiaANDthesiteofthecultureisoneofthesterilesitesANDthesuspectedportalofentryisthegastrointestinaltractTHENthereissuggestiveevidence(0.VII)thatinfectionisbacteroid.
The0.VIIisroughlythecertaintythattheconclusionwillbetruegiventheevidence.Iftheevidenceisuncertainthecertaintiesofthebitsofevidencewillbecombinedwiththecertaintyoftheruletogivethecertaintyoftheconclusion.
MycinwaswritteninLisp,anditsrulesareformallyrepresentedasLispexpressions.Theactionpartoftherulecouldjustbeaconclusionabouttheproblembeingsolved,oritcouldbeanarbitarylispexpression.Thisallowedgreatflexibility,butremovedsomeofthemodularityandclarityofrule-basedsystems,sousingthefacilityhadtobeusedwithcare.
Anyway,Mycinisa(primarily)goal-directedsystem,usingthebasicbackwardchainingreasoningstrategythatwedescribedabove.However,Mycinusedvariousheuristicstocontrolthesearchforasolution(orproofofsomehypothesis).Thesewereneededbothtomakethereasoningefficientandtopreventtheuserbeingaskedtoomanyunnecessaryquestions.
Onestrategyistofirstasktheuseranumberofmoreorlesspresetquestionsthatarealwaysrequiredandwhichallowthesystemtoruleouttotallyunlikelydiagnoses.Oncethesequestionshavebeenaskedthesystemcanthenfocusonparticular,morespecificpossibleblooddisorders,andgointofullbackwardchainingmodetotryandproveeachone.Thisrulesoutalotofunnecessarysearch,andalsofollowsthepatternofhumanpatient-doctorinterviews.
Theotherstrategiesrelatetothewayinwhichrulesareinvoked.Thefirstoneissimple:givenapossibleruletouse,Mycinfirstchecksallthepremisesoftheruletoseeifanyareknowntobefalse.Ifsotheresnotmuchpointusingtherule.Theotherstrategiesrelatemoretothecertaintyfactors.Mycinwillfirstlookatrulesthathavemorecertainconclusions,andwillabandonasearchoncethecertaintiesinvolvedgetbelow0.II.
AdialoguewithMycinissomewhatliketheminidialoguegivenearlier,butofcourselongerandsomewhatmorecomplex.Therearethreemainstagestothedialogue.Inthefirststage,initialdataaboutthecaseisgatheredsothesystemcancomeupwithaverybroaddiagnosis.Inthesecondmoredirectedquestionsareaskedtotestspecifichypotheses.Attheendofthissectionadiagnosisisproposed.Inthethirdsectionquestionsareaskedtodetermineanappropriatetreatment,giventhediagnosisandfactsaboutthepatient.Thisobviouslyconcludeswithatreatmentrecommendation.Atanystagetheusercanaskwhyaquestionwasaskedorhowaconclusionwasreached,andwhentreatmentisrecommendedtheusercanaskforalternativetreatmentsifthefirstisnotviewedassatisfactory.
My,thoughpioneeringmuchexpertsystemresearch,alsohadanumberofproblemswhichwereremediedinlater,moresophisticatedarchitectures.Oneofthesewasthattherulesoftenmixeddomainknowledge,problemsolvingknowledgeandscreeningconditions"(conditionstoavoidaskingtheusersillyorawkwardquestions-e.g.,checkingpatientisnotchildbeforeaskingaboutalcoholism).AlaterversioncalledNEOMYCINattemptedtodealwiththesebyhavinganexplicitdiseasetaxonomy(representedasaframesystem)torepresentfactsaboutdifferentkindsofdiseases.Thebasicproblemsolvingstrategywastogodownthediseasetree,fromgeneralclassesofdiseasestoveryspecificones,gatheringinformationtodifferentiatebetweentwodiseasesubclasses(ie,ifdiseaseI.hassubtypesdiseaseIIanddiseaseIII,andyouknowthatthepatienthasthediseaseI.,andsubtypediseaseIIhassymptomI.butnotdiseaseIII,thenaskaboutsymptomI..)
ThereweremanyotherdevelopmentsfromtheMYCINproject.Forexample,
EMYCINwasreallythefirstexpertshelldevelopedfromMycin.AnewexpertsystemcalledPUFFwasdevelopedusingEMYCINinthenewdomainofheartdisorders.AndsystomcalledNEOMYCINwasdevelopedfortrainingdoctors,whichwouldtakethemthroughvariousexamplecases,checkingtheirconclusionsandexplainingwheretheywentwrong.
WeshouldmakeitclearatthispointthatnotallexpertsystemsareMycin-like.
Manyusedifferentapproachestobothproblemsolvingandknowledgerepresentation.Afullcourseonexpertsystemswouldconsiderthedifferentapproachesused,andwheneachisappropriate.CometoAIIVformoredetails!

版权保护: 本文由 hbsrm.com编辑,转载请保留链接: www.hbsrm.com/lwqt/wxzs/29.html

好棒文