外公是棵樱桃树读后感-成全一棵树读后感

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

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

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

资源描述

CompactlyRepresentingFirst-OrderStructuresforStaticAnalysisR.Manevich1,⋆,G.Ramalingam2,J.Field2,D.Goyal2,andM.Sagiv11TelAvivUniversity{rumster,msagiv}@post.tau.ac.il2IBMT.J.WatsonResearchCenter{rama,jfield,dgoyal}@watson.ibm.comAbstract.Afundamentalbottleneckinapplyingsophisticatedstaticanalysestolargeprogramsisthespaceconsumedbyabstractprogramstates.Thisispartic-ularlytruewhenanalyzingprogramsthatmakeextensiveuseofheap-allocateddata.TheTVLA(Three-ValuedLogicAnalysis)programanalysisandverifica-tionsystemmodelsdynamicallocationpreciselybyrepresentingprogramstatesasfirst-orderstructures.Insucharepresentation,afinitecollectionofpredicatesisusedtodefinestates;thepredicatesrangeoverauniverseofindividualsthatmayevolve—expandandcontract—duringanalysis.Evolvingfirst-orderstruc-turescanbeusedtoencodeawidevarietyofanalyses,includingmostanalyseswhoseabstractstatesarerepresentedbydirectedgraphsormaps.Thispaperad-dressestheproblemofspaceconsumptioninsuchanalysesbydescribingandevaluatingtwonovelstructurerepresentationtechniques.Onetechniqueusesor-deredbinarydecisiondiagrams(OBDDs);theotherusesavariantofafunctionalmapdatastructure.Usingasuiteofbenchmarkanalysisproblems,wesystemati-callycomparethenewrepresentationswithTVLA’sexistingstaterepresentation.TheresultsshowthatboththeOBDDandfunctionalimplementationsreducespaceconsumptioninTVLAbyafactorof4to10relativetothecurrentTVLAstaterepresentation,withoutcompromisinganalysistime.InadditiontoTVLA,webelievethatourresultsareapplicabletomanyprogramanalysissystemsthatrepresentstatesasgraphs,maps,orotherstructuresofsimilarcomplexity.1OverviewandMainResultsAfundamentalbottleneckinapplyingsophisticatedstaticanalysestolargeprogramsisthespaceconsumedduringanalysisbyabstractprogramstates.Thisisparticularlytrueformodernprogramswheremuchofthedatamanipulatedbytheapplicationliesintheheap(i.e.,indynamicallyallocateddatastructures),insteadofbeingstoredinafixedsetofvariables.Anabstractionofthepotentiallyunboundedheapthatispreciseenoughforaparticularanalysismayoftenhaveprohibitivespacerequirements.TheTVLA(Three-ValuedLogicAnalysis)programanalysisandverificationsystem[6]isdesignedtomodeldynamicallocationpreciselybyrepresentingprogramstatesasfirst-orderstructures.Insucharepresentation,afinitecollectionofpredicatesisusedtodefinestates;thepredicatesrangeoverauniverseofindividualsthatmayevolve—expandandcontract—duringanalysis.Theuseoffirst-orderstructurespermits,e.g.,⋆PartiallysupportedbytheIsraeliAcademyofScience.PartofthisworkwasdonewhilevisitingIBM’sT.J.WatsonResearchCenter.dynamicmemoryallocationordynamicthreadcreationtobemodeledinanaturalway[13,17].Inaddition,first-orderstaterepresentationscanbemuchmorecompactthanrepresentationsbasedonfinite-statemodels.Forexample,whenrepresentingprogramswithpointers,anaturalfinitestaterepresentationofpointeraliasesusuallyconsumesquadraticspace[14],whereasagraphbased(first-order)representationsuchtheoneusedbyTVLAcanbelinearinmanycases.TVLAhasbeensuccessfullyappliedtoawidevarietyofdeepprogramanalysisandverificationproblems,includingcheckingCprogramsforthepresenceofmemoryleaksanddanglingoruninitializedpointers[4],verifyingthecorrectnessofasimplegarbagecollector[12],determiningwhetherclientsofaJavalibrarysatisfythelibrary’sconformanceconstraintsforcorrectusage[11],andverifyingcertainsafetypropertiesofapacketrouter[10].Incarryingoutthesetasks,TVLAutilizesanabstractinterpretationthatmaintainsdetailedinformationonthestateofdynamicallyallocatedmemory.Whilethisdegreeofprecisioniscrucialtoavoidreportinganexcessivenumberof“falsealarms”,itcomesataprice:thespacerequiredtoanalyzeprogramsofmorethanafewthousandlinesofcodeisoftenprohibitive.Thispaperaddressestheproblemofspaceconsumptioninfirst-orderstaterepresen-tationsbydescribingandevaluatingtwonewstructurerepresentationtechniques.Thefirstrepresentationusesanexistingorderedbinarydecisiondiagram[2,18](OBDD)implementation[15]toencodefirst-orderstructures.Thesecondstaterepresentationcombinesideasfromefficientimplementationsoffunctionalmaps(whereamapderivedbyupdatetoanothermapsharessubstructuresoftheinitialmap)withnormalizationviahash-consing.Bothofthesecoredatastructuresarewell-known,andOBDDshavebeenusedinseveralprogramanalysissystemstorepresentautomataorfinitesets.However,itisnotobviousthattheyshouldbeadaptableto,orbeneficialfor,representingevolvingfirst-orderstructures,especiallygiventheirpoorworst-casebehavior.Happily,ourevaluationofthenewstaterepresentationsindicatesthattheycanre-duceTVLA’sspaceconsumptionbyafactorof4to10withoutcompromisingtimeperformance.Inaddition,asthenumberofstructuresmanipulatedbytheanalysisin-creases,therelativeadvantageofthenewrepresentationsalsoincreases.Sincethenotionofevolvingfirst-orderstructureispowerfulenoughtoencodeanumberofnontrivialstaterepresentations(e.g.,thosebasedondirectedgraphsormaps),webelievethatourresultsarealsolikelytobeapplicableinawidevarietyofprogramanalysistechniquesrequiringsuchstructures.2TVLAPrimerInthissection,wegiveabriefoverviewofthoseaspectsoftheTVLAsystemthatpertaintostatemanipulation.Completed

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

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

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

×
保存成功