Home технология lisp language

lisp language



Historicalbackground

Inthemid-1950s,mostcomputersdealtwithnumericaldata,includinglinguistics,psychology,andmathematics.Somepeoplebegantodevelopartificialintelligence.Interest.Ifeelthatitisnecessarytoachieveacommonneedtoenablethecomputertoprocessthesymbolicdatainthelinkedlist,andallowtheprocessoflanguageprocessing,informationstorageandretrieval,andtheoremprovingtobemachined.IBMwasoneofthefirstcommercialorganizationsinterestedinartificialintelligencedevelopment.

Inthesummerof1958,JohnMcCarthy,apioneerinartificialintelligenceresearchfromtheMassachusettsInstituteofTechnology,participatedintheworkoftheIBMInformationResearchDepartmenttostudysymboliccomputingandapplicationrequirements.However,IBM'sFortrantableprocessinglanguagefailstosupportsymbolicoperationssuchasrecursion,conditionalexpressions,dynamicstorageallocation,andimplicitrecovery.AfterJohnMcCarthyreturnedtoMITinthefallof1958,heformedanartificialintelligenceprojectwithMarvinMinsky.DevelopatableprocessingsoftwaresystemtoimplementMcCarthy'sworkofrecommendingadopters,andthenpromotetheproductionofthetableprocessinglanguageLISP.

DevelopmentHistory

InApril1960,McCarthypublished"SymbolicExpressionsofRecursiveFunctionsandMethodsofOperationbyMachines,PartOne"intheACMNewsletter.LISPsettings.Accordingtothepaper,McCarthy'sstudentSteveRussellsuccessfullyimplementedthefirstversionofLISPwithIBM704atMIT'sCenterforComputerComputing.

In1962,McCarthyandtheartificialintelligenceteamimprovedtheLISP1.5versionbasedonthecompilationofLISP1.

InSeptember1969,theStanfordLISP1.6launchedbyLynnQuamandWhitfieldDiffieoftheArtificialIntelligenceLaboratoryofStanfordUniversitywaswidelyusedinthePDP-10computersystemusingtheTOPS-10system.TheStanfordLISP1.6versionwasgraduallyabandonedafterthesuccessoftheMITSmartProjectupdateLISP1.5intotheInterLisplaunchedbyMACLISPandBBNTechnology.

Fromthelate1960stotheearly1980s,variousupdatedLISPversionsemerged,includingFranzLispfromUCBerkeley,XLISP,thepredecessorofAutoLISPrunninginAutoCAD,StandardLispdevelopedbytheUniversityofUtah,andPortableStandardLisp,ZetaLispexclusivelyrunonLispmachines,LeLispfromtheFrenchNationalInstituteofInformationandAutomation,andSchemedevelopedbyGeraldSussmanandGuySteeleoftheMITArtificialIntelligenceLaboratory.

In1984,CommonLisp,whichwasimprovedfromMacLisp,integratedallversions,cross-platform,andwasregardedasthedefactostandard,wasborn.By1994,theAmericanNationalStandardsInstitute(ANSI)standardizedtheCommonLisplanguage.

SincethestableoperationofCommonLispappeared,variousorganizationshavecarriedoutfollow-upLispaccordingtotheirneeds,includingEuLispfromEuropeanusersin1990andfreeandopensourceIsLisp,ACL2,etc.

Datastructure

IntheLISPlanguage,dataandfunctionsaredefinedbysymbolicexpressions.ThissymbolicexpressioniscalledS-expression,whichisanatomandatable.Thegeneraltermfor.Atomsaredividedintosymbolatomsandnumberatoms.Symbolatomreferstoastringconsistingofalimitednumberofuppercaselettersandnumbers,inwhichthefirstsymbolmustbealetter.TheatomsNILandTrepresentlogicallyfalse(oremptylist)andlogicallytrue,respectively.Thenumberatomreferstoaseriesofnumbers,whicharerepresentedbysymbols.

Features

(1)Functionality

Thebasicfeatureofafunctionallanguageistousefunctiondefinitionsandfunctioncallstoformprograms.Theprogrammerusestheexpressioncomposedoffunctiondefinitionandfunctioncalltodescribethealgorithmforsolvingtheproblem,andthevalueoftheexpressionisthesolutionoftheproblem.Aprogramwrittenintraditionalprogramminglanguages​​suchasFORTRAN,PAS-CAL,andCisasequenceofcommandsexecutedinacertainorder,andtheresultoftheexecutionisthesolutiontotheproblem.Whenprogrammingintheselanguages,theprogrammermustspecifytheorderofsolving,thatis,describetheflowofcontrol.ProgrammingwithLISPlanguageonlyneedstodeterminethecallsbetweenfunctions,andleavethedetailsoffunctionexecutiontotheLISPsystemtosolve.Therefore,theLISPlanguageisamoreuser-orientedlanguage.

