首页 > 最新文献

Proceedings of the ACM on Programming Languages最新文献

英文 中文
Explicit Effects and Effect Constraints in ReML ReML 中的显式效应和效应约束
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632921
Martin Elsman
An important aspect of building robust systems that execute on dedicated hardware and perhaps in constrained environments is to control and manage the effects performed by program code. We present ReML, a higher-order statically-typed functional language, which allows programmers to be explicit about the effects performed by program code and in particular effects related to memory management. Allowing programmers to be explicit about effects, the regions in which values reside, and the constraints under which code execute, makes programs robust to changes in the program source code and to compiler updates, including compiler optimisations. ReML is integrated with a polymorphic inference system that builds on top of region-inference, as it is implemented in the MLKit, a Standard ML compiler that uses region-based memory management as its primary memory management scheme.
要构建在专用硬件上、甚至在受限环境中运行的稳健系统,一个重要方面就是控制和管理程序代码产生的影响。我们介绍的 ReML 是一种高阶静态类型的函数式语言,它允许程序员明确程序代码执行的效果,尤其是与内存管理相关的效果。允许程序员明确表达效果、值所在区域以及代码执行的约束条件,可使程序对程序源代码的更改和编译器的更新(包括编译器优化)保持稳健。ReML 与建立在区域推理基础上的多态推理系统集成,因为它是在 MLKit 中实现的,MLKit 是一种标准 ML 编译器,使用基于区域的内存管理作为其主要内存管理方案。
{"title":"Explicit Effects and Effect Constraints in ReML","authors":"Martin Elsman","doi":"10.1145/3632921","DOIUrl":"https://doi.org/10.1145/3632921","url":null,"abstract":"An important aspect of building robust systems that execute on dedicated hardware and perhaps in constrained environments is to control and manage the effects performed by program code. We present ReML, a higher-order statically-typed functional language, which allows programmers to be explicit about the effects performed by program code and in particular effects related to memory management. Allowing programmers to be explicit about effects, the regions in which values reside, and the constraints under which code execute, makes programs robust to changes in the program source code and to compiler updates, including compiler optimisations. ReML is integrated with a polymorphic inference system that builds on top of region-inference, as it is implemented in the MLKit, a Standard ML compiler that uses region-based memory management as its primary memory management scheme.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139381696","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}
引用次数: 0
The Logical Essence of Well-Bracketed Control Flow 良好控制流的逻辑本质
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632862
Amin Timany, Armaël Guéneau, Lars Birkedal
A program is said to be well-bracketed if every called function must return before its caller can resume execution. This is often the case. Well-bracketedness has been captured semantically as a condition on strategies in fully abstract games models and multiple prior works have studied well-bracketedness by showing correctness/security properties of programs where such properties depend on the well-bracketed nature of control flow. The latter category of prior works have all used involved relational models with explicit state-transition systems capturing the relevant parts of the control flow of the program. In this paper we present the first Hoare-style program logic based on separation logic for reasoning about well-bracketedness and use it to show correctness of well-bracketed programs both directly and also through defining unary and binary logical relations models based on this program logic. All results presented in this paper are formalized on top of the Iris framework and mechanized in the Coq proof assistant.
如果每个被调用函数都必须在其调用者继续执行之前返回,那么这个程序就被认为是良好的。这种情况经常发生。完全抽象博弈模型中的策略条件从语义上捕捉到了良好包络性,先前有许多著作通过展示程序的正确性/安全性属性来研究良好包络性,这些属性取决于控制流的良好包络性。后一类先行研究都使用了涉及关系模型的显式状态转换系统来捕捉程序控制流的相关部分。在本文中,我们首次提出了基于分离逻辑的胡尔式程序逻辑,用于推理井式封装,并直接以及通过定义基于该程序逻辑的一元和二元逻辑关系模型来证明井式封装程序的正确性。本文介绍的所有结果都是在 Iris 框架之上形式化的,并在 Coq 证明助手中机械化。
{"title":"The Logical Essence of Well-Bracketed Control Flow","authors":"Amin Timany, Armaël Guéneau, Lars Birkedal","doi":"10.1145/3632862","DOIUrl":"https://doi.org/10.1145/3632862","url":null,"abstract":"A program is said to be well-bracketed if every called function must return before its caller can resume execution. This is often the case. Well-bracketedness has been captured semantically as a condition on strategies in fully abstract games models and multiple prior works have studied well-bracketedness by showing correctness/security properties of programs where such properties depend on the well-bracketed nature of control flow. The latter category of prior works have all used involved relational models with explicit state-transition systems capturing the relevant parts of the control flow of the program. In this paper we present the first Hoare-style program logic based on separation logic for reasoning about well-bracketedness and use it to show correctness of well-bracketed programs both directly and also through defining unary and binary logical relations models based on this program logic. All results presented in this paper are formalized on top of the Iris framework and mechanized in the Coq proof assistant.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139383027","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}
引用次数: 0
Flan: An Expressive and Efficient Datalog Compiler for Program Analysis Flan:用于程序分析的高效表达式 Datalog 编译器
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632928
Supun Abeysinghe, Anxhelo Xhebraj, Tiark Rompf
Datalog has gained prominence in program analysis due to its expressiveness and ease of use. Its generic fixpoint resolution algorithm over relational domains simplifies the expression of many complex analyses. The performance and scalability issues of early Datalog approaches have been addressed by tools such as Soufflé through specialized code generation. Still, while pure Datalog is expressive enough to support a wide range of analyses, there is a growing need for extensions to accommodate increasingly complex analyses. This has led to the development of various extensions, such as Flix, Datafun, and Formulog, which enhance Datalog with features like arbitrary lattices and SMT constraints. Most of these extensions recognize the need for full interoperability between Datalog and a full-fledged programming language, a functionality that high-performance systems like Soufflé lack. Specifically, in most cases, they construct languages from scratch with first-class Datalog support, allowing greater flexibility. However, this flexibility often comes at the cost of performance due to the conflicting requirements of prioritizing modularity and abstraction over efficiency. Consequently, achieving both flexibility and compilation to highly-performant specialized code poses a significant challenge. In this work, we reconcile the competing demands of expressiveness and performance with Flan, a Datalog compiler fully embedded in Scala that leverages multi-stage programming to generate specialized code for enhanced performance. Our approach combines the flexibility of Flix with Soufflé’s performance, offering seamless integration with the host language that enables the addition of powerful extensions while generating specialized code for the entire computation. Flan’s simple operator interface allows the addition of an extensive set of features, including arbitrary aggregates, user-defined functions, and lattices, with multiple execution strategies such as binary and multi-way joins, supported by different indexing structures like specialized trees and hash tables, with minimal effort. We evaluate our system on a variety of benchmarks and compare it to established Datalog engines. Our results demonstrate competitive performance and speedups in the range of 1.4× to 12.5× compared to state-of-the-art systems for workloads of practical importance.
Datalog 因其表现力和易用性而在程序分析中占据重要地位。它在关系域上的通用定点解析算法简化了许多复杂分析的表达。早期 Datalog 方法在性能和可扩展性方面的问题已通过专门的代码生成工具(如 Soufflé)得到解决。尽管纯 Datalog 的表现力足以支持各种分析,但人们对扩展的需求仍在不断增长,以适应日益复杂的分析。这导致了各种扩展的发展,如 Flix、Datafun 和 Formulog,它们通过任意网格和 SMT 约束等功能增强了 Datalog。这些扩展大多认识到了 Datalog 与成熟编程语言之间的全面互操作性需求,而这正是 Soufflé 等高性能系统所缺乏的功能。具体来说,在大多数情况下,它们从头开始构建具有一流 Datalog 支持的语言,从而实现更大的灵活性。然而,由于模块化和抽象性优先于效率的要求相互冲突,这种灵活性往往以牺牲性能为代价。因此,既要实现灵活性,又要编译出高性能的专用代码,是一个巨大的挑战。在这项工作中,我们用 Flan 调和了表达力和性能这两个相互竞争的需求,Flan 是一种完全嵌入 Scala 的 Datalog 编译器,它利用多阶段编程生成专用代码,从而提高性能。我们的方法结合了 Flix 的灵活性和 Soufflé 的性能,提供了与宿主语言的无缝集成,可以添加功能强大的扩展,同时为整个计算生成专用代码。Flan 的操作界面非常简单,只需极少的工作就能添加大量功能,包括任意聚合、用户自定义函数和网格,以及二进制和多向连接等多种执行策略,并由专门的树和哈希表等不同的索引结构提供支持。我们在各种基准测试中评估了我们的系统,并将其与成熟的 Datalog 引擎进行了比较。我们的结果表明,与最先进的系统相比,我们的系统在具有实际重要性的工作负载上具有竞争力的性能和 1.4 倍到 12.5 倍的速度提升。
{"title":"Flan: An Expressive and Efficient Datalog Compiler for Program Analysis","authors":"Supun Abeysinghe, Anxhelo Xhebraj, Tiark Rompf","doi":"10.1145/3632928","DOIUrl":"https://doi.org/10.1145/3632928","url":null,"abstract":"Datalog has gained prominence in program analysis due to its expressiveness and ease of use. Its generic fixpoint resolution algorithm over relational domains simplifies the expression of many complex analyses. The performance and scalability issues of early Datalog approaches have been addressed by tools such as Soufflé through specialized code generation. Still, while pure Datalog is expressive enough to support a wide range of analyses, there is a growing need for extensions to accommodate increasingly complex analyses. This has led to the development of various extensions, such as Flix, Datafun, and Formulog, which enhance Datalog with features like arbitrary lattices and SMT constraints. Most of these extensions recognize the need for full interoperability between Datalog and a full-fledged programming language, a functionality that high-performance systems like Soufflé lack. Specifically, in most cases, they construct languages from scratch with first-class Datalog support, allowing greater flexibility. However, this flexibility often comes at the cost of performance due to the conflicting requirements of prioritizing modularity and abstraction over efficiency. Consequently, achieving both flexibility and compilation to highly-performant specialized code poses a significant challenge. In this work, we reconcile the competing demands of expressiveness and performance with Flan, a Datalog compiler fully embedded in Scala that leverages multi-stage programming to generate specialized code for enhanced performance. Our approach combines the flexibility of Flix with Soufflé’s performance, offering seamless integration with the host language that enables the addition of powerful extensions while generating specialized code for the entire computation. Flan’s simple operator interface allows the addition of an extensive set of features, including arbitrary aggregates, user-defined functions, and lattices, with multiple execution strategies such as binary and multi-way joins, supported by different indexing structures like specialized trees and hash tables, with minimal effort. We evaluate our system on a variety of benchmarks and compare it to established Datalog engines. Our results demonstrate competitive performance and speedups in the range of 1.4× to 12.5× compared to state-of-the-art systems for workloads of practical importance.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139382314","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}
引用次数: 0
Monotonicity and the Precision of Program Analysis 单调性与程序分析的精确性
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632897
Marco Campion, Mila Dalla Preda, R. Giacobazzi, Caterina Urban
It is widely known that the precision of a program analyzer is closely related to intensional program properties, namely, properties concerning how the program is written. This explains, for instance, the interest in code obfuscation techniques, namely, tools explicitly designed to degrade the results of program analysis by operating syntactic program transformations. Less is known about a possible relation between what the program extensionally computes, namely, its input-output relation, and the precision of a program analyzer. In this paper we explore this potential connection in an effort to isolate program fragments that can be precisely analyzed by abstract interpretation, namely, programs for which there exists a complete abstract interpretation. In the field of static inference of numeric invariants, this happens for programs, or parts of programs, that manifest a monotone (either non-decreasing or non-increasing) behavior. We first formalize the notion of program monotonicity with respect to a given input and a set of numerical variables of interest. A sound proof system is then introduced with judgments specifying whether a program is monotone relatively to a set of variables and a set of inputs. The interest in monotonicity is justified because we prove that the family of monotone programs admits a complete abstract interpretation over a specific class of non-trivial numerical abstractions and inputs. This class includes all non-relational abstract domains that refine interval analysis (i.e., at least as precise as the intervals abstraction) and that satisfy a topological convexity hypothesis.
众所周知,程序分析器的精度与程序的内维属性(即与程序编写方式有关的属性)密切相关。这也是代码混淆技术备受关注的原因,即通过对程序进行语法转换来降低程序分析结果的工具。关于程序扩展计算的内容(即其输入输出关系)与程序分析器的精度之间的可能关系,人们知之甚少。在本文中,我们探讨了这种潜在的联系,试图分离出可以通过抽象解释进行精确分析的程序片段,即存在完整抽象解释的程序。在数字不变式静态推理领域,这种情况发生在表现出单调(非递减或非递增)行为的程序或部分程序上。我们首先形式化了与给定输入和一组相关数值变量有关的程序单调性概念。然后,我们引入了一个完善的证明系统,通过判断来说明相对于一组变量和一组输入,程序是否具有单调性。我们之所以对单调性感兴趣,是因为我们证明了单调性程序族允许对一类特定的非三维数字抽象和输入进行完整的抽象解释。这一类包括所有非关系抽象域,它们完善了区间分析(即至少与区间抽象一样精确),并且满足拓扑凸性假设。
{"title":"Monotonicity and the Precision of Program Analysis","authors":"Marco Campion, Mila Dalla Preda, R. Giacobazzi, Caterina Urban","doi":"10.1145/3632897","DOIUrl":"https://doi.org/10.1145/3632897","url":null,"abstract":"It is widely known that the precision of a program analyzer is closely related to intensional program properties, namely, properties concerning how the program is written. This explains, for instance, the interest in code obfuscation techniques, namely, tools explicitly designed to degrade the results of program analysis by operating syntactic program transformations. Less is known about a possible relation between what the program extensionally computes, namely, its input-output relation, and the precision of a program analyzer. In this paper we explore this potential connection in an effort to isolate program fragments that can be precisely analyzed by abstract interpretation, namely, programs for which there exists a complete abstract interpretation. In the field of static inference of numeric invariants, this happens for programs, or parts of programs, that manifest a monotone (either non-decreasing or non-increasing) behavior. We first formalize the notion of program monotonicity with respect to a given input and a set of numerical variables of interest. A sound proof system is then introduced with judgments specifying whether a program is monotone relatively to a set of variables and a set of inputs. The interest in monotonicity is justified because we prove that the family of monotone programs admits a complete abstract interpretation over a specific class of non-trivial numerical abstractions and inputs. This class includes all non-relational abstract domains that refine interval analysis (i.e., at least as precise as the intervals abstraction) and that satisfy a topological convexity hypothesis.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139383427","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}
引用次数: 0
Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message Passing 无死锁分离逻辑:线性度带来依赖性高阶消息传递的进步
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632889
Jules Jacobs, Jonas Kastberg Hinrichsen, R. Krebbers
We introduce a linear concurrent separation logic, called LinearActris, designed to guarantee deadlock and leak freedom for message-passing concurrency. LinearActris combines the strengths of session types and concurrent separation logic, allowing for the verification of challenging higher-order programs with mutable state through dependent protocols. The key challenge is to prove the adequacy theorem of LinearActris, which says that the logic indeed gives deadlock and leak freedom “for free” from linearity. We prove this theorem by defining a step-indexed model of separation logic, based on connectivity graphs. To demonstrate the expressive power of LinearActris, we prove soundness of a higher-order (GV-style) session type system using the technique of logical relations. All our results and examples have been mechanized in Coq.
我们介绍了一种名为 LinearActris 的线性并发分离逻辑,旨在保证消息传递并发的死锁和泄漏自由。LinearActris 结合了会话类型和并发分离逻辑的优势,允许通过依赖协议验证具有可变状态的高阶程序。关键的挑战在于证明 LinearActris 的充分性定理,即该逻辑确实从线性中 "免费 "提供了死锁和泄漏自由。我们以连接图为基础,定义了分离逻辑的步进索引模型,从而证明了这一定理。为了证明 LinearActris 的表达能力,我们使用逻辑关系技术证明了高阶(GV 风格)会话类型系统的合理性。我们的所有结果和示例都已在 Coq 中机械化。
{"title":"Deadlock-Free Separation Logic: Linearity Yields Progress for Dependent Higher-Order Message Passing","authors":"Jules Jacobs, Jonas Kastberg Hinrichsen, R. Krebbers","doi":"10.1145/3632889","DOIUrl":"https://doi.org/10.1145/3632889","url":null,"abstract":"We introduce a linear concurrent separation logic, called LinearActris, designed to guarantee deadlock and leak freedom for message-passing concurrency. LinearActris combines the strengths of session types and concurrent separation logic, allowing for the verification of challenging higher-order programs with mutable state through dependent protocols. The key challenge is to prove the adequacy theorem of LinearActris, which says that the logic indeed gives deadlock and leak freedom “for free” from linearity. We prove this theorem by defining a step-indexed model of separation logic, based on connectivity graphs. To demonstrate the expressive power of LinearActris, we prove soundness of a higher-order (GV-style) session type system using the technique of logical relations. All our results and examples have been mechanized in Coq.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139384194","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}
引用次数: 0
A Universal, Sound, and Complete Forward Reasoning Technique for Machine-Verified Proofs of Linearizability 一种用于机器验证可线性化证明的通用、合理和完整的前向推理技术
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632924
Prasad Jayanti, S. Jayanti, Ugur Y. Yavuz, Lizzie Hernandez
We introduce simple, universal, sound, and complete proof methods for producing machine-verifiable proofs of linearizability and strong linearizability. Universality means that our method works for any object type; soundness means that an algorithm can be proved correct by our method only if it is linearizable (resp. strong linearizable); and completeness means that any linearizable (resp. strong linearizable) implementation can be proved so using our method. We demonstrate the simplicity and power of our method by producing proofs of linearizability for the Herlihy-Wing queue and Jayanti’s single-scanner snapshot, as well as a proof of strong linearizability of the Jayanti-Tarjan union-find object. All three of these proofs are machine-verified by TLAPS (the TLA+ Proof System).
我们介绍了简单、通用、完善和完整的证明方法,用于生成可线性化和强线性化的机器可验证证明。通用性是指我们的方法适用于任何对象类型;健全性是指算法只有在可线性化(或强线性化)的情况下才能用我们的方法证明其正确性;完备性是指任何可线性化(或强线性化)的实现都能用我们的方法证明其正确性。我们通过证明 Herlihy-Wing 队列和 Jayanti 单扫描器快照的可线性化,以及证明 Jayanti-Tarjan 联合查找对象的强可线性化,展示了我们方法的简单性和强大功能。所有这三个证明都经过了 TLAPS(TLA+ 证明系统)的机器验证。
{"title":"A Universal, Sound, and Complete Forward Reasoning Technique for Machine-Verified Proofs of Linearizability","authors":"Prasad Jayanti, S. Jayanti, Ugur Y. Yavuz, Lizzie Hernandez","doi":"10.1145/3632924","DOIUrl":"https://doi.org/10.1145/3632924","url":null,"abstract":"We introduce simple, universal, sound, and complete proof methods for producing machine-verifiable proofs of linearizability and strong linearizability. Universality means that our method works for any object type; soundness means that an algorithm can be proved correct by our method only if it is linearizable (resp. strong linearizable); and completeness means that any linearizable (resp. strong linearizable) implementation can be proved so using our method. We demonstrate the simplicity and power of our method by producing proofs of linearizability for the Herlihy-Wing queue and Jayanti’s single-scanner snapshot, as well as a proof of strong linearizability of the Jayanti-Tarjan union-find object. All three of these proofs are machine-verified by TLAPS (the TLA+ Proof System).","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139382815","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}
引用次数: 0
The Essence of Generalized Algebraic Data Types 广义代数数据类型的本质
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632866
Filip Sieczkowski, Sergei Stepanenko, Jonathan Sterling, L. Birkedal
This paper considers direct encodings of generalized algebraic data types (GADTs) in a minimal suitable lambda-calculus. To this end, we develop an extension of System Fω with recursive types and internalized type equalities with injective constant type constructors. We show how GADTs and associated pattern-matching constructs can be directly expressed in the calculus, thus showing that it may be treated as a highly idealized modern functional programming language. We prove that the internalized type equalities in conjunction with injectivity rules increase the expressive power of the calculus by establishing a non-macro-expressibility result in Fω, and prove the system type-sound via a syntactic argument. Finally, we build two relational models of our calculus: a simple, unary model that illustrates a novel, two-stage interpretation technique, necessary to account for the equational constraints; and a more sophisticated, binary model that relaxes the construction to allow, for the first time, formal reasoning about data-abstraction in a calculus equipped with GADTs.
本文探讨了在最小合适的λ演算法中对广义代数数据类型(GADT)进行直接编码的问题。为此,我们开发了一个具有递归类型和内部化类型等价性的系统 Fω 扩展,其中包含注入式常量类型构造函数。我们展示了如何在微积分中直接表达 GADT 和相关的模式匹配构造,从而证明它可以被视为高度理想化的现代函数式编程语言。我们通过在 Fω 中建立一个非宏可表达性结果,证明了内部化类型等价与注入性规则的结合提高了微积分的表达能力,并通过语法论证证明了系统的类型健全性。最后,我们为我们的微积分建立了两个关系模型:一个是简单的一元模型,它展示了一种新颖的两阶段解释技术,这是解释等式约束所必需的;另一个是更复杂的二元模型,它放宽了构造,首次允许在配备了GADT的微积分中对数据抽象进行形式推理。
{"title":"The Essence of Generalized Algebraic Data Types","authors":"Filip Sieczkowski, Sergei Stepanenko, Jonathan Sterling, L. Birkedal","doi":"10.1145/3632866","DOIUrl":"https://doi.org/10.1145/3632866","url":null,"abstract":"This paper considers direct encodings of generalized algebraic data types (GADTs) in a minimal suitable lambda-calculus. To this end, we develop an extension of System Fω with recursive types and internalized type equalities with injective constant type constructors. We show how GADTs and associated pattern-matching constructs can be directly expressed in the calculus, thus showing that it may be treated as a highly idealized modern functional programming language. We prove that the internalized type equalities in conjunction with injectivity rules increase the expressive power of the calculus by establishing a non-macro-expressibility result in Fω, and prove the system type-sound via a syntactic argument. Finally, we build two relational models of our calculus: a simple, unary model that illustrates a novel, two-stage interpretation technique, necessary to account for the equational constraints; and a more sophisticated, binary model that relaxes the construction to allow, for the first time, formal reasoning about data-abstraction in a calculus equipped with GADTs.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139381027","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}
引用次数: 0
Positive Almost-Sure Termination: Complexity and Proof Rules 正几乎确定终止:复杂性与证明规则
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632879
Rupak Majumdar, V. R. Sathiyanarayana
We study the recursion-theoretic complexity of Positive Almost-Sure Termination (PAST) in an imperative programming language with rational variables, bounded nondeterministic choice, and discrete probabilistic choice. A program terminates positive almost-surely if, for every scheduler, the program terminates almost-surely and the expected runtime to termination is finite. We show that PAST for our language is complete for the (lightface) co-analytic sets (Π11-complete). This is in contrast to the related notions of Almost-Sure Termination (AST) and Bounded Termination (BAST), both of which are arithmetical (Π20- and Σ20-complete respectively). Our upper bound implies an effective procedure to reduce reasoning about probabilistic termination to non-probabilistic fair termination in a model with bounded nondeterminism, and to simple program termination in models with unbounded nondeterminism. Our lower bound shows the opposite: for every program with unbounded nondeterministic choice, there is an effectively computable probabilistic program with bounded choice such that the original program is terminating if, and only if, the transformed program is PAST. We show that every program has an effectively computable normal form, in which each probabilistic choice either continues or terminates execution immediately, each with probability 1/2. For normal form programs, we provide a sound and complete proof rule for PAST. Our proof rule uses transfinite ordinals. We show that reasoning about PAST requires transfinite ordinals up to ω1CK; thus, existing techniques for probabilistic termination based on ranking supermartingales that map program states to reals do not suffice to reason about PAST.
我们研究了具有理性变量、有界非确定性选择和离散概率选择的命令式编程语言中 "几乎肯定终止"(PAST)的递归理论复杂性。如果对每个调度程序来说,程序都能几乎肯定地终止,并且终止的预期运行时间是有限的,那么程序就能几乎肯定地终止。我们证明,我们语言的 PAST 对于(光面)共分析集是完整的(Π11-complete)。这与相关的 "几乎确定终止"(AST)和 "有界终止"(BAST)概念截然不同,这两个概念都是算术性的(分别为 Π20- 和 Σ20-完备)。我们的上界意味着一种有效的程序,可以在有界非确定性模型中将概率终止推理简化为非概率公平终止,在无界非确定性模型中将概率终止推理简化为简单程序终止。而我们的下界却恰恰相反:对于每一个具有无界非确定性选择的程序,都存在一个具有有界选择的可有效计算的概率程序,当且仅当转换后的程序是 PAST 时,原始程序是终止的。我们证明,每个程序都有一个可有效计算的正常形式,其中每个概率选择要么继续执行,要么立即终止执行,每个概率为 1/2。对于正常形式程序,我们提供了一个完善的 PAST 证明规则。我们的证明规则使用无穷序。我们证明,推理 PAST 需要ω1CK以内的无穷序数;因此,基于将程序状态映射为实数的排序超马列的现有概率终止技术不足以推理 PAST。
{"title":"Positive Almost-Sure Termination: Complexity and Proof Rules","authors":"Rupak Majumdar, V. R. Sathiyanarayana","doi":"10.1145/3632879","DOIUrl":"https://doi.org/10.1145/3632879","url":null,"abstract":"We study the recursion-theoretic complexity of Positive Almost-Sure Termination (PAST) in an imperative programming language with rational variables, bounded nondeterministic choice, and discrete probabilistic choice. A program terminates positive almost-surely if, for every scheduler, the program terminates almost-surely and the expected runtime to termination is finite. We show that PAST for our language is complete for the (lightface) co-analytic sets (Π11-complete). This is in contrast to the related notions of Almost-Sure Termination (AST) and Bounded Termination (BAST), both of which are arithmetical (Π20- and Σ20-complete respectively). Our upper bound implies an effective procedure to reduce reasoning about probabilistic termination to non-probabilistic fair termination in a model with bounded nondeterminism, and to simple program termination in models with unbounded nondeterminism. Our lower bound shows the opposite: for every program with unbounded nondeterministic choice, there is an effectively computable probabilistic program with bounded choice such that the original program is terminating if, and only if, the transformed program is PAST. We show that every program has an effectively computable normal form, in which each probabilistic choice either continues or terminates execution immediately, each with probability 1/2. For normal form programs, we provide a sound and complete proof rule for PAST. Our proof rule uses transfinite ordinals. We show that reasoning about PAST requires transfinite ordinals up to ω1CK; thus, existing techniques for probabilistic termination based on ranking supermartingales that map program states to reals do not suffice to reason about PAST.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139382074","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}
引用次数: 0
Disentanglement with Futures, State, and Interaction 与未来、国家和互动的脱节
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632895
Jatin Arora, Stefan K. Muller, Umut A. Acar
Recent work has proposed a memory property for parallel programs, called disentanglement, and showed that it is pervasive in a variety of programs, written in different languages, ranging from C/C++ to Parallel ML, and showed that it can be exploited to improve the performance of parallel functional programs. All existing work on disentanglement, however, considers the "fork/join" model for parallelism and does not apply to "futures", the more powerful approach to parallelism. This is not surprising: fork/join parallel programs exhibit a reasonably strict dependency structure (e.g., series-parallel DAGs), which disentanglement exploits. In contrast, with futures, parallel computations become first-class values of the language, and thus can be created, and passed between functions calls or stored in memory, just like other ordinary values, resulting in complex dependency structures, especially in the presence of mutable state. For example, parallel programs with futures can have deadlocks, which is impossible with fork-join parallelism. In this paper, we are interested in the theoretical question of whether disentanglement may be extended beyond fork/join parallelism, and specifically to futures. We consider a functional language with futures, Input/Output (I/O), and mutable state (references) and show that a broad range of programs written in this language are disentangled. We start by formalizing disentanglement for futures and proving that purely functional programs written in this language are disentangled. We then generalize this result in three directions. First, we consider state (effects) and prove that stateful programs are disentangled if they are race free. Second, we show that race freedom is sufficient but not a necessary condition and non-deterministic programs, e.g. those that use atomic read-modify-operations and some non-deterministic combinators, may also be disentangled. Third, we prove that disentangled task-parallel programs written with futures are free of deadlocks, which arise due to interactions between state and the rich dependencies that can be expressed with futures. Taken together, these results show that disentanglement generalizes to parallel programs with futures and, thus, the benefits of disentanglement may go well beyond fork-join parallelism.
最近的研究提出了一种并行程序的内存特性,称为 "不纠缠"(disentanglement),并表明这种特性普遍存在于用不同语言(从 C/C++ 到并行 ML)编写的各种程序中,还表明可以利用这种特性来提高并行函数式程序的性能。然而,所有现有的反纠缠工作都考虑了并行性的 "fork/join "模型,并不适用于 "期货 "这种更强大的并行性方法。这并不奇怪:fork/join 并行程序表现出相当严格的依赖结构(如串并行 DAG),而反纠缠正是利用了这种结构。与此相反,有了期货,并行计算就成了语言的一等值,因此可以像其他普通值一样被创建、在函数调用之间传递或存储在内存中,从而产生复杂的依赖结构,尤其是在存在可变状态的情况下。例如,带有期货的并行程序可能会出现死锁,而叉连接并行则不可能出现死锁。在本文中,我们感兴趣的理论问题是,反纠缠是否可以扩展到 fork/join 并行之外,特别是期货。我们考虑了一种具有期货、输入/输出(I/O)和可变状态(引用)的函数式语言,并证明了用这种语言编写的大量程序都是互不干涉的。我们首先将期货的解缠形式化,并证明用这种语言编写的纯函数式程序是解缠的。然后,我们从三个方向推广这一结果。首先,我们考虑了状态(效应),并证明如果有状态的程序是无竞赛的,那么它们是可以解缠的。其次,我们证明种族自由是充分条件,但不是必要条件,非确定性程序,例如那些使用原子读取-修改-操作和一些非确定性组合器的程序,也可能被分解。第三,我们证明了用期货编写的分离任务并行程序不会出现死锁,死锁的产生是由于状态与期货所能表达的丰富依赖关系之间的相互作用。总之,这些结果表明,分解泛化到使用期货的并行程序,因此,分解的好处可能远远超出叉连接并行性。
{"title":"Disentanglement with Futures, State, and Interaction","authors":"Jatin Arora, Stefan K. Muller, Umut A. Acar","doi":"10.1145/3632895","DOIUrl":"https://doi.org/10.1145/3632895","url":null,"abstract":"Recent work has proposed a memory property for parallel programs, called disentanglement, and showed that it is pervasive in a variety of programs, written in different languages, ranging from C/C++ to Parallel ML, and showed that it can be exploited to improve the performance of parallel functional programs. All existing work on disentanglement, however, considers the \"fork/join\" model for parallelism and does not apply to \"futures\", the more powerful approach to parallelism. This is not surprising: fork/join parallel programs exhibit a reasonably strict dependency structure (e.g., series-parallel DAGs), which disentanglement exploits. In contrast, with futures, parallel computations become first-class values of the language, and thus can be created, and passed between functions calls or stored in memory, just like other ordinary values, resulting in complex dependency structures, especially in the presence of mutable state. For example, parallel programs with futures can have deadlocks, which is impossible with fork-join parallelism. In this paper, we are interested in the theoretical question of whether disentanglement may be extended beyond fork/join parallelism, and specifically to futures. We consider a functional language with futures, Input/Output (I/O), and mutable state (references) and show that a broad range of programs written in this language are disentangled. We start by formalizing disentanglement for futures and proving that purely functional programs written in this language are disentangled. We then generalize this result in three directions. First, we consider state (effects) and prove that stateful programs are disentangled if they are race free. Second, we show that race freedom is sufficient but not a necessary condition and non-deterministic programs, e.g. those that use atomic read-modify-operations and some non-deterministic combinators, may also be disentangled. Third, we prove that disentangled task-parallel programs written with futures are free of deadlocks, which arise due to interactions between state and the rich dependencies that can be expressed with futures. Taken together, these results show that disentanglement generalizes to parallel programs with futures and, thus, the benefits of disentanglement may go well beyond fork-join parallelism.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139382217","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}
引用次数: 0
A Formalization of Core Why3 in Coq 核心 Why3 在 Coq 中的形式化
IF 1.8 Q1 Engineering Pub Date : 2024-01-05 DOI: 10.1145/3632902
Joshua M. Cohen, Philip Johnson-Freyd
Intermediate verification languages like Why3 and Boogie have made it much easier to build program verifiers, transforming the process into a logic compilation problem rather than a proof automation one. Why3 in particular implements a rich logic for program specification with polymorphism, algebraic data types, recursive functions and predicates, and inductive predicates; it translates this logic to over a dozen solvers and proof assistants. Accordingly, it serves as a backend for many tools, including Frama-C, EasyCrypt, and GNATProve for Ada SPARK. But how can we be sure that these tools are correct? The alternate foundational approach, taken by tools like VST and CakeML, provides strong guarantees by implementing the entire toolchain in a proof assistant, but these tools are harder to build and cannot directly take advantage of SMT solver automation. As a first step toward enabling automated tools with similar foundational guarantees, we give a formal semantics in Coq for the logic fragment of Why3. We show that our semantics are useful by giving a correct-by-construction natural deduction proof system for this logic, using this proof system to verify parts of Why3's standard library, and proving sound two of Why3's transformations used to convert terms and formulas into the simpler logics supported by the backend solvers.
Why3和Boogie等中间验证语言使构建程序验证器变得更加容易,将这一过程转化为逻辑编译问题,而不是证明自动化问题。Why3 尤其为程序规范实现了丰富的逻辑,包括多态性、代数数据类型、递归函数和谓词以及归纳谓词。因此,它是许多工具的后台,包括 Frama-C、EasyCrypt 和用于 Ada SPARK 的 GNATProve。但是,我们如何确保这些工具是正确的呢?VST 和 CakeML 等工具采用了另一种基础方法,通过在证明助手中实现整个工具链来提供强有力的保证,但这些工具更难构建,而且无法直接利用 SMT 求解器自动化的优势。作为实现具有类似基础保证的自动化工具的第一步,我们用 Coq 给出了 Why3 逻辑片段的形式化语义。我们给出了该逻辑的正确构造自然演绎证明系统,使用该证明系统验证了 Why3 标准库的部分内容,并证明了 Why3 用于将术语和公式转换为后端求解器所支持的更简单逻辑的两种转换是正确的,从而证明了我们的语义是有用的。
{"title":"A Formalization of Core Why3 in Coq","authors":"Joshua M. Cohen, Philip Johnson-Freyd","doi":"10.1145/3632902","DOIUrl":"https://doi.org/10.1145/3632902","url":null,"abstract":"Intermediate verification languages like Why3 and Boogie have made it much easier to build program verifiers, transforming the process into a logic compilation problem rather than a proof automation one. Why3 in particular implements a rich logic for program specification with polymorphism, algebraic data types, recursive functions and predicates, and inductive predicates; it translates this logic to over a dozen solvers and proof assistants. Accordingly, it serves as a backend for many tools, including Frama-C, EasyCrypt, and GNATProve for Ada SPARK. But how can we be sure that these tools are correct? The alternate foundational approach, taken by tools like VST and CakeML, provides strong guarantees by implementing the entire toolchain in a proof assistant, but these tools are harder to build and cannot directly take advantage of SMT solver automation. As a first step toward enabling automated tools with similar foundational guarantees, we give a formal semantics in Coq for the logic fragment of Why3. We show that our semantics are useful by giving a correct-by-construction natural deduction proof system for this logic, using this proof system to verify parts of Why3's standard library, and proving sound two of Why3's transformations used to convert terms and formulas into the simpler logics supported by the backend solvers.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":null,"pages":null},"PeriodicalIF":1.8,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139383003","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}
引用次数: 1
期刊
Proceedings of the ACM on 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