UAH RESEARCH REPORT NO. 752

Transcription

UAH RESEARCHREPORTLANGUAGESNO. 752FORARTIFICIALIMPLEMENTINGINLISPA SCHEDULERANDPreparedTheINTELLIGENCE:INADAby:Dan HaysPsychologyDepartmentUniversityof Alabamain ergerSystemSoftwareBranchInformationand ElectronicsSystemsLabGeorgeC. MarshallSpace Flight CenterNationalAeronauticsand SpaceAdministrationMarshallSpaceFlight Center,AL35812October1988

LANGUAGESFOR ARTIFICIALImplementinga SchedulerINTELLIGENCE:in LISP and in AdaAbstractA prototypeschedulerfor space experimentsoriginallyprogrammedin a dialectof LISP using some of the sversionother.code,waswasFlavorsin turnrecastpartiallyofraisedlanguageon thescheduleplanners,externalto implementedThein goingAdawellasoneThespeedintoasfromobject-in Ada.in allywheremore mentationreconceptualizationanimprovementof code.problemsusingon thea ofinvolvedcertainlanguagetothein greaterclarityofof controlwas used.theabouttheinfluenceofof orscalledattentionthemselvesprogrammertosuchtheas systemprogrammingembeddedness,practice.D. Hays, et al. - Languagesfor AI - AbstractJohnson Research Center, U. Alabama in Huntsville 35899 - October 1988, i

Table of ContentsPAGEI.I I. TheIll.1IntroductionProblem5of theScheduler10OriginalVersion10AI LanguageVersionsA. TheB.TheC.The AdaIV. clusionsAppendicesD. Hays -Languagesfor A! - JohnsonResearch1988, iiCenter, UAH - October

LANGUAGESFOR ARTIFICIALImplementinga SchedulerINTELLIGENCE:in LISP and in AdaI. terProjectContractreportOverview.by Floydlanguages.2techniquesof LISPThesuitability1 CommentsTheandoriginalof yeton this ntedlanguageswasabouttwothe researchLeaderof minedAda.briefly.may be addressedto Dr. Hays at 135 Morton Hall, The Universityof Alabamain Huntsville,Huntsville,Alabama35899,or to Dr. Ford at e Universityof Alabamain Huntsville,Huntsville,Alabama35899.2 An earlier report from this project was deliveredas a paper: D. Hays, S.Davis, and J. Wolfsberger,"An Object-OrientedImplementationof a Schedulerin LISP and in Ada", to the 1988 Conferenceon Automationfor Military andSpaceActivities,Huntsville,AL.D. Hays-Languagesfor A! - soat theSpacein twoin ZetaLISP,ais edan objector questionsthefromfromis TaskexperimentsSpacewasis ,FordatdocumentA 1WolfsbergertheactivitiesdevelopedLISPin onJohnforThisGrantto thegrant.describedThebyin Huntsville.is languages.efforton thisCenter,to exploreacomputerof AlabamaInvestigatorresearchapplication,in variousMarshallthedocuments- October1988- p.were