Traditionalprogramminglanguages​​aredevelopedtoadapttothestructureofvonNeumann-typecomputersystems,andLISPrunslessefficientlyonNeumann-typecomputers.Thedevelopmentofcomputersystemstructuremakesfunctionallanguages​​haveabrightfuture.Inordertoadapttothecurrentlevelofmicrocomputerdevelopmentandprogrammers’habitofprogrammingintraditionallanguages,LISPlanguagehasaddedmanynon-functionallanguagecomponents,suchasprog,goandotherfunctions.Therefore,LISPisnolongerapurelyfunctionallanguage.IthasbothThefunctionoffunctionallanguagealsohasthefunctionoftraditionallanguage.

(2)Recursiveness

Recursivefunctionmeansthatthefunctionitselfiscalledinthedefinitionofthefunction.Allcomputablefunctionshavebeenproventobedefinedintheformofrecursivefunctions.

BecausethemaindatastructureofLISPisatable,andthetableisdefinedbyarecursivemethod,thatis,anelementinthetablecanalsobedefinedasatable.Therefore,theprogrammerusesthecustomfunctionprovidedbyLISPtoWhendefiningyourownfunctions,youcandefineyourownfunctionsintheformofrecursivefunctions.Customrecursivefunctionscaneasilyoperateonrecursivelydefinedtables.Themethodofrecursivedefinitionmakestheprogramconciseandbeautiful,andprogrammersshouldmakefulluseoftherecursiveprogrammingmethod.

(3)Consistencybetweendataandprogram

AsectionofLISPprogramisauser-definedfunction,thisfunctioncanbecalledbyotherfunctions,Inotherwords,aprogramcanbecalledbyotherprograms.Theoutputdataafterthefunctionisexecutediscalledthereturnvalueofthisfunction.Whenafunctioniscalledbyotherfunctions,thereturnvalueofthisfunctioniscalled.InLISP,thefunctionandthereturnvalueofthisfunctionareconsistent.ThisfeaturemakestheprogrammingofLISPjusttodefineamacrofunction,andalsomakestheexpansionoftheLISPlanguageeasier.Accordingtotheneedsoftheapplicationfield,thebasicfunctionsprovidedbyLISPcanbeusedtoexpandanumberofmacrofunctionsforspecialapplicationfields.

(4)Automaticstorageallocation

WhenprogrammingwithLISPlanguage,programmerscancompletelyignorethestorageallocationproblem.Thefunctions,dataandtablesdefinedintheprogramcanbeautomaticallyprovidedbyLISPwhentheprogramisrunning.Fordatathatisnolongerneeded,LISPautomaticallyreleasesitsoccupiedstoragearea.

(5)Simplesyntax

ThesyntaxofLISPisextremelysimple,andthereisnoneedtodefineandexplainthetypesofvariablesanddatainadvance.ThebasicsyntaxofLISPlanguageisfunctiondefinitionandfunctioncall.Therefore,theLISPlanguageprogramiseasytomodify,debugandcorrecterrors.Youcandesignwhileexperimenting,andformacomplexsystembyconstantlymodifyingandaddinguser-definedfunctions.

LISPlanguagenotonlyhasawiderangeofapplicationsinthefieldsofexpertsystemsandCAD,butalsointhefieldsofsymbolicalgebra,theoremproving,androbotplanning.ThemainreasonsthataffecttheuseoftheLISPlanguageare:First,LISPisanon-visuallanguage;second,LISPrunslessefficientlyongeneral-purposecomputers;third,LISPhaspoornumericalcomputingcapabilities;fourth,people’sprogrammingstylesforfunctionallanguagesHabit.

Commonversion

TherearemanyversionsofLISPlanguage,thecommonlyusedonesare:

(1)MACLISPlanguage:ItwasdevelopedbyMITArtificialIntelligenceLaboratoryin1971.ItcomparesPayattentiontoefficiency,protectionofaddressspaceandflexibilityofconstructiontools.

(2)INTERLISPlanguage:DevelopedbyDECandXEROXin1978,itemphasizesthatevenifthereisalossinspeedandstoragespace,itisnecessarytoprovidethebestprogramenvironmentasmuchaspossible.

(3)ZETALISPlanguage;implementedonLISPmachine.ItiscloselyrelatedtoMACLISPandhasgoodcompatibility.AndmanyimprovementshavebeenmadetoMACLISP,providingnewperformance.

(4)QLISPlanguage:ItisembeddedinINTERLISP,canhandlelargedatabasesflexibly,andhasthefunctionsofreturntrackingandmodecalling.

(5)CommonLISPlanguage:ItisdevelopedonthebasisofMACLISPandreferstoINTERLISPandZETALISP,soithasstrongfunctionsandsomeadvantagesofotherversions,andhasbeenwidelyused.

(6)GCLISPlanguage:AsthefirstabbreviatedversionofCommonLISPimplementedonaPC,itnaturallyhastheversatilityofConlmonLISP,anditsprogramiseasytotransplanttootherversionsoftheLISPenvironment.ThecorepartsofGCLISPandCommonLISParecompatible,consistentwithsomeconceptsofZETALISP.Inaddition,italsohasseveraladvanceddatatypes.Itfocusesonmakingthemachinehavestrongprocessingcapabilitiesandmemoryfunctions,soitismoreefficient,easyforuserstomaster,andcompare.widely.

This article is from the network, does not represent the position of this station. Please indicate the origin of reprint
TOP