{"title":"Static evaluation of functional programs","authors":"G. Lindstrom","doi":"10.1145/12276.13331","DOIUrl":null,"url":null,"abstract":"Static evaluation underlies essentially all techniques for a priori semantic program manipulation, i.e. those that stop short of fully general execution. Included are such activities as type checking, partial evaluation, and, ultimately, optimized compilation.\nThis paper describes a novel approach to static evaluation of programs in functional languages involving infinite data objects, i.e. those using normal order or “lazy” evaluation. Its principal features are abstract interpretation on a domain of demand patterns, and a notion of function “reversal”. The latter associates with each function f a derived function f' mapping demand patterns on f to demand patterns on its formal parameter. This is used for a comprehensive form of strictness analysis, aiding in efficient compilation.\nThis analysis leads to a revised notion of basic block, appropriate as an intermediate representation for a normal order functional language. An implementation of the analysis technique in Prolog is sketched, as well as an effort currently underway to apply the technique to the generation of optimized G-machine code.","PeriodicalId":414056,"journal":{"name":"SIGPLAN Conferences and Workshops","volume":"34 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"1986-07-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"21","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"SIGPLAN Conferences and Workshops","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/12276.13331","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 21
Abstract
Static evaluation underlies essentially all techniques for a priori semantic program manipulation, i.e. those that stop short of fully general execution. Included are such activities as type checking, partial evaluation, and, ultimately, optimized compilation.
This paper describes a novel approach to static evaluation of programs in functional languages involving infinite data objects, i.e. those using normal order or “lazy” evaluation. Its principal features are abstract interpretation on a domain of demand patterns, and a notion of function “reversal”. The latter associates with each function f a derived function f' mapping demand patterns on f to demand patterns on its formal parameter. This is used for a comprehensive form of strictness analysis, aiding in efficient compilation.
This analysis leads to a revised notion of basic block, appropriate as an intermediate representation for a normal order functional language. An implementation of the analysis technique in Prolog is sketched, as well as an effort currently underway to apply the technique to the generation of optimized G-machine code.