首页 > 最新文献

Proceedings of the ACM on Programming Languages最新文献

英文 中文
Spirea: A Mechanized Concurrent Separation Logic for Weak Persistent Memory 用于弱持久内存的机械化并发分离逻辑
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622820
Simon Friis Vindum, Lars Birkedal
Weak persistent memory (a.k.a. non-volatile memory) is an emerging technology that offers fast byte-addressable durable main memory. A wealth of algorithms and libraries has been developed to explore this exciting technology. As noted by others, this has led to a significant verification gap. Towards closing this gap, we present Spirea, the first concurrent separation logic for verification of programs under a weak persistent memory model. Spirea is based on the Iris and Perennial verification frameworks, and by combining features from these logics with novel techniques it supports high-level modular reasoning about crash-safe and thread-safe programs and libraries. Spirea is fully mechanized in the Coq proof assistant and allows for interactive development of proofs with the Iris Proof Mode. We use Spirea to verify several challenging examples with modular specifications. We show how our logic can verify thread-safety and crash-safety of non-blocking durable data structures with null-recovery, in particular the Treiber stack and the Michael-Scott queue adapted to persistent memory. This is the first time durable data structures have been verified with a program logic.
弱持久存储器(又称非易失性存储器)是一种新兴的技术,它提供了快速的字节寻址持久主存储器。已经开发了大量的算法和库来探索这一令人兴奋的技术。正如其他人所指出的那样,这导致了重大的核查差距。为了缩小这一差距,我们提出了Spirea,这是第一个在弱持久内存模型下验证程序的并发分离逻辑。Spirea基于Iris和Perennial验证框架,通过将这些逻辑的特性与新颖的技术相结合,它支持关于崩溃安全和线程安全的程序和库的高级模块化推理。Spirea在Coq证明助手中完全机械化,并允许与虹膜证明模式交互开发证明。我们使用Spirea验证了几个具有模块化规范的具有挑战性的示例。我们将展示我们的逻辑如何通过null恢复来验证非阻塞持久数据结构的线程安全性和崩溃安全性,特别是适用于持久内存的Treiber堆栈和Michael-Scott队列。这是第一次用程序逻辑验证持久数据结构。
{"title":"Spirea: A Mechanized Concurrent Separation Logic for Weak Persistent Memory","authors":"Simon Friis Vindum, Lars Birkedal","doi":"10.1145/3622820","DOIUrl":"https://doi.org/10.1145/3622820","url":null,"abstract":"Weak persistent memory (a.k.a. non-volatile memory) is an emerging technology that offers fast byte-addressable durable main memory. A wealth of algorithms and libraries has been developed to explore this exciting technology. As noted by others, this has led to a significant verification gap. Towards closing this gap, we present Spirea, the first concurrent separation logic for verification of programs under a weak persistent memory model. Spirea is based on the Iris and Perennial verification frameworks, and by combining features from these logics with novel techniques it supports high-level modular reasoning about crash-safe and thread-safe programs and libraries. Spirea is fully mechanized in the Coq proof assistant and allows for interactive development of proofs with the Iris Proof Mode. We use Spirea to verify several challenging examples with modular specifications. We show how our logic can verify thread-safety and crash-safety of non-blocking durable data structures with null-recovery, in particular the Treiber stack and the Michael-Scott queue adapted to persistent memory. This is the first time durable data structures have been verified with a program logic.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136115199","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
Mechanizing Session-Types using a Structural View: Enforcing Linearity without Linearity 使用结构视图机械化会话类型:在没有线性的情况下强制线性
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622810
Chuta Sano, Ryan Kavanagh, Brigitte Pientka
Session types employ a linear type system that ensures that communication channels cannot be implicitly copied or discarded. As a result, many mechanizations of these systems require modeling channel contexts and carefully ensuring that they treat channels linearly. We demonstrate a technique that localizes linearity conditions as additional predicates embedded within type judgments, which allows us to use structural typing contexts instead of linear ones. This technique is especially relevant when leveraging (weak) higher-order abstract syntax to handle channel mobility and the intricate binding structures that arise in session-typed systems. Following this approach, we mechanize a session-typed system based on classical linear logic and its type preservation proof in the proof assistant Beluga, which uses the logical framework LF as its encoding language. We also prove adequacy for our encoding. This shows the tractability and effectiveness of our approach in modelling substructural systems such as session-typed languages.
会话类型采用线性类型系统,确保通信通道不会被隐式复制或丢弃。因此,这些系统的许多机械化都需要对通道上下文进行建模,并仔细确保它们对通道进行线性处理。我们演示了一种技术,该技术将线性条件定位为嵌入类型判断中的附加谓词,这允许我们使用结构类型上下文而不是线性类型上下文。当利用(弱)高阶抽象语法来处理会话类型系统中出现的通道移动性和复杂的绑定结构时,这种技术尤其重要。根据这种方法,我们在证明助手Beluga中机械化了一个基于经典线性逻辑及其类型保存证明的会话类型系统,该系统使用逻辑框架LF作为其编码语言。我们还证明了编码的充分性。这显示了我们的方法在模拟子结构系统(如会话类型语言)方面的可跟踪性和有效性。
{"title":"Mechanizing Session-Types using a Structural View: Enforcing Linearity without Linearity","authors":"Chuta Sano, Ryan Kavanagh, Brigitte Pientka","doi":"10.1145/3622810","DOIUrl":"https://doi.org/10.1145/3622810","url":null,"abstract":"Session types employ a linear type system that ensures that communication channels cannot be implicitly copied or discarded. As a result, many mechanizations of these systems require modeling channel contexts and carefully ensuring that they treat channels linearly. We demonstrate a technique that localizes linearity conditions as additional predicates embedded within type judgments, which allows us to use structural typing contexts instead of linear ones. This technique is especially relevant when leveraging (weak) higher-order abstract syntax to handle channel mobility and the intricate binding structures that arise in session-typed systems. Following this approach, we mechanize a session-typed system based on classical linear logic and its type preservation proof in the proof assistant Beluga, which uses the logical framework LF as its encoding language. We also prove adequacy for our encoding. This shows the tractability and effectiveness of our approach in modelling substructural systems such as session-typed languages.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"27 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136115395","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
Simple Reference Immutability for System F <: 系统F的简单引用不变性:
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622828
Edward Lee, Ondřej Lhoták
Reference immutability is a type based technique for taming mutation that has long been studied in the context of object-oriented languages, like Java. Recently, though, languages like Scala have blurred the lines between functional programming languages and object oriented programming languages. We explore how reference immutability interacts with features commonly found in these hybrid languages, in particular with higher-order functions – polymorphism – and subtyping. We construct a calculus System F<:M which encodes a reference immutability system as a simple extension of System F<: and prove that it satisfies the standard soundness and immutability safety properties.
引用不变性是一种基于类型的技术,用于驯服突变,这种技术在面向对象语言(如Java)的上下文中已经研究了很长时间。但是最近,像Scala这样的语言模糊了函数式编程语言和面向对象编程语言之间的界限。我们将探讨引用不变性如何与这些混合语言中常见的特性交互,特别是与高阶函数(多态性)和子类型交互。构造了一个微积分系统F< M,该系统编码了一个参考不变性系统作为系统F< M的简单扩展,并证明了它满足标准稳健性和不变性安全性质。
{"title":"Simple Reference Immutability for System F <sub>&lt;:</sub>","authors":"Edward Lee, Ondřej Lhoták","doi":"10.1145/3622828","DOIUrl":"https://doi.org/10.1145/3622828","url":null,"abstract":"Reference immutability is a type based technique for taming mutation that has long been studied in the context of object-oriented languages, like Java. Recently, though, languages like Scala have blurred the lines between functional programming languages and object oriented programming languages. We explore how reference immutability interacts with features commonly found in these hybrid languages, in particular with higher-order functions – polymorphism – and subtyping. We construct a calculus System F<:M which encodes a reference immutability system as a simple extension of System F<: and prove that it satisfies the standard soundness and immutability safety properties.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"150 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136115977","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
Formal Abstractions for Packet Scheduling 包调度的形式化抽象
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622845
Anshuman Mohan, Yunhe Liu, Nate Foster, Tobias Kappé, Dexter Kozen
Early programming models for software-defined networking (SDN) focused on basic features for controlling network-wide forwarding paths, but more recent work has considered richer features, such as packet scheduling and queueing, that affect performance. In particular, PIFO trees , proposed by Sivaraman et al., offer a flexible and efficient primitive for programmable packet scheduling. Prior work has shown that PIFO trees can express a wide range of practical algorithms including strict priority, weighted fair queueing, and hierarchical schemes. However, the semantic properties of PIFO trees are not well understood. This paper studies PIFO trees from a programming language perspective. We formalize the syntax and semantics of PIFO trees in an operational model that decouples the scheduling policy running on a tree from the topology of the tree. Building on this formalization, we develop compilation algorithms that allow the behavior of a PIFO tree written against one topology to be realized using a tree with a different topology. Such a compiler could be used to optimize an implementation of PIFO trees, or realize a logical PIFO tree on a target with a fixed topology baked into the hardware. To support experimentation, we develop a software simulator for PIFO trees, and we present case studies illustrating its behavior on standard and custom algorithms.
软件定义网络(SDN)的早期编程模型侧重于控制全网转发路径的基本功能,但最近的工作考虑了影响性能的更丰富的功能,如数据包调度和排队。特别是由Sivaraman等人提出的PIFO树,为可编程分组调度提供了灵活高效的原语。先前的研究表明,PIFO树可以表达广泛的实用算法,包括严格优先级,加权公平排队和分层方案。然而,PIFO树的语义特性还没有被很好地理解。本文从编程语言的角度研究PIFO树。我们在一个操作模型中形式化了PIFO树的语法和语义,该模型将运行在树上的调度策略与树的拓扑解耦。在此形式化的基础上,我们开发了编译算法,允许使用具有不同拓扑的树来实现针对一种拓扑编写的PIFO树的行为。这样的编译器可用于优化PIFO树的实现,或者在具有固定拓扑结构的目标上实现逻辑PIFO树。为了支持实验,我们开发了一个PIFO树的软件模拟器,并给出了案例研究,说明了它在标准和自定义算法上的行为。
{"title":"Formal Abstractions for Packet Scheduling","authors":"Anshuman Mohan, Yunhe Liu, Nate Foster, Tobias Kappé, Dexter Kozen","doi":"10.1145/3622845","DOIUrl":"https://doi.org/10.1145/3622845","url":null,"abstract":"Early programming models for software-defined networking (SDN) focused on basic features for controlling network-wide forwarding paths, but more recent work has considered richer features, such as packet scheduling and queueing, that affect performance. In particular, PIFO trees , proposed by Sivaraman et al., offer a flexible and efficient primitive for programmable packet scheduling. Prior work has shown that PIFO trees can express a wide range of practical algorithms including strict priority, weighted fair queueing, and hierarchical schemes. However, the semantic properties of PIFO trees are not well understood. This paper studies PIFO trees from a programming language perspective. We formalize the syntax and semantics of PIFO trees in an operational model that decouples the scheduling policy running on a tree from the topology of the tree. Building on this formalization, we develop compilation algorithms that allow the behavior of a PIFO tree written against one topology to be realized using a tree with a different topology. Such a compiler could be used to optimize an implementation of PIFO trees, or realize a logical PIFO tree on a target with a fixed topology baked into the hardware. To support experimentation, we develop a software simulator for PIFO trees, and we present case studies illustrating its behavior on standard and custom algorithms.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"75 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136112410","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
Inference of Resource Management Specifications 资源管理规范的推理
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622858
Narges Shadab, Pritam Gharat, Shrey Tiwari, Michael D. Ernst, Martin Kellogg, Shuvendu K. Lahiri, Akash Lal, Manu Sridharan
A resource leak occurs when a program fails to free some finite resource after it is no longer needed. Such leaks are a significant cause of real-world crashes and performance problems. Recent work proposed an approach to prevent resource leaks based on checking resource management specifications. A resource management specification expresses how the program allocates resources, passes them around, and releases them; it also tracks the ownership relationship between objects and resources, and aliasing relationships between objects. While this specify-and-verify approach has several advantages compared to prior techniques, the need to manually write annotations presents a significant barrier to its practical adoption. This paper presents a novel technique to automatically infer a resource management specification for a program, broadening the applicability of specify-and-check verification for resource leaks. Inference in this domain is challenging because resource management specifications differ significantly in nature from the types that most inference techniques target. Further, for practical effectiveness, we desire a technique that can infer the resource management specification intended by the developer, even in cases when the code does not fully adhere to that specification. We address these challenges through a set of inference rules carefully designed to capture real-world coding patterns, yielding an effective fixed-point-based inference algorithm. We have implemented our inference algorithm in two different systems, targeting programs written in Java and C#. In an experimental evaluation, our technique inferred 85.5% of the annotations that programmers had written manually for the benchmarks. Further, the verifier issued nearly the same rate of false alarms with the manually-written and automatically-inferred annotations.
当程序无法释放不再需要的有限资源时,就会发生资源泄漏。这种泄漏是导致现实世界崩溃和性能问题的重要原因。最近的工作提出了一种基于检查资源管理规范来防止资源泄漏的方法。资源管理规范表达了程序如何分配资源、传递资源和释放资源;它还跟踪对象和资源之间的所有权关系,以及对象之间的混叠关系。虽然与以前的技术相比,这种指定并验证的方法有几个优点,但手工编写注释的需要对其实际采用构成了重大障碍。本文提出了一种自动推断程序资源管理规范的新技术,扩大了规范-检查验证对资源泄漏的适用性。这个领域的推理是具有挑战性的,因为资源管理规范在本质上与大多数推理技术所针对的类型有很大的不同。此外,为了实际的有效性,我们需要一种能够推断开发人员所期望的资源管理规范的技术,即使在代码没有完全遵循该规范的情况下也是如此。我们通过一组精心设计的推理规则来解决这些挑战,这些规则旨在捕获现实世界的编码模式,从而产生有效的基于定点的推理算法。我们在两个不同的系统中实现了我们的推理算法,目标是用Java和c#编写的程序。在一次实验评估中,我们的技术推断出85.5%的注释是程序员为基准手动编写的。此外,验证者使用手动编写和自动推断的注释发出的假警报率几乎相同。
{"title":"Inference of Resource Management Specifications","authors":"Narges Shadab, Pritam Gharat, Shrey Tiwari, Michael D. Ernst, Martin Kellogg, Shuvendu K. Lahiri, Akash Lal, Manu Sridharan","doi":"10.1145/3622858","DOIUrl":"https://doi.org/10.1145/3622858","url":null,"abstract":"A resource leak occurs when a program fails to free some finite resource after it is no longer needed. Such leaks are a significant cause of real-world crashes and performance problems. Recent work proposed an approach to prevent resource leaks based on checking resource management specifications. A resource management specification expresses how the program allocates resources, passes them around, and releases them; it also tracks the ownership relationship between objects and resources, and aliasing relationships between objects. While this specify-and-verify approach has several advantages compared to prior techniques, the need to manually write annotations presents a significant barrier to its practical adoption. This paper presents a novel technique to automatically infer a resource management specification for a program, broadening the applicability of specify-and-check verification for resource leaks. Inference in this domain is challenging because resource management specifications differ significantly in nature from the types that most inference techniques target. Further, for practical effectiveness, we desire a technique that can infer the resource management specification intended by the developer, even in cases when the code does not fully adhere to that specification. We address these challenges through a set of inference rules carefully designed to capture real-world coding patterns, yielding an effective fixed-point-based inference algorithm. We have implemented our inference algorithm in two different systems, targeting programs written in Java and C#. In an experimental evaluation, our technique inferred 85.5% of the annotations that programmers had written manually for the benchmarks. Further, the verifier issued nearly the same rate of false alarms with the manually-written and automatically-inferred annotations.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"36 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136112414","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
Data Extraction via Semantic Regular Expression Synthesis 基于语义正则表达式合成的数据提取
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622863
Qiaochu Chen, Arko Banerjee, Çağatay Demiralp, Greg Durrett, Işıl Dillig
Many data extraction tasks of practical relevance require not only syntactic pattern matching but also semantic reasoning about the content of the underlying text. While regular expressions are very well suited for tasks that require only syntactic pattern matching, they fall short for data extraction tasks that involve both a syntactic and semantic component. To address this issue, we introduce semantic regexes, a generalization of regular expressions that facilitates combined syntactic and semantic reasoning about textual data. We also propose a novel learning algorithm that can synthesize semantic regexes from a small number of positive and negative examples. Our proposed learning algorithm uses a combination of neural sketch generation and compositional type-directed synthesis for fast and effective generalization from a small number of examples. We have implemented these ideas in a new tool called Smore and evaluated it on representative data extraction tasks involving several textual datasets. Our evaluation shows that semantic regexes can better support complex data extraction tasks than standard regular expressions and that our learning algorithm significantly outperforms existing tools, including state-of-the-art neural networks and program synthesis tools.
许多实际相关的数据提取任务不仅需要语法模式匹配,还需要对底层文本的内容进行语义推理。虽然正则表达式非常适合只需要语法模式匹配的任务,但对于同时涉及语法和语义组件的数据提取任务来说,它们就显得有些不足了。为了解决这个问题,我们引入了语义正则表达式,这是正则表达式的一种泛化,有助于对文本数据进行语法和语义推理的结合。我们还提出了一种新的学习算法,可以从少量的正反例中合成语义正则。我们提出的学习算法使用神经草图生成和组合类型导向合成相结合的方法,从少量示例中快速有效地泛化。我们在一个名为Smore的新工具中实现了这些想法,并在涉及多个文本数据集的代表性数据提取任务上对其进行了评估。我们的评估表明,与标准正则表达式相比,语义正则表达式可以更好地支持复杂的数据提取任务,并且我们的学习算法明显优于现有的工具,包括最先进的神经网络和程序合成工具。
{"title":"Data Extraction via Semantic Regular Expression Synthesis","authors":"Qiaochu Chen, Arko Banerjee, Çağatay Demiralp, Greg Durrett, Işıl Dillig","doi":"10.1145/3622863","DOIUrl":"https://doi.org/10.1145/3622863","url":null,"abstract":"Many data extraction tasks of practical relevance require not only syntactic pattern matching but also semantic reasoning about the content of the underlying text. While regular expressions are very well suited for tasks that require only syntactic pattern matching, they fall short for data extraction tasks that involve both a syntactic and semantic component. To address this issue, we introduce semantic regexes, a generalization of regular expressions that facilitates combined syntactic and semantic reasoning about textual data. We also propose a novel learning algorithm that can synthesize semantic regexes from a small number of positive and negative examples. Our proposed learning algorithm uses a combination of neural sketch generation and compositional type-directed synthesis for fast and effective generalization from a small number of examples. We have implemented these ideas in a new tool called Smore and evaluated it on representative data extraction tasks involving several textual datasets. Our evaluation shows that semantic regexes can better support complex data extraction tasks than standard regular expressions and that our learning algorithm significantly outperforms existing tools, including state-of-the-art neural networks and program synthesis tools.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"77 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136112534","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}
引用次数: 2
Inductive Program Synthesis Guided by Observational Program Similarity 以观察性节目相似度为指导的归纳性节目综合
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622830
Jack Feser, Işıl Dillig, Armando Solar-Lezama
We present a new general-purpose synthesis technique for generating programs from input-output examples. Our method, called metric program synthesis, relaxes the observational equivalence idea (used widely in bottom-up enumerative synthesis) into a weaker notion of observational similarity, with the goal of reducing the search space that the synthesizer needs to explore. Our method clusters programs into equivalence classes based on an expert-provided distance metric and constructs a version space that compactly represents “approximately correct” programs. Then, given a “close enough” program sampled from this version space, our approach uses a distance-guided repair algorithm to find a program that exactly matches the given input-output examples. We have implemented our proposed metric program synthesis technique in a tool called SyMetric and evaluate it in three different domains considered in prior work. Our evaluation shows that SyMetric outperforms other domain-agnostic synthesizers that use observational equivalence and that it achieves results competitive with domain-specific synthesizers that are either designed for or trained on those domains.
我们提出了一种新的通用综合技术,用于从输入输出示例生成程序。我们的方法,称为度量程序综合,将观测等效思想(在自下而上的枚举综合中广泛使用)放宽为一个较弱的观测相似性概念,目的是减少综合器需要探索的搜索空间。我们的方法基于专家提供的距离度量将程序聚类到等价类中,并构建一个紧凑地表示“近似正确”程序的版本空间。然后,给定从该版本空间中采样的“足够接近”的程序,我们的方法使用距离引导修复算法来找到与给定输入输出示例完全匹配的程序。我们已经在一个名为SyMetric的工具中实现了我们提出的度量程序合成技术,并在先前工作中考虑的三个不同领域中对其进行了评估。我们的评估表明,SyMetric优于其他使用观察等效的领域不可知合成器,并且它获得的结果与为这些领域设计或在这些领域上训练的领域特定合成器竞争。
{"title":"Inductive Program Synthesis Guided by Observational Program Similarity","authors":"Jack Feser, Işıl Dillig, Armando Solar-Lezama","doi":"10.1145/3622830","DOIUrl":"https://doi.org/10.1145/3622830","url":null,"abstract":"We present a new general-purpose synthesis technique for generating programs from input-output examples. Our method, called metric program synthesis, relaxes the observational equivalence idea (used widely in bottom-up enumerative synthesis) into a weaker notion of observational similarity, with the goal of reducing the search space that the synthesizer needs to explore. Our method clusters programs into equivalence classes based on an expert-provided distance metric and constructs a version space that compactly represents “approximately correct” programs. Then, given a “close enough” program sampled from this version space, our approach uses a distance-guided repair algorithm to find a program that exactly matches the given input-output examples. We have implemented our proposed metric program synthesis technique in a tool called SyMetric and evaluate it in three different domains considered in prior work. Our evaluation shows that SyMetric outperforms other domain-agnostic synthesizers that use observational equivalence and that it achieves results competitive with domain-specific synthesizers that are either designed for or trained on those domains.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"36 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136112809","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
AtomiS: Data-Centric Synchronization Made Practical AtomiS:以数据为中心的同步实现
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622801
Hervé Paulino, Ana Almeida Matos, Jan Cederquist, Marco Giunti, João Matos, António Ravara
Data-Centric Synchronization (DCS) shifts the reasoning about concurrency restrictions from control structures to data declaration. It is a high-level declarative approach that abstracts away from the actual concurrency control mechanism(s) in use. Despite its advantages, the practical use of DCS is hindered by the fact that it may require many annotations and/or multiple implementations of the same method to cope with differently qualified parameters. To overcome these limitations, in this paper we present AtomiS, a new DCS approach that requires only qualifying types of parameters and return values in interface definitions, and of fields in class definitions. The latter may also be abstracted away in type parameters, rendering class implementations virtually annotation-free. From this high level specification, a static analysis infers the atomicity constraints that are local to each method, considering valid only the method variants that are consistent with the specification, and performs code generation for all valid variants of each method. The generated code is then the target for automatic injection of concurrency control primitives that are responsible for ensuring the absence of data-races, atomicity-violations and deadlocks. We provide a Java implementation and showcase the applicability of AtomiS in real-life code. For the benchmarks analysed, AtomiS requires fewer annotations than the original number of regions requiring locks, as well as fewer annotations than Atomic Sets (a reference DCS proposal).
以数据为中心的同步(DCS)将关于并发限制的推理从控制结构转移到数据声明。它是一种高级声明性方法,从正在使用的实际并发控制机制中抽象出来。尽管DCS有很多优点,但它的实际使用受到了阻碍,因为它可能需要许多注释和/或同一方法的多个实现来处理不同的限定参数。为了克服这些限制,本文提出了AtomiS,这是一种新的DCS方法,它只需要接口定义中的参数和返回值以及类定义中的字段的限定类型。后者也可以在类型参数中抽象出来,使类实现几乎没有注释。从这个高级规范中,静态分析推断出每个方法的局部原子性约束,只考虑与规范一致的方法变体,并为每个方法的所有有效变体执行代码生成。生成的代码是自动注入并发控制原语的目标,这些原语负责确保没有数据竞争、原子性冲突和死锁。我们提供了一个Java实现,并展示了AtomiS在实际代码中的适用性。对于所分析的基准测试,AtomiS所需的注释少于需要锁的原始区域数量,也少于Atomic Sets(参考DCS建议)所需的注释。
{"title":"AtomiS: Data-Centric Synchronization Made Practical","authors":"Hervé Paulino, Ana Almeida Matos, Jan Cederquist, Marco Giunti, João Matos, António Ravara","doi":"10.1145/3622801","DOIUrl":"https://doi.org/10.1145/3622801","url":null,"abstract":"Data-Centric Synchronization (DCS) shifts the reasoning about concurrency restrictions from control structures to data declaration. It is a high-level declarative approach that abstracts away from the actual concurrency control mechanism(s) in use. Despite its advantages, the practical use of DCS is hindered by the fact that it may require many annotations and/or multiple implementations of the same method to cope with differently qualified parameters. To overcome these limitations, in this paper we present AtomiS, a new DCS approach that requires only qualifying types of parameters and return values in interface definitions, and of fields in class definitions. The latter may also be abstracted away in type parameters, rendering class implementations virtually annotation-free. From this high level specification, a static analysis infers the atomicity constraints that are local to each method, considering valid only the method variants that are consistent with the specification, and performs code generation for all valid variants of each method. The generated code is then the target for automatic injection of concurrency control primitives that are responsible for ensuring the absence of data-races, atomicity-violations and deadlocks. We provide a Java implementation and showcase the applicability of AtomiS in real-life code. For the benchmarks analysed, AtomiS requires fewer annotations than the original number of regions requiring locks, as well as fewer annotations than Atomic Sets (a reference DCS proposal).","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"1 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136115034","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
Counterexample Driven Quantifier Instantiations with Applications to Distributed Protocols 分布式协议应用的反例驱动量词实例化
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622864
Orr Tamir, Marcelo Taube, Kenneth L. McMillan, Sharon Shoham, Jon Howell, Guy Gueta, Mooly Sagiv
Formally verifying infinite-state systems can be a daunting task, especially when it comes to reasoning about quantifiers. In particular, quantifier alternations in conjunction with function symbols can create function cycles that result in infinitely many ground terms, making it difficult for solvers to instantiate quantifiers and causing them to diverge. This can leave users with no useful information on how to proceed. To address this issue, we propose an interactive verification methodology that uses a relational abstraction technique to mitigate solver divergence in the presence of quantifiers. This technique abstracts functions in the verification conditions (VCs) as one-to-one relations, which avoids the creation of function cycles and the resulting proliferation of ground terms. Relational abstraction is sound and guarantees correctness if the solver cannot find counter-models. However, it may also lead to false counterexamples, which can be addressed by refining the abstraction and requiring the existence of corresponding elements. In the domain of distributed protocols, we can refine the abstraction by diagnosing counterexamples and manually instantiating elements in the range of the original function. If the verification conditions are correct, there always exist finitely many refinement steps that eliminate all spurious counter-models, making the approach complete. We applied this approach in Ivy to verify the safety properties of consensus protocols and found that: (1) most verification goals can be automatically verified using relational abstraction, while SMT solvers often diverge when given the original VC, (2) only a few manual instantiations were needed, and the counterexamples provided valuable guidance for the user compared to timeouts produced by the traditional approach, and (3) the technique can be used to derive efficient low-level implementations of tricky algorithms.
正式验证无限状态系统可能是一项艰巨的任务,特别是在涉及量词推理时。特别是,量词与函数符号的交替可以创建函数循环,导致无限多的基本项,使求解者难以实例化量词并导致它们发散。这可能会让用户没有关于如何继续的有用信息。为了解决这个问题,我们提出了一种交互式验证方法,该方法使用关系抽象技术来减轻存在量词时求解器的分歧。该技术将验证条件(VCs)中的函数抽象为一对一关系,从而避免了函数循环的创建和由此产生的基项的扩散。关系抽象是合理的,如果求解器找不到反模型,它可以保证正确性。然而,它也可能导致错误的反例,这可以通过细化抽象并要求存在相应的元素来解决。在分布式协议领域,我们可以通过诊断反例和手动实例化原始功能范围内的元素来改进抽象。如果验证条件是正确的,总是存在有限的细化步骤来消除所有虚假的反模型,使方法完整。我们在Ivy中应用了这种方法来验证共识协议的安全属性,发现:(1)大多数验证目标可以使用关系抽象自动验证,而SMT求解器在给定原始VC时经常出现偏差;(2)只需要少量的手动实例化,与传统方法产生的超时相比,反例为用户提供了有价值的指导;(3)该技术可用于派生复杂算法的高效底层实现。
{"title":"Counterexample Driven Quantifier Instantiations with Applications to Distributed Protocols","authors":"Orr Tamir, Marcelo Taube, Kenneth L. McMillan, Sharon Shoham, Jon Howell, Guy Gueta, Mooly Sagiv","doi":"10.1145/3622864","DOIUrl":"https://doi.org/10.1145/3622864","url":null,"abstract":"Formally verifying infinite-state systems can be a daunting task, especially when it comes to reasoning about quantifiers. In particular, quantifier alternations in conjunction with function symbols can create function cycles that result in infinitely many ground terms, making it difficult for solvers to instantiate quantifiers and causing them to diverge. This can leave users with no useful information on how to proceed. To address this issue, we propose an interactive verification methodology that uses a relational abstraction technique to mitigate solver divergence in the presence of quantifiers. This technique abstracts functions in the verification conditions (VCs) as one-to-one relations, which avoids the creation of function cycles and the resulting proliferation of ground terms. Relational abstraction is sound and guarantees correctness if the solver cannot find counter-models. However, it may also lead to false counterexamples, which can be addressed by refining the abstraction and requiring the existence of corresponding elements. In the domain of distributed protocols, we can refine the abstraction by diagnosing counterexamples and manually instantiating elements in the range of the original function. If the verification conditions are correct, there always exist finitely many refinement steps that eliminate all spurious counter-models, making the approach complete. We applied this approach in Ivy to verify the safety properties of consensus protocols and found that: (1) most verification goals can be automatically verified using relational abstraction, while SMT solvers often diverge when given the original VC, (2) only a few manual instantiations were needed, and the counterexamples provided valuable guidance for the user compared to timeouts produced by the traditional approach, and (3) the technique can be used to derive efficient low-level implementations of tricky algorithms.","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"17 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136115049","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 Grounded Conceptual Model for Ownership Types in Rust Rust中所有权类型的基础概念模型
Q2 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2023-10-16 DOI: 10.1145/3622841
Crichton, Will, Gray, Gavin, Krishnamurthi, Shriram
Programmers learning Rust struggle to understand ownership types, Rust’s core mechanism for ensuring memory safety without garbage collection. This paper describes our attempt to systematically design a pedagogy for ownership types. First, we studied Rust developers’ misconceptions of ownership to create the Ownership Inventory, a new instrument for measuring a person’s knowledge of ownership. We found that Rust learners could not connect Rust’s static and dynamic semantics, such as determining why an ill-typed program would (or would not) exhibit undefined behavior. Second, we created a conceptual model of Rust’s semantics that explains borrow checking in terms of flow-sensitive permissions on paths into memory. Third, we implemented a Rust compiler plugin that visualizes programs under the model. Fourth, we integrated the permissions model and visualizations into a broader pedagogy of ownership by writing a new ownership chapter for The Rust Programming Language , a popular Rust textbook. Fifth, we evaluated an initial deployment of our pedagogy against the original version, using reader responses to the Ownership Inventory as a point of comparison. Thus far, the new pedagogy has improved learner scores on the Ownership Inventory by an average of 9
学习Rust的程序员很难理解所有权类型,这是Rust在没有垃圾收集的情况下确保内存安全的核心机制。本文描述了我们系统设计所有权类型教学法的尝试。首先,我们研究了Rust开发人员对所有权的误解,以创建所有权清单,这是一种衡量个人所有权知识的新工具。我们发现Rust学习者不能连接Rust的静态和动态语义,比如确定为什么一个病态的程序会(或不会)表现出未定义的行为。其次,我们创建了一个Rust语义的概念模型,该模型根据进入内存的路径上的流敏感权限来解释借用检查。第三,我们实现了一个Rust编译器插件,它可以将模型下的程序可视化。第四,我们通过为流行的Rust教科书《Rust编程语言》编写新的所有权章节,将权限模型和可视化集成到更广泛的所有权教学法中。第五,我们利用读者对所有权清单的反应作为比较点,评估了我们的教学法与原始版本的初始部署。到目前为止,新的教学方法已经使学习者在“所有权清单”上的得分平均提高了9分
{"title":"A Grounded Conceptual Model for Ownership Types in Rust","authors":"Crichton, Will, Gray, Gavin, Krishnamurthi, Shriram","doi":"10.1145/3622841","DOIUrl":"https://doi.org/10.1145/3622841","url":null,"abstract":"Programmers learning Rust struggle to understand ownership types, Rust’s core mechanism for ensuring memory safety without garbage collection. This paper describes our attempt to systematically design a pedagogy for ownership types. First, we studied Rust developers’ misconceptions of ownership to create the Ownership Inventory, a new instrument for measuring a person’s knowledge of ownership. We found that Rust learners could not connect Rust’s static and dynamic semantics, such as determining why an ill-typed program would (or would not) exhibit undefined behavior. Second, we created a conceptual model of Rust’s semantics that explains borrow checking in terms of flow-sensitive permissions on paths into memory. Third, we implemented a Rust compiler plugin that visualizes programs under the model. Fourth, we integrated the permissions model and visualizations into a broader pedagogy of ownership by writing a new ownership chapter for The Rust Programming Language , a popular Rust textbook. Fifth, we evaluated an initial deployment of our pedagogy against the original version, using reader responses to the Ownership Inventory as a point of comparison. Thus far, the new pedagogy has improved learner scores on the Ownership Inventory by an average of 9","PeriodicalId":20697,"journal":{"name":"Proceedings of the ACM on Programming Languages","volume":"279 1","pages":"0"},"PeriodicalIF":0.0,"publicationDate":"2023-10-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"136077381","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
期刊
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学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1