Light types for polynomial time computation in lam

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

arXiv:cs/0402059v2[cs.LO]11May2004LightTypesforPolynomialTimeComputationinLambda-Calculus∗PatrickBaillotLaboratoired’InformatiquedeParis-Nord/CNRSUniversit´eParis-Nord,Francepb@lipn.univ-paris13.frKazushigeTeruiNationalInstituteofInformaticsTokyo,Japanterui@nii.ac.jpAbstractWeproposeanewtypesystemforlambda-calculusen-suringthatwell-typedprogramscanbeexecutedinpolyno-mialtime:Duallightaffinelogic(DLAL).DLALhasasim-pletypelanguagewithalinearandanintuitionistictypearrow,andonemodality.ItcorrespondstoafragmentofLightaffinelogic(LAL).WeshowthatcontrarilytoLAL,DLALensuresgoodpropertiesonlambda-terms:subjectreductionissatisfiedandawell-typedtermadmitsapoly-nomialboundonthereductionbyanystrategy.FinallyweestablishthatasLAL,DLALallowstorepresentallpoly-timefunctions.1IntroductionFunctionallanguageslikeMLassisttheprogrammerwithpreventionofsucherrorsasrun-timetypeerrors,thankstoautomatictypeinference.Onecouldwishtoex-tendthissettingtoverificationofquantitativeproperties,suchastimeorspacecomplexitybounds(seeforinstance[18]).Wethinkthatprogressesonsuchissuescanfol-lowfromadvancesinthetopicofImplicitComputationalComplexity,thefieldthatstudiescalculiandlanguageswithintrinsiccomplexityproperties.Inparticularsomelinesofresearchhaveexploredrecursion-basedapproaches([20,7,17,8,16])andapproachesbasedonlinearlogictocontrolthecomplexityofprograms([14,19]).HereweareinterestedinLightaffinelogic(LAL)([2,14]),alogicalsystemdesignedfromLinearlogicandwhichcharacterizespolynomialtimecomputation.BytheCurry-Howardcorrespondenceproofsinthislogiccanbeusedasprograms.Someniceaspectsofthissystemwithrespecttootherapproachesarethefactsthatitincludeshigher-ordertypesaswellaspolymorphism.Moreoveritnaturallyextendstoaconsistentnaivesettheory,inwhich∗WorkpartiallysupportedbyprojectGEOCALACINouvellesin-terfacesdesmath´ematiques,projectCRISSACIS´ecurit´einformatique(France)andGrant-in-AidforScientificResearch,MEXT,Japan.onecanreasonaboutpolynomialtimeconcepts.Inparticu-lartheprovablytotalfunctionsofthatsettheoryareexactlythepolynomialtimefunctions([14,26]).HoweverthesyntaxofLALisquitedelicate,inpartic-ularbecauseithastwomodalities.Sometermlanguageshavebeenproposed(inparticularin[25])butprogrammingisingeneraldifficult.Wethinkabettergraspwouldbegivenonthissystemifonecoulduseaslanguageplainlambda-calculusandtheninasecondphasehaveanauto-matic(orsemi-automatic)LALtypeinferenceperformed.Incaseofsuccessawell-typedprogramwouldhavetheguaranteethatitcanbeexecutedinpolynomialtime.Thisapproachhasbeenexaminedin[3,4].Inparticularithasbeenshownin[4]thattypeinferenceinpropositionalLALisdecidable.Howeversomeproblemsremain:•First,toexecutethewell-typedprogramwiththeex-pectedpolynomialboundthelambda-termisnotsuf-ficient.Onehastousethetypederivationandextractalightlambdaterm(introducedin[25])oraproof-net([2])thatcanbeexecutedwiththecorrectbound.Inparticularthismeansthatifweuseordinaryabstractmachinesfortheevaluationwedonothaveanyguar-anteeontheexecutiontime.•Second,eveniftypeinferenceisdecidablewedonothaveforthemomentanyefficientprocedure.Thediffi-cultyactuallycomesfromtwopoints:thetypederiva-tionmightneedtospecifysomesharingofsubterm;moreoverthelanguageoftypesislarge(becausetherearetwomodalities)andthisresultsinanimportantsearchspacetoexplore.Totrytoovercometheseproblemsweproposehereanewtypesystem,thatwecallDuallightaffinelogic(DLAL).ItcorrespondstoasimplefragmentofLAL.Itreliesontheideaofreplacingthe!modalitybytwonotionsofarrows:alinearoneandanintuitionisticone.ThisisinthelineoftheworksofBarberandPlotkin(Dualintuitionisticlinearlogic,[6])andBenton([9]).DLALthenoffersthefollow-ingadvantagesoverLALasatypesystem:1•Itslanguageoftypesis’smaller’,inthesensethatitcorrespondstoastrictsubsetofLALtypes.•DLALkeepsthesamepropertiesasLAL(P-completenessandpolynomialboundonexecution)butensuresthecomplexityboundonthelambda-termit-self:ifatermistypableonecanextracttheboundfromthederivation,thenforgetaboutthetypeandexe-cutethetermusinganystrategy(andanyabstractma-chine),withtheguaranteethatthereductionwillter-minatewithinthebound.ThismeansthatDLALof-fersasystemwheretheprogrampartandthecomplex-ityspecificationpartarereallyseparate.Theprogrampartcorrespondstothelambda-termandthecomplex-ityspecificationtothetype.•Wethinktypeinferenceshouldbecomeeasier,thoughthisquestionstillhastobeexplored.IndeedDLALof-fersthefollowingadvantages:firstthereisnosharinginDLALderivations;second,alargepartofthediffi-cultyofLALtypeinferencehastodowiththefactthatthetypescanuseanysequenceofthetwomodalities!,§,thatistosaywordsoverabinaryalphabet.Forthisreasonthetypeinferenceprocedureof[4]usedwordsconstraints,whicharehardtosolve.Bycon-trastElementaryaffinelogic(EAL)(correspondingtoelementarycomplexity)hasonlyonemodality!anditstypeinferencecanbeperformedusinglinearcon-straints,thatistosayintegerprogramming.Theprob-lemofEALtypeinferencehasbeenshowndecidableandstudiedindetailbyCoppolaetal.(see[11,12]),startingfrommotivationsinoptimalreduction.WebelieveDLALshouldbeeasiertounderstandthanLALandcouldmakethislightlogicapproachaccessibletoal

1 / 20
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功