t.spacesuchSincea morebeenandshownasThus,schematicfeaturesextendedit quaJJfiedtechniques.thatvariousasit ariableto workschedulersearcheswitha practicalad ndof AIa sensemightnotofbe abletO.Asit turnedout,theof eprogrammingin goingof simplefromtranslationonedevices).Infromto Adaprovidedmuchmorecomputer(if thereof digitalLISPbecameis suchparticular,thea matterlanguagetoa thing,evenrecastingofa numberof ndtheessentialprogram3 NowDonnieManagementDepartmentof theingredient(seefollowing:of Psychology.ResearchDr. pectsandSchoolin theat the JohnsonJohnsonfor theof theStephenFloydTheyInc.,taskalsobyfor AI - supplyingin Huntsville,development.of theof Administrativeof ).at AdvancedD. archW. Davis.Mr.at ovidedoriginalprojectanschedulingby commentingAL.Center,UAH- October1988- p.

oftheirof variousCognitiveaddition,Davisthatof theSummaryConclusions.is rbyJohnsonwithfamiliarbyintentionsprovidedof mplementations,discussionreport,forattentionofif enchmarks"in situations.practicalareon whichseveralis straightforwardalsoto SystemsMr.duringTheytryingprogramswilltoa gatedimprovements4.after5.AdaD. HaysanbeingViewedinvolvedto of theschedulertothatin a senseexamined.a numberdifferencessuchofferperformance.as a caselanguagemayitselfinstudy,theof problemsas an Theserangedallocation,Johnson Research Center, UAH - Octoberexternalto1988 - p.3

antfactors,includingD. edtoacontextualprogrammer.Johnson Research Center, UAH - October 1988 p.4

II. The AI LanguageFromabouta ciencyforfairlyfromcorpus,individualis notusagealsojustoneis certainlysuchTherelationof simplein usingthefacilitiescompilers,systemlessproneto someof oversight,Suchsuitabilitywerefactors,in onsordesignAgain,a pencilD. Hays -on themexample,certainof Ada.kindsOtherto takehasnestedleadto n manydifficultypairingwereconstrainedof problemswithouttheyto protectreferencehavetheorr r morefeatureserrorsaso on--problematicbe calledforwithto use,to delyparenthesesofa language,of code,example,thatassociatedeasierofsoto thelanguage.a sourcea lectivelymoreofforeasiermightcommands,in countingcode,enough,or easierandmuchForfrombranchinghavenowdecades.in theprograms.arewhichForthatharderbe coordinated,features,notlibrariesa programmingopaque.anof preferencemakemustbysuchprogrammerpreference.of thekindsininfluenceof thesourceas editors,programsto be ems,orefficiencysocialfeaturesto worrymachine-levellocationsandto expertisefeatures--andlanguage,anda sedstandardfullywoulda problemof ymbolizeof thestraightforwardstoredcantheperformanceButof view,of a programmingor notmachine,pointProblemthatputtingmosta fingerparenthesesLanguages forAI- Johnson Research Center, UAH - October 1988 - p.5it

in LISP editors.These five kinds of factors--possibilityof realization,individualpreference,motives and constraints--applyan ity,efficiencyand socialto languages in which one may writeprogram,as well as to otherEach will be discussed to some extent in this report.The matter of languagesprogramshowever.of expression,for heuristicevokes more particularor otherwise"smart"issues at this point in time,The question of which computer language to use for an AI programis sometimes confoundedacceptabilityfeelthatof AI programsa programapplications,writtensuchasC ora programincorporatingaccomplishthewellto them,knownTheprogrammingconceptunderstandingmayhas notbeenprogramsbytheina oned,proceduresD. Hayswhichseemsarealreadyaddsanotherwhichto anotherUnderstandingquestionsheuristic,is notquarters.claimshavetoof AIraisedresultsofferthatof oneA betterhavetoprogramunfamiliaritykindin someby broadexpensiveacceptabilityaAI ror entrepreneurs.managersfail,whereasmaytheirin a languageinstancesManysimplelendsProlog,to adoptsometoin an AI terminateorof oneis involvedin someplace.(depending),is a f whatunderlieinheuristicsameuncertainty.sortin current thinking with the issue of thebeenorforissueAIisaboutto ,Languages forAI- Johnson Research Center, UAH - October 1988 - p.even6

using the apparentlysimpler programs.If it can be said that, "Afterall, this program is written in C," some reassurancemay be felt. 4It is probably no accident that many people today are consideringthe incorporationof programsinvolving AI techniquestime that they are contemplatingsoftware-hardwaredevelop.systemsA groupsystemsin partsconnectedto is fairlycomplex,ofgroupsonanseemslogicalisolatedto be thealsoisolatedon smallcomputerarehadexpertcomputerscapabilitynotto interdependentto it frequentlyinformationallyof concernormoretheyoperations,another;programthanof courseof theirdecision-makingaboutmightmuchat the sameis notcomputingwillprobablyprogramsinat all accidentalthathaveorderhasto usetoWeto Britain,its4 AtandleastD. HayspressureAdaintentionevenbythosewhoLanguagesof at havetodifferentthetheseideareasonsin lareorforspreading,portabilitypasttimesanother.as a standardthesystems,motivationhas beenwasduringatexternallanguageto adoptdesignyear--of oneothers,be parthardwareis a majorof usingsomemightU. S. andsinceDuringAdaandpartthequestionofpasthasC. "UAH- October1988- p.7

becomehada realincidentalaheadof theof someIf, setting.certain5notareD. soryotherandwhatformaya faultydointechniquessystems.be a largeToone,take"garbagerequirescollection"be a mildnuisance,featureanda ys.whosethentheirandheuristicresponsivein certaina languageofsystemsmaytrueto havedemonstrateto operationat.toof governmentmanyAdait is converselyoftensettingslookedis unfamiliarin theorbecomeonlyto lyfortheproducesin LISPbe easylanguageto be eviouslychoseof AI itedis usinglanguageworkedmightinvolvedlanguagehadofin thein anoperational5Otherprogrampoint,themto rycomputerreleasedissue,operationalofif onetheof theusebeentheincorporatingit is geshavehundredsinorganizationsprogrammersAt sBecausethatoneSymbolicswhichLanguagesfor AI-isareForwherenotevencodea run-timeforprogramsoptimizedin thesea operationalin carefullyor correctcollectiontoefficientcasesredoneto updategarbagesubtle.moreof somewerechoiceespeciallyCenter,withif useCmitUAHmayprogramsrunof aoriginallycomputingtoof aorin themachineslist-processing- October1988- p.8

ion,D. ndin thein someresolvein a selectedLanguagesforAI-choicecasesthem,butof languagesdifficultmayones.addforAIThisto theircontext.Johnson Research Center, UAH - October 1988 - p.9

III. Versionsof the SchedulerA. The OriginalThegoalof ngsomeintelligencemoduleof mingorbitalSpacesimilar d Thehaveoccasions,beenlisting6 StephenSystemArtificialAppendixD. hadschedulingconstrainedsettingit couldtime,(Theversionmoreapplyrealistic1, t hadmissions(seethe1986).Decision1986papertoon a number& Ford,theto bebelow.In particular,Space"App.certaindemonstratedof FloydProceedingsthereimplementationto be s

UAH RESEARCH REPORT NO. 752 LANGUAGES FOR ARTIFICIAL INTELLIGENCE: IMPLEMENTING A SCHEDULER IN LISP AND IN ADA Prepared by: Dan Hays Psychology Department The University of Alabama in Huntsville Huntsville, AL 35805 Prepared for: John Wolfsberger System Software Branch Information and Electronics Systems Lab George C. Marshall Space Flight Center National