Towards Manipulation of Mutually Recursive Functions.

Hideya Iwasaki,Zhenjiang Hu,Masato Takeichi
1998-01-01
Abstract:TOWARDSMANIPULATIONOFMUTUALLYRECURSIVEFUNCTIONSHIDEYAIWASAKIDepartmentofComputerScienceTokyoUniversityofAgricultureandchnology2{24{16,Naka-cho,Koganei,Tokyo184{8588,JAPANE-mail:iwasaki@ipl.ei.tuat.ac.jpZHENJIANGHU,MASATOTAKEICHIDepartmentofInformationEngineeringTheUniversityofTokyo7{3{1,Hongo,Bunkyo-ku,Tokyo113{8656,JAPANE-mail:fhu,takeichig@ipl.t.u-tokyo.ac.jpInfunctionalprogramming,ConstructiveAlgorithmicsisoneofthepromisingapproachestoprogramtransformation,esp eciallyfusion,inwhichaconceptcalledhylomorphismplays quiteanimp ortantrole.However,previousstudieshavemainlyfo cusedonprogramsconstructedby singlerecursive functions,whereaspro-gramsconstructedbymutualrecursionhaveb eenlittleinestigated,particularlywithresp ecttotheirpracticaluseforoptimizingfunctionalprograms.Inthispap er,weshallformalizemutualrecursivdatatyp esintermsofbifunctorsandextendhylomorphismstodescrib emutualrecursivefunctionsonthistyp e.Itisshownthattheorems(transformationrules)fororiginalhylomorphismsalsoholdwhilekeepingthesameformforextended(mutual)hylomorphisms.Asaresult,programtransformationby calculation,which mechanically applies thesetheorems,isalsop ossiblewithoutaddinganysp ecialrulesformutualrecursion.1Intro ductionInfunctionalprogramming,smallbutusefulfunctionsarecomp osedtogethertoconstitutealargeprogram.Unfortunately,programsdescrib edinthisfashioncannotb eexp ectedtoecientb othintimeandspace,mainlyb ecausemanyintermediatedatastructureswhichneverapp earthe nalresultmab epro ducedandconsumedthroughfunctionalcomp ositions.Thereforeitisimp ortanttotransformprogramseliminatesuchdatastructures.OneofthepromisingapproachestosolvethisproblemisbymeansConstructiveAlgorithmics6;7,inwhichaconceptcalledhylomorphismplaysanimp ortantrole.Inthisapproach,asmallbutp owerfulsetoftransformationrules(theorems)overhylomorphismsareappliedtothetargetprogramfusefunctionalcomp ositions.Thiskindoftransformationiscalledfusion.Animp ortantp oinisthatonce(apartof )thetargetprogramexpressedinsomesp eci cformsuchasylomorphism,thetransformationpro cessisnothingmorethananautomatedcalculation.InConstructiveAlgorithmics,datatyp esarecategoricallyde nedbyfunc-1
What problem does this paper attempt to address?