首页 > 最新文献

LISP and Functional Programming最新文献

英文 中文
Abstracting control 抽象的控制
Pub Date : 1990-05-01 DOI: 10.1145/91556.91622
O. Danvy, Andrzej Filinski
The last few years have seen a renewed interest in continuations for expressing advanced control structures in programming languages, and new models such as Abstract Continuations have been proposed to capture these dimensions. This article investigates an alternative formulation, exploiting the latent expressive power of the standard continuation-passing style (CPS) instead of introducing yet other new concepts. We build on a single foundation: abstracting control as a hierarchy of continuations, each one modeling a specific language feature as acting on nested evaluation contexts.We show how iterating the continuation-passing conversion allows us to specify a wide range of control behavior. For example, two conversions yield an abstraction of Prolog-style backtracking. A number of other constructs can likewise be expressed in this framework; each is defined independently of the others, but all are arranged in a hierarchy making any interactions between them explicit.This approach preserves all the traditional results about CPS, e.g., its evaluation order independence. Accordingly, our semantics is directly implementable in a call-by-value language such as Scheme or ML. Furthermore, because the control operators denote simple, typable lambda-terms in CPS, they themselves can be statically typed. Contrary to intuition, the iterated CPS transformation does not yield huge results: except where explicitly needed, all continuations beyond the first one disappear due to the extensionality principle (&eegr;-reduction).Besides presenting a new motivation for control operators, this paper also describes an improved conversion into applicative-order CPS. The conversion operates in one pass by performing all administrative reductions at translation time; interestingly, it can be expressed very concisely using the new control operators. The paper also presents some examples of nondeterministic programming in direct style.
最近几年,人们对用编程语言表达高级控制结构的延续重新产生了兴趣,并且提出了诸如抽象延续这样的新模型来捕获这些维度。本文研究了一种替代公式,利用标准连续传递样式(CPS)的潜在表达能力,而不是引入其他新概念。我们建立在一个单一的基础上:将控制抽象为继承的层次结构,每个继承都将特定的语言特性建模为作用于嵌套的评估上下文。我们将展示迭代连续传递转换如何允许我们指定广泛的控制行为。例如,两个转换产生prolog风格回溯的抽象。许多其他结构同样可以在这个框架中表示;每一个都是独立于其他的定义的,但是它们都被安排在一个层次结构中,使得它们之间的任何交互都是显式的。这种方法保留了传统的关于CPS的所有结果,例如它的求值顺序独立性。因此,我们的语义可以在按值调用语言(如Scheme或ML)中直接实现。此外,由于控制操作符在CPS中表示简单、可类型化的lambda项,因此它们本身可以是静态类型化的。与直觉相反,迭代的CPS转换不会产生巨大的结果:除了明确需要的地方,由于可扩展性原则(&eegr;-约简),第一个以外的所有延续都会消失。除了提出一种新的控制算子的动机外,本文还描述了一种改进的转化为应用级CPS的方法。通过在翻译时执行所有行政缩减,转换操作一次完成;有趣的是,它可以用新的控制算子非常简洁地表示。本文还给出了一些直接形式的不确定性规划的例子。
{"title":"Abstracting control","authors":"O. Danvy, Andrzej Filinski","doi":"10.1145/91556.91622","DOIUrl":"https://doi.org/10.1145/91556.91622","url":null,"abstract":"The last few years have seen a renewed interest in continuations for expressing advanced control structures in programming languages, and new models such as Abstract Continuations have been proposed to capture these dimensions. This article investigates an alternative formulation, exploiting the latent expressive power of the standard continuation-passing style (CPS) instead of introducing yet other new concepts. We build on a single foundation: abstracting control as a hierarchy of continuations, each one modeling a specific language feature as acting on nested evaluation contexts.\u0000We show how iterating the continuation-passing conversion allows us to specify a wide range of control behavior. For example, two conversions yield an abstraction of Prolog-style backtracking. A number of other constructs can likewise be expressed in this framework; each is defined independently of the others, but all are arranged in a hierarchy making any interactions between them explicit.\u0000This approach preserves all the traditional results about CPS, e.g., its evaluation order independence. Accordingly, our semantics is directly implementable in a call-by-value language such as Scheme or ML. Furthermore, because the control operators denote simple, typable lambda-terms in CPS, they themselves can be statically typed. Contrary to intuition, the iterated CPS transformation does not yield huge results: except where explicitly needed, all continuations beyond the first one disappear due to the extensionality principle (&eegr;-reduction).\u0000Besides presenting a new motivation for control operators, this paper also describes an improved conversion into applicative-order CPS. The conversion operates in one pass by performing all administrative reductions at translation time; interestingly, it can be expressed very concisely using the new control operators. The paper also presents some examples of nondeterministic programming in direct style.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"126291111","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 407
Operational and axiomatic semantics of PCF PCF的运算和公理语义
Pub Date : 1990-05-01 DOI: 10.1145/91556.91677
Brian T. Howard, John C. Mitchell
PCF, as considered in this paper, is a lazy typed lambda calculus with functions, pairing, fixed-point operators and arbitrary algebraic data types. The natural equational axioms for PCF include &eegr;-equivalence and the so-called “surjective pairing” axiom for pairs. However, the reduction system pcf&eegr;,sp defined by directing each equational axiom is not confluent, for virtually any choice of algebraic data types. Moreover, neither &eegr;-reduction nor surjective pairing seems to have a counterpart in ordinary execution. Therefore, we consider a smaller reduction system pcf without &eegr;-reduction or surjective pairing. The system pcf is confluent when combined with any linear, confluent algebraic rewrite rules. The system is also computationally adequate, in the sense that whenever a closed term of “observable” type has a pcf&eegr;,sp normal form, this is also the unique pcf normal form. Moreover, the equational axioms for PCF, including (&eegr;) and surjective pairing, are sound for pcf observational equivalence. These results suggest that if we take the equational axioms as defining the language, the smaller reduction system gives an appropriate operational semantics.
本文认为PCF是一种具有函数、配对、不动点算子和任意代数数据类型的懒类型lambda演算。PCF的自然等式公理包括&eegr;等价和所谓的“满射配对”公理。然而,对于几乎任何代数数据类型的选择,通过指导每个等式公理定义的约简系统pcf&eegr; sp是不合流的。此外,在普通执行中,&eegr;还原和满射配对似乎都没有对应的对象。因此,我们考虑一个没有&eegr;-约简或满射对的较小约简系统pcf。当与任何线性、合流代数重写规则结合时,系统pcf是合流的。该系统在计算上也是充分的,在某种意义上,只要一个“可观察”类型的封闭项具有pcf&eegr; sp范式,这也是唯一的pcf范式。此外,PCF的方程公理,包括(&eegr;)和满射配对,对于PCF的观测等价是合理的。这些结果表明,如果我们用等式公理来定义语言,较小的约简系统给出了适当的运算语义。
{"title":"Operational and axiomatic semantics of PCF","authors":"Brian T. Howard, John C. Mitchell","doi":"10.1145/91556.91677","DOIUrl":"https://doi.org/10.1145/91556.91677","url":null,"abstract":"PCF, as considered in this paper, is a lazy typed lambda calculus with functions, pairing, fixed-point operators and arbitrary algebraic data types. The natural equational axioms for PCF include <italic>&eegr;</italic>-equivalence and the so-called “surjective pairing” axiom for pairs. However, the reduction system <italic>pcf<subscrpt>&eegr;,sp</subscrpt></italic> defined by directing each equational axiom is not confluent, for virtually any choice of algebraic data types. Moreover, neither <italic>&eegr;</italic>-reduction nor surjective pairing seems to have a counterpart in ordinary execution. Therefore, we consider a smaller reduction system <italic>pcf</italic> without <italic>&eegr;</italic>-reduction or surjective pairing. The system <italic>pcf</italic> is confluent when combined with any linear, confluent algebraic rewrite rules. The system is also computationally adequate, in the sense that whenever a closed term of “observable” type has a <italic>pcf<subscrpt>&eegr;,sp</subscrpt></italic> normal form, this is also the unique <italic>pcf</italic> normal form. Moreover, the equational axioms for PCF, including (<italic>&eegr;</italic>) and surjective pairing, are sound for <italic>pcf</italic> observational equivalence. These results suggest that if we take the equational axioms as defining the language, the smaller reduction system gives an appropriate operational semantics.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131615376","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 12
An abstract machine for Lambda-terms normalization 一种用于lambda项规范化的抽象机器
Pub Date : 1990-05-01 DOI: 10.1145/91556.91681
P. Crégut
Two abstract machines reducing terms to their full normal form are presented in this paper. They are based on Krivine's abstract machine [Kri85] which uses an environment to store arguments of function calls. A proof of their correctness is then stated in the abstract framework of λ&sgr;-calculus [Cur89].
本文给出了两个抽象机器将项还原为它们的完全范式。它们基于Krivine的抽象机器[Kri85],它使用一个环境来存储函数调用的参数。然后在λ&sgr;-微积分的抽象框架中证明了它们的正确性[Cur89]。
{"title":"An abstract machine for Lambda-terms normalization","authors":"P. Crégut","doi":"10.1145/91556.91681","DOIUrl":"https://doi.org/10.1145/91556.91681","url":null,"abstract":"Two abstract machines reducing terms to their full normal form are presented in this paper. They are based on Krivine's abstract machine [Kri85] which uses an environment to store arguments of function calls. A proof of their correctness is then stated in the abstract framework of λ&sgr;-calculus [Cur89].","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131812449","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 65
Partial type inference for untyped functional programs 无类型函数程序的部分类型推断
Pub Date : 1990-05-01 DOI: 10.1145/91556.91672
C. K. Gomard
This extended abstract describes a way of inferring as much type information as possible about programs written in an untyped programming language. We present an algorithm that underlines the untypable parts of a program and assigns types to the rest. The algorithm is derived in a very simple manner from the well-known algorithm W of Damas & Milner [Damas and Milner 1982].Our algorithm provides us with an easy solution to the problem of doing binding time analysis of the untyped higher order lambda calculus, and thereby of the wide range of programming languages based upon the lambda calculus. The techniques can also be used to eliminate superfluous runtime type checking in untyped functional languages, to produce better error messages from type analyzers for strongly typed languages, and to analyze feasibility of arity raising.
这个扩展的抽象描述了一种方法,可以推断出用非类型化编程语言编写的程序的尽可能多的类型信息。我们提出了一种算法,它强调程序中不可类型化的部分,并为其余部分分配类型。该算法以非常简单的方式从Damas和Milner的著名算法W中推导出来[Damas和Milner 1982]。我们的算法为无类型高阶lambda演算的绑定时间分析问题提供了一个简单的解决方案,从而为基于lambda演算的各种编程语言提供了一个简单的解决方案。这些技术还可用于消除无类型函数语言中多余的运行时类型检查,从类型分析器为强类型语言生成更好的错误消息,以及分析性提升的可行性。
{"title":"Partial type inference for untyped functional programs","authors":"C. K. Gomard","doi":"10.1145/91556.91672","DOIUrl":"https://doi.org/10.1145/91556.91672","url":null,"abstract":"This extended abstract describes a way of inferring as much type information as possible about programs written in an untyped programming language. We present an algorithm that underlines the untypable parts of a program and assigns types to the rest. The algorithm is derived in a very simple manner from the well-known algorithm W of Damas & Milner [Damas and Milner 1982].\u0000Our algorithm provides us with an easy solution to the problem of doing binding time analysis of the untyped higher order lambda calculus, and thereby of the wide range of programming languages based upon the lambda calculus. The techniques can also be used to eliminate superfluous runtime type checking in untyped functional languages, to produce better error messages from type analyzers for strongly typed languages, and to analyze feasibility of arity raising.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122389140","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 69
Static dependent types for first class modules 第一类模块的静态依赖类型
Pub Date : 1990-05-01 DOI: 10.1145/91556.91577
Mark A. Sheldon, D. Gifford
Static dependent types are the basis of a new type system that permits types and values to be packaged together into first class modules. Unlike other approaches to modules, static dependent types permit unrestricted access to the types and values in first class modules without sacrificing static type checking or data abstraction. Static dependent types are type safe in the presence of side effects because they rely on an effect system that can make deductions conventional type systems cannot. Experience with an implementation, built as an extension to the FX-87 programming language, shows that static dependent types can be used for building large systems.
静态依赖类型是新类型系统的基础,它允许类型和值一起打包到第一类模块中。与其他模块方法不同,静态依赖类型允许不受限制地访问第一类模块中的类型和值,而不会牺牲静态类型检查或数据抽象。静态依赖类型在存在副作用的情况下是类型安全的,因为它们依赖于一个可以进行常规类型系统无法进行的演绎的效果系统。作为FX-87编程语言的扩展而构建的实现的经验表明,静态依赖类型可以用于构建大型系统。
{"title":"Static dependent types for first class modules","authors":"Mark A. Sheldon, D. Gifford","doi":"10.1145/91556.91577","DOIUrl":"https://doi.org/10.1145/91556.91577","url":null,"abstract":"Static dependent types are the basis of a new type system that permits types and values to be packaged together into first class modules. Unlike other approaches to modules, static dependent types permit unrestricted access to the types and values in first class modules without sacrificing static type checking or data abstraction. Static dependent types are type safe in the presence of side effects because they rely on an effect system that can make deductions conventional type systems cannot. Experience with an implementation, built as an extension to the FX-87 programming language, shows that static dependent types can be used for building large systems.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"131364650","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 21
Unify and conquer 统一和征服
Pub Date : 1990-05-01 DOI: 10.1145/91556.91652
H. Baker
Type inference is the process by which an expression in an untyped computer language such as the lambda-calculus, Lisp, or a functional language can be assigned a static data type in order to improve the code generated by a compiler. Storage use inference is the process by which a program in a computer language can be statically analyzed to model its run-time behavior, particularly the containment and sharing relations among its run-time data structures. The information generated by storage use information can also be used to improve the code generated by a compiler, because knowledge of the containment and sharing relations of run-time data structures allows for methods of storage allocation and deallocation which are cheaper than garbage-collected heap storage and allows for the in-place updating of functional aggregates.Type inference and storage use inference have traditionally been considered orthogonal processes, with separate traditions and literature. However, we show in this paper than this separation may be a mistake, because the best-known and best-understood of the type inferencing algorithms—Milner's unification method for ML—already generates valuable sharing and containment information which is then unfortunately discarded. We show that this sharing information is already generated by standard unification algorithms with no additional overhead during unification; however, there is some additional work necessary to extract this information. We have not yet precisely characterized the resolving power of this sharing and containment information, but we believe that it is similar to that generated by researchers using other techniques. However, our scheme seems to only work for functional languages like pure Lisp.The unification of type and storage inferencing yields new insights into the meaning of “aggregate type”, which should prove valuable in the design of future type systems.
类型推断是一种过程,通过这种过程,可以为无类型计算机语言(如lambda演算、Lisp或函数式语言)中的表达式分配静态数据类型,以改进编译器生成的代码。存储使用推理是对计算机语言中的程序进行静态分析以对其运行时行为建模的过程,特别是其运行时数据结构之间的包含和共享关系。存储使用信息生成的信息还可以用于改进编译器生成的代码,因为对运行时数据结构的包含和共享关系的了解允许使用比垃圾收集堆存储更便宜的存储分配和回收方法,并允许对功能聚合进行就地更新。类型推理和存储使用推理传统上被认为是正交的过程,具有不同的传统和文献。然而,我们在本文中表明,这种分离可能是一个错误,因为最著名和最容易理解的类型推理算法——米尔纳的ml统一方法——已经产生了有价值的共享和包含信息,然后不幸被丢弃。我们证明了这种共享信息已经由标准统一算法生成,在统一过程中没有额外的开销;然而,需要做一些额外的工作来提取这些信息。我们还没有精确地描述这种共享和遏制信息的解析能力,但我们认为它与研究人员使用其他技术产生的解析能力相似。然而,我们的方案似乎只适用于像纯Lisp这样的函数式语言。类型和存储推理的统一产生了对“聚合类型”含义的新见解,这将在未来类型系统的设计中证明是有价值的。
{"title":"Unify and conquer","authors":"H. Baker","doi":"10.1145/91556.91652","DOIUrl":"https://doi.org/10.1145/91556.91652","url":null,"abstract":"Type inference is the process by which an expression in an untyped computer language such as the lambda-calculus, Lisp, or a functional language can be assigned a static data type in order to improve the code generated by a compiler. Storage use inference is the process by which a program in a computer language can be statically analyzed to model its run-time behavior, particularly the containment and sharing relations among its run-time data structures. The information generated by storage use information can also be used to improve the code generated by a compiler, because knowledge of the containment and sharing relations of run-time data structures allows for methods of storage allocation and deallocation which are cheaper than garbage-collected heap storage and allows for the in-place updating of functional aggregates.\u0000Type inference and storage use inference have traditionally been considered orthogonal processes, with separate traditions and literature. However, we show in this paper than this separation may be a mistake, because the best-known and best-understood of the type inferencing algorithms—Milner's unification method for ML—already generates valuable sharing and containment information which is then unfortunately discarded. We show that this sharing information is already generated by standard unification algorithms with no additional overhead during unification; however, there is some additional work necessary to extract this information. We have not yet precisely characterized the resolving power of this sharing and containment information, but we believe that it is similar to that generated by researchers using other techniques. However, our scheme seems to only work for functional languages like pure Lisp.\u0000The unification of type and storage inferencing yields new insights into the meaning of “aggregate type”, which should prove valuable in the design of future type systems.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130720114","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 43
A parallel virtual machine for efficient scheme compilation 一个并行的虚拟机,用于高效的方案编译
Pub Date : 1990-05-01 DOI: 10.1145/91556.91606
M. Feeley, James S. Miller
Programs compiled by Gambit, our Scheme compiler, achieve performance as much as twice that of the fastest available Scheme compilers. Gambit is easily ported, while retaining its high performance, through the use of a simple virtual machine (PVM). PVM allows a wide variety of machine-independent optimizations and it supports parallel computation based on the future construct. PVM conveys high-level information bidirectionally between the machine-independent front end of the compiler and the machine-dependent back end, making it easy to implement a number of common back end optimizations that are difficult to achieve for other virtual machines.PVM is similar to many real computer architectures and has an option to efficiently gather dynamic measurements of virtual machine usage. These measurements can be used in performance prediction for ports to other architectures as well as design decisions related to proposed optimizations and object representations.
由Gambit编译的程序,我们的Scheme编译器,实现的性能是最快的Scheme编译器的两倍。通过使用一个简单的虚拟机(PVM), Gambit很容易移植,同时保持其高性能。PVM允许多种与机器无关的优化,并支持基于未来结构的并行计算。PVM在与机器无关的编译器前端和与机器相关的后端之间双向传递高级信息,从而可以轻松实现许多常见的后端优化,而这些优化在其他虚拟机中很难实现。PVM类似于许多真实的计算机体系结构,并且可以有效地收集虚拟机使用情况的动态测量。这些测量可用于到其他体系结构的端口的性能预测,以及与建议的优化和对象表示相关的设计决策。
{"title":"A parallel virtual machine for efficient scheme compilation","authors":"M. Feeley, James S. Miller","doi":"10.1145/91556.91606","DOIUrl":"https://doi.org/10.1145/91556.91606","url":null,"abstract":"Programs compiled by Gambit, our Scheme compiler, achieve performance as much as twice that of the fastest available Scheme compilers. Gambit is easily ported, while retaining its high performance, through the use of a simple virtual machine (PVM). PVM allows a wide variety of machine-independent optimizations and it supports parallel computation based on the future construct. PVM conveys high-level information bidirectionally between the machine-independent front end of the compiler and the machine-dependent back end, making it easy to implement a number of common back end optimizations that are difficult to achieve for other virtual machines.\u0000PVM is similar to many real computer architectures and has an option to efficiently gather dynamic measurements of virtual machine usage. These measurements can be used in performance prediction for ports to other architectures as well as design decisions related to proposed optimizations and object representations.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"134503832","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 37
Binding time analysis for high order untyped functional languages 高阶无类型函数式语言的绑定时间分析
Pub Date : 1990-05-01 DOI: 10.1145/91556.91668
C. Consel
When some inputs of a program are known at compile-time, certain expressions can be processed statically; this is the basis of the notion of partial evaluation. Identifying these early computations can be determined independently of the actual values of the input by a static analysis called binding time analysis. Then, to process a program, one simply follows the binding time information: evaluate compile-time expressions and defer the others to run-time.Using abstract interpretation, we present a binding time analysis for an untyped functional language which provides an effective treatment of both higher order functions and data structures. To our knowledge it is the first such analysis. It has been implemented and is used in a partial evaluator for a side-effect free dialect of Scheme. The analysis is general enough, however, to be valid for non-strict typed functional languages such as Haskell. Our approach and the system we have developed solve and go beyond the open problem of partially evaluating higher order functions described in [3] since we also provide a method to handle data structures.Our analysis improves on previous work [5, 15, 4] in that: (1) it treats both higher order functions and data structures, (2) it does not impose syntactic restrictions on the program being processed, and (3) it does not require a preliminary phase to collect the set of possible functions that may occur at each site of application.
当程序的某些输入在编译时已知时,可以静态地处理某些表达式;这是部分求值概念的基础。通过称为绑定时间分析的静态分析,可以独立于输入的实际值确定这些早期计算。然后,要处理程序,只需遵循绑定时间信息:计算编译时表达式,并将其他表达式推迟到运行时。通过抽象解释,我们提出了一种无类型函数语言的绑定时间分析,它提供了对高阶函数和数据结构的有效处理。据我们所知,这是第一次这样的分析。它已被实现,并用于Scheme无副作用方言的部分求值器中。然而,该分析足够通用,对于非严格类型的函数式语言(如Haskell)也是有效的。我们的方法和我们开发的系统解决并超越了[3]中描述的部分评估高阶函数的开放问题,因为我们还提供了处理数据结构的方法。我们的分析改进了以前的工作[5,15,4],因为:(1)它同时处理高阶函数和数据结构,(2)它没有对正在处理的程序施加语法限制,(3)它不需要一个初步阶段来收集可能出现在每个应用程序站点的可能函数集。
{"title":"Binding time analysis for high order untyped functional languages","authors":"C. Consel","doi":"10.1145/91556.91668","DOIUrl":"https://doi.org/10.1145/91556.91668","url":null,"abstract":"When some inputs of a program are known at compile-time, certain expressions can be processed statically; this is the basis of the notion of partial evaluation. Identifying these early computations can be determined independently of the actual values of the input by a static analysis called binding time analysis. Then, to process a program, one simply follows the binding time information: evaluate compile-time expressions and defer the others to run-time.\u0000Using abstract interpretation, we present a binding time analysis for an untyped functional language which provides an effective treatment of both higher order functions and data structures. To our knowledge it is the first such analysis. It has been implemented and is used in a partial evaluator for a side-effect free dialect of Scheme. The analysis is general enough, however, to be valid for non-strict typed functional languages such as Haskell. Our approach and the system we have developed solve and go beyond the open problem of partially evaluating higher order functions described in [3] since we also provide a method to handle data structures.\u0000Our analysis improves on previous work [5, 15, 4] in that: (1) it treats both higher order functions and data structures, (2) it does not impose syntactic restrictions on the program being processed, and (3) it does not require a preliminary phase to collect the set of possible functions that may occur at each site of application.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"130749343","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 99
From operational semantics to abstract machines: preliminary results 从操作语义到抽象机器:初步结果
Pub Date : 1990-05-01 DOI: 10.1145/91556.91680
J. Hannan, D. Miller
The operational semantics of functional programming languages is frequently presented using inference rules within simple meta-logics. Such presentations of semantics can be high-level and perspicuous since meta-logics often handle numerous syntactic details in a declarative fashion. This is particularly true of the meta-logic we consider here, which includes simply typed λ-terms, quantification at higher types, and β-conversion. Evaluation of functional programming languages is also often presented using low-level descriptions based on abstract machines: simple term rewriting systems in which few high-level features are present. In this paper, we illustrate how a high-level description of evaluation using inference rules can be systematically transformed into a low-level abstract machine by removing dependencies on high-level features of the meta-logic until the resulting inference rules are so simple that they can be immediately identified as specifying an abstract machine. In particular, we present in detail the transformation of two inference rules specifying call-by-name evaluation of the untyped λ-calculus into the Krivine machine, a stack-based abstract machine that implements such evaluation. The initial specification uses the meta-logic's β-conversion to perform substitutions. The resulting machine uses de Bruijn numerals and closures instead of formal substitution. We also comment on a similar construction of a simplified SECD machine implementing call-by-value evaluation. This approach to abstract machine construction provides a semantics-directed method for motivating, proving correct, and extending such abstract machines.
函数式编程语言的操作语义经常使用简单元逻辑中的推理规则来表示。这种语义表示可以是高级的和清晰的,因为元逻辑经常以声明的方式处理大量语法细节。我们在这里考虑的元逻辑尤其如此,它包括简单类型的λ项、更高类型的量化和β转换。函数式编程语言的评估也经常使用基于抽象机器的低级描述:简单的术语重写系统,其中很少有高级功能。在本文中,我们说明了如何通过去除对元逻辑的高级特征的依赖,将使用推理规则的高级评估描述系统地转换为低级抽象机器,直到生成的推理规则非常简单,可以立即识别为指定抽象机器。特别地,我们详细地介绍了两个指定无类型λ演算的按名称调用求值的推理规则到Krivine机的转换,Krivine机是一个基于堆栈的抽象机,实现了这种求值。最初的规范使用元逻辑的β-转换来执行替换。生成的机器使用德布鲁因数字和闭包而不是形式替换。我们还评论了实现按值调用求值的简化SECD机器的类似构造。这种抽象机器构造的方法提供了一种语义导向的方法来激励、证明正确和扩展这样的抽象机器。
{"title":"From operational semantics to abstract machines: preliminary results","authors":"J. Hannan, D. Miller","doi":"10.1145/91556.91680","DOIUrl":"https://doi.org/10.1145/91556.91680","url":null,"abstract":"The operational semantics of functional programming languages is frequently presented using inference rules within simple meta-logics. Such presentations of semantics can be high-level and perspicuous since meta-logics often handle numerous syntactic details in a declarative fashion. This is particularly true of the meta-logic we consider here, which includes simply typed λ-terms, quantification at higher types, and β-conversion. Evaluation of functional programming languages is also often presented using low-level descriptions based on abstract machines: simple term rewriting systems in which few high-level features are present. In this paper, we illustrate how a high-level description of evaluation using inference rules can be systematically transformed into a low-level abstract machine by removing dependencies on high-level features of the meta-logic until the resulting inference rules are so simple that they can be immediately identified as specifying an abstract machine. In particular, we present in detail the transformation of two inference rules specifying call-by-name evaluation of the untyped λ-calculus into the Krivine machine, a stack-based abstract machine that implements such evaluation. The initial specification uses the meta-logic's β-conversion to perform substitutions. The resulting machine uses de Bruijn numerals and closures instead of formal substitution. We also comment on a similar construction of a simplified SECD machine implementing call-by-value evaluation. This approach to abstract machine construction provides a semantics-directed method for motivating, proving correct, and extending such abstract machines.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"129816210","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 35
Efficient method dispatch in PCL 高效的PCL调度方法
Pub Date : 1990-05-01 DOI: 10.1145/91556.91600
G. Kiczales, Luis Rodriguez
Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Publications Dept, ACM Inc., fax +1 (212) 869-0481, or permissions@acm.org.
允许制作部分或全部作品的数字或硬拷贝供个人或课堂使用,但不收取任何费用,前提是制作或分发副本不是为了盈利或商业利益,并且副本在第一页上带有本通知和完整的引用。本作品组件的版权归ACM以外的其他人所有,必须得到尊重。允许有信用的摘要。以其他方式复制、重新发布、在服务器上发布或重新分发到列表,需要事先获得特定许可和/或付费。向ACM出版部门申请许可,传真+1(212)8669 -0481,或permissions@acm.org。
{"title":"Efficient method dispatch in PCL","authors":"G. Kiczales, Luis Rodriguez","doi":"10.1145/91556.91600","DOIUrl":"https://doi.org/10.1145/91556.91600","url":null,"abstract":"Permission to make digital or hard copies of part or all of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from Publications Dept, ACM Inc., fax +1 (212) 869-0481, or permissions@acm.org.","PeriodicalId":409945,"journal":{"name":"LISP and Functional Programming","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"1990-05-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"122740305","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 85
期刊
LISP and Functional Programming
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1