首页 > 最新文献

Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages最新文献

英文 中文
Rigorous floating-point mixed-precision tuning 严格的浮点混合精度调优
Wei-Fan Chiang, Mark Baranowski, Ian Briggs, A. Solovyev, G. Gopalakrishnan, Zvonimir Rakamaric
Virtually all real-valued computations are carried out using floating-point data types and operations. The precision of these data types must be set with the goals of reducing the overall round-off error, but also emphasizing performance improvements. Often, a mixed-precision allocation achieves this optimum; unfortunately, there are no techniques available to compute such allocations and conservatively meet a given error target across all program inputs. In this work, we present a rigorous approach to precision allocation based on formal analysis via Symbolic Taylor Expansions, and error analysis based on interval functions. This approach is implemented in an automated tool called FPTuner that generates and solves a quadratically constrained quadratic program to obtain a precision-annotated version of the given expression. FPTuner automatically introduces all the requisite precision up and down casting operations. It also allows users to flexibly control precision allocation using constraints to cap the number of high precision operators as well as group operators to allocate the same precision to facilitate vectorization. We evaluate FPTuner by tuning several benchmarks and measuring the proportion of lower precision operators allocated as we increase the error threshold. We also measure the reduction in energy consumption resulting from executing mixed-precision tuned code on a real hardware platform. We observe significant energy savings in response to mixed-precision tuning, but also observe situations where unexpected compiler behaviors thwart intended optimizations.
实际上,所有实值计算都是使用浮点数据类型和操作进行的。这些数据类型的精度必须以减少总体舍入误差为目标来设置,但也要强调性能改进。通常,混合精度分配可以实现这种最优;不幸的是,没有可用的技术来计算这种分配,并且保守地满足所有程序输入的给定错误目标。在这项工作中,我们提出了一种基于符号泰勒展开的形式分析和基于区间函数的误差分析的精确分配方法。这种方法是在一个名为FPTuner的自动化工具中实现的,该工具生成并求解一个二次约束的二次规划,以获得给定表达式的精确注释版本。FPTuner自动引入所有必要的精密上下铸造操作。它还允许用户灵活地控制精度分配,使用约束来限制高精度运算符的数量,以及使用组运算符来分配相同的精度,以方便向量化。我们通过调优几个基准来评估FPTuner,并测量随着误差阈值的增加而分配的低精度算子的比例。我们还测量了在真实硬件平台上执行混合精度调优代码所减少的能耗。我们观察到混合精度调优的显著节能,但也观察到意想不到的编译器行为阻碍预期优化的情况。
{"title":"Rigorous floating-point mixed-precision tuning","authors":"Wei-Fan Chiang, Mark Baranowski, Ian Briggs, A. Solovyev, G. Gopalakrishnan, Zvonimir Rakamaric","doi":"10.1145/3009837.3009846","DOIUrl":"https://doi.org/10.1145/3009837.3009846","url":null,"abstract":"Virtually all real-valued computations are carried out using floating-point data types and operations. The precision of these data types must be set with the goals of reducing the overall round-off error, but also emphasizing performance improvements. Often, a mixed-precision allocation achieves this optimum; unfortunately, there are no techniques available to compute such allocations and conservatively meet a given error target across all program inputs. In this work, we present a rigorous approach to precision allocation based on formal analysis via Symbolic Taylor Expansions, and error analysis based on interval functions. This approach is implemented in an automated tool called FPTuner that generates and solves a quadratically constrained quadratic program to obtain a precision-annotated version of the given expression. FPTuner automatically introduces all the requisite precision up and down casting operations. It also allows users to flexibly control precision allocation using constraints to cap the number of high precision operators as well as group operators to allocate the same precision to facilitate vectorization. We evaluate FPTuner by tuning several benchmarks and measuring the proportion of lower precision operators allocated as we increase the error threshold. We also measure the reduction in energy consumption resulting from executing mixed-precision tuned code on a real hardware platform. We observe significant energy savings in response to mixed-precision tuning, but also observe situations where unexpected compiler behaviors thwart intended optimizations.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"29 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"78858099","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}
引用次数: 110
Computational higher-dimensional type theory 计算高维类型理论
C. Angiuli, R. Harper, Todd Wilson
Formal constructive type theory has proved to be an effective language for mechanized proof. By avoiding non-constructive principles, such as the law of the excluded middle, type theory admits sharper proofs and broader interpretations of results. From a computer science perspective, interest in type theory arises from its applications to programming languages. Standard constructive type theories used in mechanization admit computational interpretations based on meta-mathematical normalization theorems. These proofs are notoriously brittle; any change to the theory potentially invalidates its computational meaning. As a case in point, Voevodsky's univalence axiom raises questions about the computational meaning of proofs. We consider the question: Can higher-dimensional type theory be construed as a programming language? We answer this question affirmatively by providing a direct, deterministic operational interpretation for a representative higher-dimensional dependent type theory with higher inductive types and an instance of univalence. Rather than being a formal type theory defined by rules, it is instead a computational type theory in the sense of Martin-Löf's meaning explanations and of the NuPRL semantics. The definition of the type theory starts with programs; types are specifications of program behavior. The main result is a canonicity theorem stating that closed programs of boolean type evaluate to true or false.
形式构造型理论已被证明是机械化证明的有效语言。通过避免非建设性原则,如排除中间法则,类型理论允许更清晰的证据和更广泛的结果解释。从计算机科学的角度来看,对类型理论的兴趣源于它在编程语言中的应用。机械化中使用的标准构造型理论允许基于元数学归一化定理的计算解释。这些证据是出了名的脆弱;对该理论的任何改变都可能使其计算意义失效。作为一个恰当的例子,Voevodsky的一价公理提出了关于证明的计算意义的问题。我们考虑这样一个问题:高维类型理论可以被解释为一种编程语言吗?我们肯定地回答了这个问题,提供了一个直接的,确定性的操作解释的代表性高维依赖类型理论具有较高的归纳类型和一元的实例。它不是由规则定义的形式类型理论,而是在Martin-Löf的意义解释和NuPRL语义意义上的计算类型理论。类型理论的定义从程序开始;类型是程序行为的规范。主要结果是一个正则性定理,说明布尔类型的闭程序的计算结果为真或假。
{"title":"Computational higher-dimensional type theory","authors":"C. Angiuli, R. Harper, Todd Wilson","doi":"10.1145/3009837.3009861","DOIUrl":"https://doi.org/10.1145/3009837.3009861","url":null,"abstract":"Formal constructive type theory has proved to be an effective language for mechanized proof. By avoiding non-constructive principles, such as the law of the excluded middle, type theory admits sharper proofs and broader interpretations of results. From a computer science perspective, interest in type theory arises from its applications to programming languages. Standard constructive type theories used in mechanization admit computational interpretations based on meta-mathematical normalization theorems. These proofs are notoriously brittle; any change to the theory potentially invalidates its computational meaning. As a case in point, Voevodsky's univalence axiom raises questions about the computational meaning of proofs. We consider the question: Can higher-dimensional type theory be construed as a programming language? We answer this question affirmatively by providing a direct, deterministic operational interpretation for a representative higher-dimensional dependent type theory with higher inductive types and an instance of univalence. Rather than being a formal type theory defined by rules, it is instead a computational type theory in the sense of Martin-Löf's meaning explanations and of the NuPRL semantics. The definition of the type theory starts with programs; types are specifications of program behavior. The main result is a canonicity theorem stating that closed programs of boolean type evaluate to true or false.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"7 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"87423265","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}
引用次数: 45
Analyzing divergence in bisimulation semantics 双仿真语义歧义分析
Xinxin Liu, Tingting Yu, Wenhui Zhang
Some bisimulation based abstract equivalence relations may equate divergent systems with non-divergent ones, examples including weak bisimulation equivalence and branching bisimulation equivalence. Thus extra efforts are needed to analyze divergence for the compared systems. In this paper we propose a new method for analyzing divergence in bisimulation semantics, which relies only on simple observations of individual transitions. We show that this method can verify several typical divergence preserving bisimulation equivalences including two well-known ones. As an application case study, we use the proposed method to verify the HSY collision stack to draw the conclusion that the stack implementation is correct in terms of linearizability with lock-free progress condition.
一些基于双模拟的抽象等价关系可以将发散系统与非发散系统等同起来,例如弱双模拟等价和分支双模拟等价。因此,需要额外的努力来分析比较系统的散度。本文提出了一种分析双模拟语义发散的新方法,该方法仅依赖于单个跃迁的简单观察。我们证明了该方法可以验证几个典型的保散双模拟等价,其中包括两个众所周知的等价。作为一个应用案例,我们使用该方法对HSY碰撞堆栈进行验证,得出堆栈实现在无锁进程条件下的线性化是正确的结论。
{"title":"Analyzing divergence in bisimulation semantics","authors":"Xinxin Liu, Tingting Yu, Wenhui Zhang","doi":"10.1145/3009837.3009870","DOIUrl":"https://doi.org/10.1145/3009837.3009870","url":null,"abstract":"Some bisimulation based abstract equivalence relations may equate divergent systems with non-divergent ones, examples including weak bisimulation equivalence and branching bisimulation equivalence. Thus extra efforts are needed to analyze divergence for the compared systems. In this paper we propose a new method for analyzing divergence in bisimulation semantics, which relies only on simple observations of individual transitions. We show that this method can verify several typical divergence preserving bisimulation equivalences including two well-known ones. As an application case study, we use the proposed method to verify the HSY collision stack to draw the conclusion that the stack implementation is correct in terms of linearizability with lock-free progress condition.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"47 7-8","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"91507531","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}
引用次数: 8
Ogre and Pythia: an invariance proof method for weak consistency models Ogre和Pythia:弱一致性模型的不变性证明方法
J. Alglave, P. Cousot
We design an invariance proof method for concurrent programs parameterised by a weak consistency model. The calculational design of the invariance proof method is by abstract interpretation of a truly parallel analytic semantics. This generalises the methods by Lamport and Owicki-Gries for sequential consistency. We use cat as an example of language to write consistency specifications of both concurrent programs and machine architectures.
设计了一种用弱一致性模型参数化并发程序的不变性证明方法。不变性证明方法的计算设计是通过一个真正的并行解析语义的抽象解释。这推广了Lamport和Owicki-Gries的序列一致性方法。我们使用cat作为编写并发程序和机器体系结构一致性规范的语言示例。
{"title":"Ogre and Pythia: an invariance proof method for weak consistency models","authors":"J. Alglave, P. Cousot","doi":"10.1145/3009837.3009883","DOIUrl":"https://doi.org/10.1145/3009837.3009883","url":null,"abstract":"We design an invariance proof method for concurrent programs parameterised by a weak consistency model. The calculational design of the invariance proof method is by abstract interpretation of a truly parallel analytic semantics. This generalises the methods by Lamport and Owicki-Gries for sequential consistency. We use cat as an example of language to write consistency specifications of both concurrent programs and machine architectures.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"99 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"89271783","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}
引用次数: 34
Component-based synthesis for complex APIs 复杂api的基于组件的合成
Yu Feng, R. Martins, Yuepeng Wang, Işıl Dillig, T. Reps
Component-based approaches to program synthesis assemble programs from a database of existing components, such as methods provided by an API. In this paper, we present a novel type-directed algorithm for component-based synthesis. The key novelty of our approach is the use of a compact Petri-net representation to model relationships between methods in an API. Given a target method signature S, our approach performs reachability analysis on the underlying Petri-net model to identify sequences of method calls that could be used to synthesize an implementation of S. The programs synthesized by our algorithm are guaranteed to type check and pass all test cases provided by the user. We have implemented this approach in a tool called SyPet, and used it to successfully synthesize real-world programming tasks extracted from on-line forums and existing code repositories. We also compare SyPet with two state-of-the-art synthesis tools, namely InSynth and CodeHint, and demonstrate that SyPet can synthesize more programs in less time. Finally, we compare our approach with an alternative solution based on hypergraphs and demonstrate its advantages.
基于组件的程序合成方法从现有组件(如API提供的方法)的数据库中组装程序。在本文中,我们提出了一种新的面向类型的基于组件的合成算法。我们的方法的关键新颖之处在于使用紧凑的Petri-net表示来为API中方法之间的关系建模。给定目标方法签名S,我们的方法在底层Petri-net模型上执行可达性分析,以识别可用于合成S实现的方法调用序列。通过我们的算法合成的程序保证类型检查并通过用户提供的所有测试用例。我们已经在一个名为SyPet的工具中实现了这种方法,并使用它成功地合成了从在线论坛和现有代码库中提取的实际编程任务。我们还将SyPet与两种最先进的合成工具InSynth和CodeHint进行了比较,并证明SyPet可以在更短的时间内合成更多的程序。最后,我们将我们的方法与基于超图的替代解决方案进行了比较,并展示了其优点。
{"title":"Component-based synthesis for complex APIs","authors":"Yu Feng, R. Martins, Yuepeng Wang, Işıl Dillig, T. Reps","doi":"10.1145/3009837.3009851","DOIUrl":"https://doi.org/10.1145/3009837.3009851","url":null,"abstract":"Component-based approaches to program synthesis assemble programs from a database of existing components, such as methods provided by an API. In this paper, we present a novel type-directed algorithm for component-based synthesis. The key novelty of our approach is the use of a compact Petri-net representation to model relationships between methods in an API. Given a target method signature S, our approach performs reachability analysis on the underlying Petri-net model to identify sequences of method calls that could be used to synthesize an implementation of S. The programs synthesized by our algorithm are guaranteed to type check and pass all test cases provided by the user. We have implemented this approach in a tool called SyPet, and used it to successfully synthesize real-world programming tasks extracted from on-line forums and existing code repositories. We also compare SyPet with two state-of-the-art synthesis tools, namely InSynth and CodeHint, and demonstrate that SyPet can synthesize more programs in less time. Finally, we compare our approach with an alternative solution based on hypergraphs and demonstrate its advantages.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"30 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"83359514","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}
引用次数: 119
A relational model of types-and-effects in higher-order concurrent separation logic 高阶并发分离逻辑中类型与效果的关系模型
Morten Krogh-Jespersen, Kasper Svendsen, L. Birkedal
Recently we have seen a renewed interest in programming languages that tame the complexity of state and concurrency through refined type systems with more fine-grained control over effects. In addition to simplifying reasoning and eliminating whole classes of bugs, statically tracking effects opens the door to advanced compiler optimizations. In this paper we present a relational model of a type-and-effect system for a higher-order, concurrent program- ming language. The model precisely captures the semantic invariants expressed by the effect annotations. We demonstrate that these invariants are strong enough to prove advanced program transformations, including automatic parallelization of expressions with suitably disjoint effects. The model also supports refinement proofs between abstract data types implementations with different internal data representations, including proofs that fine-grained concurrent algorithms refine their coarse-grained counterparts. This is the first model for such an expressive language that supports both effect-based optimizations and data abstraction. The logical relation is defined in Iris, a state-of-the-art higher-order concurrent separation logic. This greatly simplifies proving well-definedness of the logical relation and also provides us with a powerful logic for reasoning in the model.
最近,我们看到对编程语言重新产生了兴趣,这些语言通过对效果进行更细粒度控制的精炼类型系统来驯服状态和并发性的复杂性。除了简化推理和消除所有类型的bug之外,静态跟踪效果还为高级编译器优化打开了大门。本文提出了一种高阶并发编程语言的类型-效果系统的关系模型。该模型精确地捕获了由效果注释表达的语义不变量。我们证明了这些不变量足够强大,足以证明高级程序转换,包括具有适当不相交效果的表达式的自动并行化。该模型还支持具有不同内部数据表示的抽象数据类型实现之间的精化证明,包括细粒度并发算法精化粗粒度对应算法的证明。这是这种既支持基于效果的优化又支持数据抽象的表达性语言的第一个模型。逻辑关系在Iris中定义,Iris是一种最先进的高阶并发分离逻辑。这大大简化了证明逻辑关系的良好定义,并为我们在模型中进行推理提供了强大的逻辑。
{"title":"A relational model of types-and-effects in higher-order concurrent separation logic","authors":"Morten Krogh-Jespersen, Kasper Svendsen, L. Birkedal","doi":"10.1145/3009837.3009877","DOIUrl":"https://doi.org/10.1145/3009837.3009877","url":null,"abstract":"Recently we have seen a renewed interest in programming languages that tame the complexity of state and concurrency through refined type systems with more fine-grained control over effects. In addition to simplifying reasoning and eliminating whole classes of bugs, statically tracking effects opens the door to advanced compiler optimizations. In this paper we present a relational model of a type-and-effect system for a higher-order, concurrent program- ming language. The model precisely captures the semantic invariants expressed by the effect annotations. We demonstrate that these invariants are strong enough to prove advanced program transformations, including automatic parallelization of expressions with suitably disjoint effects. The model also supports refinement proofs between abstract data types implementations with different internal data representations, including proofs that fine-grained concurrent algorithms refine their coarse-grained counterparts. This is the first model for such an expressive language that supports both effect-based optimizations and data abstraction. The logical relation is defined in Iris, a state-of-the-art higher-order concurrent separation logic. This greatly simplifies proving well-definedness of the logical relation and also provides us with a powerful logic for reasoning in the model.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"23 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"89531899","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
A program optimization for automatic database result caching 自动数据库结果缓存的程序优化
Ziv Scully, A. Chlipala
Most popular Web applications rely on persistent databases based on languages like SQL for declarative specification of data models and the operations that read and modify them. As applications scale up in user base, they often face challenges responding quickly enough to the high volume of requests. A common aid is caching of database results in the application's memory space, taking advantage of program-specific knowledge of which caching schemes are sound and useful, embodied in handwritten modifications that make the program less maintainable. These modifications also require nontrivial reasoning about the read-write dependencies across operations. In this paper, we present a compiler optimization that automatically adds sound SQL caching to Web applications coded in the Ur/Web domain-specific functional language, with no modifications required to source code. We use a custom cache implementation that supports concurrent operations without compromising the transactional semantics of the database abstraction. Through experiments with microbenchmarks and production Ur/Web applications, we show that our optimization in many cases enables an easy doubling or more of an application's throughput, requiring nothing more than passing an extra command-line flag to the compiler.
大多数流行的Web应用程序依赖于基于SQL等语言的持久数据库,用于数据模型的声明性规范以及读取和修改它们的操作。随着应用程序在用户基础上的扩展,它们经常面临快速响应大量请求的挑战。一种常见的辅助方法是在应用程序的内存空间中缓存数据库结果,利用特定于程序的知识,了解哪些缓存方案是可靠和有用的,具体体现在使程序难以维护的手写修改中。这些修改还需要对操作之间的读写依赖关系进行重要的推理。在本文中,我们提出了一种编译器优化,它可以自动地为用特定于Web领域的函数式语言编写的Web应用程序添加健全的SQL缓存,而不需要修改源代码。我们使用自定义缓存实现,该实现支持并发操作,而不会损害数据库抽象的事务语义。通过微基准测试和生产Ur/Web应用程序的实验,我们表明,在许多情况下,我们的优化可以使应用程序的吞吐量轻松增加一倍或更多,只需要向编译器传递一个额外的命令行标志。
{"title":"A program optimization for automatic database result caching","authors":"Ziv Scully, A. Chlipala","doi":"10.1145/3009837.3009891","DOIUrl":"https://doi.org/10.1145/3009837.3009891","url":null,"abstract":"Most popular Web applications rely on persistent databases based on languages like SQL for declarative specification of data models and the operations that read and modify them. As applications scale up in user base, they often face challenges responding quickly enough to the high volume of requests. A common aid is caching of database results in the application's memory space, taking advantage of program-specific knowledge of which caching schemes are sound and useful, embodied in handwritten modifications that make the program less maintainable. These modifications also require nontrivial reasoning about the read-write dependencies across operations. In this paper, we present a compiler optimization that automatically adds sound SQL caching to Web applications coded in the Ur/Web domain-specific functional language, with no modifications required to source code. We use a custom cache implementation that supports concurrent operations without compromising the transactional semantics of the database abstraction. Through experiments with microbenchmarks and production Ur/Web applications, we show that our optimization in many cases enables an easy doubling or more of an application's throughput, requiring nothing more than passing an extra command-line flag to the compiler.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"1 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"89705832","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
Polymorphism, subtyping, and type inference in MLsub MLsub中的多态性、子类型和类型推断
Stephen Dolan, A. Mycroft
We present a type system combining subtyping and ML-style parametric polymorphism. Unlike previous work, our system supports type inference and has compact principal types. We demonstrate this system in the minimal language MLsub, which types a strict superset of core ML programs. This is made possible by keeping a strict separation between the types used to describe inputs and those used to describe outputs, and extending the classical unification algorithm to handle subtyping constraints between these input and output types. Principal types are kept compact by type simplification, which exploits deep connections between subtyping and the algebra of regular languages. An implementation is available online.
我们提出了一种结合子类型和ml风格参数多态性的类型系统。与以前的工作不同,我们的系统支持类型推断并具有紧凑的主类型。我们用最小语言MLsub来演示这个系统,它是核心ML程序的严格超集。这可以通过严格区分用于描述输入和用于描述输出的类型,并扩展经典的统一算法来处理这些输入和输出类型之间的子类型约束来实现。主类型通过类型简化保持紧凑,这利用了子类型和常规语言的代数之间的深层联系。实现可在线获得。
{"title":"Polymorphism, subtyping, and type inference in MLsub","authors":"Stephen Dolan, A. Mycroft","doi":"10.1145/3009837.3009882","DOIUrl":"https://doi.org/10.1145/3009837.3009882","url":null,"abstract":"We present a type system combining subtyping and ML-style parametric polymorphism. Unlike previous work, our system supports type inference and has compact principal types. We demonstrate this system in the minimal language MLsub, which types a strict superset of core ML programs. This is made possible by keeping a strict separation between the types used to describe inputs and those used to describe outputs, and extending the classical unification algorithm to handle subtyping constraints between these input and output types. Principal types are kept compact by type simplification, which exploits deep connections between subtyping and the algebra of regular languages. An implementation is available online.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"11 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"79530353","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}
引用次数: 40
Stateful manifest contracts 有状态舱单合同
Taro Sekiyama, Atsushi Igarashi
This paper studies hybrid contract verification for an imperative higher-order language based on a so-called manifest contract system. In manifest contract systems, contracts are part of static types and contract verification is hybrid in the sense that some contracts are statically verified, typically by subtyping, but others are dynamically by casts. It is, however, not trivial to extend existing manifest contract systems, which have been designed mostly for pure functional languages, to imperative features, mainly because of the lack of flow-sensitivity, which should be taken into account in verifying imperative programs statically. We develop an imperative higher-order manifest contract system λrefH for flow-sensitive hybrid contract verification. We introduce a computational variant of Nanevski et al's Hoare types, which are flow-sensitive types to represent pre- and postconditions of impure computation. Our Hoare types are computational in the sense that pre- and postconditions are given by Booleans in the same language as programs so that they are dynamically verifiable. λrefH also supports refinement types as in existing manifest contract systems to describe flow-insensitive, state-independent contracts of pure computation. While it is desirable that any-possibly state-manipulating-predicate can be used in contracts, abuse of stateful operations will break the system. To control stateful operations in contracts, we introduce a region-based effect system, which allows contracts in refinement types and computational Hoare types to manipulate states, as long as they are observationally pure and read-only, respectively. We show that dynamic contract checking in our calculus is consistent with static typing in the sense that the final result obtained without dynamic contract violations satisfies contracts in its static type. It in particular means that the state after stateful computations satisfies their postconditions. As in some of prior manifest contract systems, static contract verification in this work is "post facto," that is, we first define our manifest contract system so that all contracts are checked at run time, formalize conditions when dynamic checks can be removed safely, and show that programs with and without such removable checks are contextually equivalent. We also apply the idea of post facto verification to region-based local reasoning, inspired by the frame rule of Separation Logic.
本文研究了一种命令式高阶语言基于清单合同系统的混合合同验证。在清单合同系统中,合同是静态类型的一部分,合同验证在某种意义上是混合的,有些合同是静态验证的,通常是通过子类型验证,但其他合同是通过强制类型转换动态验证的。然而,将现有的主要为纯函数式语言设计的清单契约系统扩展到命令式特性并不是一件容易的事情,主要是因为缺乏流敏感性,在静态验证命令式程序时应该考虑到这一点。我们开发了一个命令式高阶舱单合同系统λrefH,用于流量敏感的混合合同验证。我们引入Nanevski等人的Hoare类型的计算变体,这些类型是流敏感类型,用于表示非纯计算的前置和后置条件。我们的Hoare类型是计算型的,因为前置条件和后置条件是由布尔人用与程序相同的语言给出的,因此它们是动态可验证的。λrefH还支持现有清单合约系统中的细化类型,以描述纯计算的流不敏感,状态独立的合约。虽然可以在契约中使用任何可能的状态操纵谓词是可取的,但滥用有状态操作将破坏系统。为了控制契约中的有状态操作,我们引入了一个基于区域的效果系统,该系统允许细化类型和计算Hoare类型的契约分别操作状态,只要它们在观察上是纯的和只读的。我们证明,在我们的演算中,动态契约检查与静态类型一致,因为在没有动态契约违反的情况下获得的最终结果满足其静态类型的契约。它特别意味着有状态计算后的状态满足其后置条件。正如在之前的一些清单合同系统中,静态合同验证在这项工作中是“事后的”,也就是说,我们首先定义了我们的清单合同系统,以便在运行时检查所有合同,形式化动态检查可以安全地删除的条件,并显示具有和不具有此类可删除检查的程序在上下文中是等效的。受分离逻辑框架规则的启发,我们还将事后验证的思想应用于基于区域的局部推理。
{"title":"Stateful manifest contracts","authors":"Taro Sekiyama, Atsushi Igarashi","doi":"10.1145/3009837.3009875","DOIUrl":"https://doi.org/10.1145/3009837.3009875","url":null,"abstract":"This paper studies hybrid contract verification for an imperative higher-order language based on a so-called manifest contract system. In manifest contract systems, contracts are part of static types and contract verification is hybrid in the sense that some contracts are statically verified, typically by subtyping, but others are dynamically by casts. It is, however, not trivial to extend existing manifest contract systems, which have been designed mostly for pure functional languages, to imperative features, mainly because of the lack of flow-sensitivity, which should be taken into account in verifying imperative programs statically. We develop an imperative higher-order manifest contract system λrefH for flow-sensitive hybrid contract verification. We introduce a computational variant of Nanevski et al's Hoare types, which are flow-sensitive types to represent pre- and postconditions of impure computation. Our Hoare types are computational in the sense that pre- and postconditions are given by Booleans in the same language as programs so that they are dynamically verifiable. λrefH also supports refinement types as in existing manifest contract systems to describe flow-insensitive, state-independent contracts of pure computation. While it is desirable that any-possibly state-manipulating-predicate can be used in contracts, abuse of stateful operations will break the system. To control stateful operations in contracts, we introduce a region-based effect system, which allows contracts in refinement types and computational Hoare types to manipulate states, as long as they are observationally pure and read-only, respectively. We show that dynamic contract checking in our calculus is consistent with static typing in the sense that the final result obtained without dynamic contract violations satisfies contracts in its static type. It in particular means that the state after stateful computations satisfies their postconditions. As in some of prior manifest contract systems, static contract verification in this work is \"post facto,\" that is, we first define our manifest contract system so that all contracts are checked at run time, formalize conditions when dynamic checks can be removed safely, and show that programs with and without such removable checks are contextually equivalent. We also apply the idea of post facto verification to region-based local reasoning, inspired by the frame rule of Separation Logic.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"16 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"78680676","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}
引用次数: 6
On the relationship between higher-order recursion schemes and higher-order fixpoint logic 高阶递归格式与高阶不动点逻辑的关系
N. Kobayashi, É. Lozes, Florian Bruse
We study the relationship between two kinds of higher-order extensions of model checking: HORS model checking, where models are extended to higher-order recursion schemes, and HFL model checking, where the logic is extedned to higher-order modal fixpoint logic. Those extensions have been independently studied until recently, and the former has been applied to higher-order program verification. We show that there exist (arguably) natural reductions between the two problems. To prove the correctness of the translation from HORS to HFL model checking, we establish a type-based characterization of HFL model checking, which should be of independent interest. The results reveal a close relationship between the two problems, enabling cross-fertilization of the two research threads.
研究了模型检验的两种高阶扩展之间的关系:HORS模型检验,其中模型扩展到高阶递归格式,HFL模型检验,其中逻辑扩展到高阶模态不动点逻辑。这些扩展直到最近才被独立研究,前者已应用于高阶程序验证。我们表明,这两个问题之间存在(可论证的)自然缩减。为了证明从HORS到HFL模型检查的转换的正确性,我们建立了HFL模型检查的基于类型的表征,这应该是一个独立的兴趣。结果揭示了这两个问题之间的密切关系,使两个研究线程能够交叉受精。
{"title":"On the relationship between higher-order recursion schemes and higher-order fixpoint logic","authors":"N. Kobayashi, É. Lozes, Florian Bruse","doi":"10.1145/3009837.3009854","DOIUrl":"https://doi.org/10.1145/3009837.3009854","url":null,"abstract":"We study the relationship between two kinds of higher-order extensions of model checking: HORS model checking, where models are extended to higher-order recursion schemes, and HFL model checking, where the logic is extedned to higher-order modal fixpoint logic. Those extensions have been independently studied until recently, and the former has been applied to higher-order program verification. We show that there exist (arguably) natural reductions between the two problems. To prove the correctness of the translation from HORS to HFL model checking, we establish a type-based characterization of HFL model checking, which should be of independent interest. The results reveal a close relationship between the two problems, enabling cross-fertilization of the two research threads.","PeriodicalId":20657,"journal":{"name":"Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages","volume":"178 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2017-01-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"77374035","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}
引用次数: 24
期刊
Proceedings of the 44th ACM SIGPLAN Symposium on Principles of Programming Languages
全部 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