首页 > 最新文献

ACM Transactions on Programming Languages and Systems最新文献

英文 中文
CHAD: Combinatory Homomorphic Automatic Differentiation CHAD:组合同态自动微分
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-08-17 DOI: https://dl.acm.org/doi/10.1145/3527634
Matthijs Vákár, Tom Smeding

We introduce Combinatory Homomorphic Automatic Differentiation (CHAD), a principled, pure, provably correct define-then-run method for performing forward and reverse mode automatic differentiation (AD) on programming languages with expressive features. It implements AD as a compositional, type-respecting source-code transformation that generates purely functional code. This code transformation is principled in the sense that it is the unique homomorphic (structure preserving) extension to expressive languages of Elliott’s well-known and unambiguous definitions of AD for a first-order functional language. Correctness of the method follows by a (compositional) logical relations argument that shows that the semantics of the syntactic derivative is the usual calculus derivative of the semantics of the original program.

In their most elegant formulation, the transformations generate code with linear types. However, the code transformations can be implemented in a standard functional language lacking linear types: While the correctness proof requires tracking of linearity, the actual transformations do not. In fact, even in a standard functional language, we can get all of the type-safety that linear types give us: We can implement all linear types used to type the transformations as abstract types by using a basic module system.

In this article, we detail the method when applied to a simple higher-order language for manipulating statically sized arrays. However, we explain how the methodology applies, more generally, to functional languages with other expressive features. Finally, we discuss how the scope of CHAD extends beyond applications in AD to other dynamic program analyses that accumulate data in a commutative monoid.

本文介绍了组合同态自动微分(CHAD),这是一种原则性的、纯粹的、可证明正确的先定义后运行方法,用于对具有表达特征的编程语言执行正向和反向模式自动微分(AD)。它将AD实现为一个组合的、尊重类型的源代码转换,生成纯功能代码。这种代码转换在某种意义上是原则性的,因为它是艾略特对一阶函数语言的AD的著名和明确定义的唯一同态(保持结构)扩展到表达语言。方法的正确性之后是一个(组合)逻辑关系参数,该参数表明句法导数的语义是原始程序语义的通常演算导数。在它们最优雅的表述中,转换生成具有线性类型的代码。然而,代码转换可以在缺乏线性类型的标准函数式语言中实现:虽然正确性证明需要跟踪线性,但实际的转换不需要。事实上,即使在标准的函数式语言中,我们也可以获得线性类型提供的所有类型安全:通过使用基本模块系统,我们可以将用于将转换类型转换为抽象类型的所有线性类型实现。在本文中,我们将详细介绍该方法在用于操作静态大小数组的简单高阶语言中的应用。然而,我们解释了该方法如何更普遍地应用于具有其他表达特性的函数式语言。最后,我们讨论了CHAD的范围如何从AD中的应用扩展到在交换单群中积累数据的其他动态程序分析。
{"title":"CHAD: Combinatory Homomorphic Automatic Differentiation","authors":"Matthijs Vákár, Tom Smeding","doi":"https://dl.acm.org/doi/10.1145/3527634","DOIUrl":"https://doi.org/https://dl.acm.org/doi/10.1145/3527634","url":null,"abstract":"<p>We introduce Combinatory Homomorphic Automatic Differentiation (CHAD), a principled, pure, provably correct define-then-run method for performing forward and reverse mode automatic differentiation (AD) on programming languages with expressive features. It implements AD as a compositional, type-respecting source-code transformation that generates purely functional code. This code transformation is principled in the sense that it is the unique homomorphic (structure preserving) extension to expressive languages of Elliott’s well-known and unambiguous definitions of AD for a first-order functional language. Correctness of the method follows by a (compositional) logical relations argument that shows that the semantics of the syntactic derivative is the usual calculus derivative of the semantics of the original program.</p><p>In their most elegant formulation, the transformations generate code with linear types. However, the code transformations can be implemented in a standard functional language lacking linear types: While the correctness proof requires tracking of linearity, the actual transformations do not. In fact, even in a standard functional language, we can get all of the type-safety that linear types give us: We can implement all linear types used to type the transformations as abstract types by using a basic module system.</p><p>In this article, we detail the method when applied to a simple higher-order language for manipulating statically sized arrays. However, we explain how the methodology applies, more generally, to functional languages with other expressive features. Finally, we discuss how the scope of CHAD extends beyond applications in AD to other dynamic program analyses that accumulate data in a commutative monoid.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"81 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-08-17","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531569","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
A Type Discipline for Message Passing Parallel Programs 消息传递并行程序的类型规则
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-08-10 DOI: 10.1145/3552519
V. Vasconcelos, F. Martins, Hugo A. López, N. Yoshida
We present ParTypes, a type discipline for parallel programs. The model we have in mind comprises a fixed number of processes running in parallel and communicating via collective operations or point-to-point synchronous message exchanges. A type describes a protocol to be followed by each processes in a given program. We present the type theory, a core imperative programming language and its operational semantics, and prove that type checking is decidable (up to decidability of semantic entailment) and that well-typed programs do not deadlock and always terminate. The article is accompanied by a large number of examples drawn from the literature on parallel programming.
我们介绍ParTypes,一种用于并行程序的类型规则。我们心目中的模型包括固定数量的进程,这些进程并行运行,并通过集体操作或点对点同步消息交换进行通信。类型描述了给定程序中每个进程要遵循的协议。我们提出了核心命令式编程语言类型理论及其操作语义,并证明了类型检查是可判定的(直到语义蕴涵的可判定性),并且良好类型的程序不会死锁并且总是终止。这篇文章附有大量从并行编程文献中提取的例子。
{"title":"A Type Discipline for Message Passing Parallel Programs","authors":"V. Vasconcelos, F. Martins, Hugo A. López, N. Yoshida","doi":"10.1145/3552519","DOIUrl":"https://doi.org/10.1145/3552519","url":null,"abstract":"We present ParTypes, a type discipline for parallel programs. The model we have in mind comprises a fixed number of processes running in parallel and communicating via collective operations or point-to-point synchronous message exchanges. A type describes a protocol to be followed by each processes in a given program. We present the type theory, a core imperative programming language and its operational semantics, and prove that type checking is decidable (up to decidability of semantic entailment) and that well-typed programs do not deadlock and always terminate. The article is accompanied by a large number of examples drawn from the literature on parallel programming.","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"44 1","pages":"1 - 55"},"PeriodicalIF":1.3,"publicationDate":"2022-08-10","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48994494","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 3
Nested Session Types 嵌套会话类型
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-07-15 DOI: https://dl.acm.org/doi/full/10.1145/3539656
Ankush Das, Henry Deyoung, Andreia Mordido, Frank Pfenning

Session types statically describe communication protocols between concurrent message-passing processes. Unfortunately, parametric polymorphism even in its restricted prenex form is not fully understood in the context of session types. In this article, we present the metatheory of session types extended with prenex polymorphism and, as a result, nested recursive datatypes. Remarkably, we prove that type equality is decidable by exhibiting a reduction to trace equivalence of deterministic first-order grammars. Recognizing the high theoretical complexity of the latter, we also propose a novel type equality algorithm and prove its soundness. We observe that the algorithm is surprisingly efficient and, despite its incompleteness, sufficient for all our examples. We have implemented our ideas by extending the Rast programming language with nested session types. We conclude with several examples illustrating the expressivity of our enhanced type system.

会话类型静态地描述并发消息传递进程之间的通信协议。不幸的是,在会话类型的上下文中,即使在其受限的前缀形式下,参数多态性也不能完全理解。在本文中,我们介绍了使用前缀多态性扩展会话类型的元理论,并因此介绍了嵌套递归数据类型。值得注意的是,我们通过展示对确定性一阶语法的跟踪等价的还原来证明类型相等是可决定的。鉴于后者的理论复杂度较高,本文提出了一种新的类型相等算法,并证明了其正确性。我们观察到,该算法的效率惊人,尽管它不完整,但对于我们所有的例子来说都是足够的。我们通过使用嵌套会话类型扩展Rast编程语言来实现我们的想法。最后,我们用几个例子来说明我们增强的类型系统的表现力。
{"title":"Nested Session Types","authors":"Ankush Das, Henry Deyoung, Andreia Mordido, Frank Pfenning","doi":"https://dl.acm.org/doi/full/10.1145/3539656","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3539656","url":null,"abstract":"<p>Session types statically describe communication protocols between concurrent message-passing processes. Unfortunately, parametric polymorphism even in its restricted prenex form is not fully understood in the context of session types. In this article, we present the metatheory of session types extended with prenex polymorphism and, as a result, nested recursive datatypes. Remarkably, we prove that type equality is decidable by exhibiting a reduction to trace equivalence of deterministic first-order grammars. Recognizing the high theoretical complexity of the latter, we also propose a novel type equality algorithm and prove its soundness. We observe that the algorithm is surprisingly efficient and, despite its incompleteness, sufficient for all our examples. We have implemented our ideas by extending the Rast programming language with nested session types. We conclude with several examples illustrating the expressivity of our enhanced type system.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"1 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138542085","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Session Coalgebras: A Coalgebraic View on Regular and Context-free Session Types 会话协代数:正则和上下文无关会话类型的协代数视图
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-07-15 DOI: https://dl.acm.org/doi/full/10.1145/3527633
Alex C. Keizer, Henning Basold, Jorge A. Pérez

Compositional methods are central to the verification of software systems. For concurrent and communicating systems, compositional techniques based on behavioural type systems have received much attention. By abstracting communication protocols as types, these type systems can statically check that channels in a program interact following a certain protocol—whether messages are exchanged in the intended order.

In this article, we put on our coalgebraic spectacles to investigate session types, a widely studied class of behavioural type systems. We provide a syntax-free description of session-based concurrency as states of coalgebras. As a result, we rediscover type equivalence, duality, and subtyping relations in terms of canonical coinductive presentations. In turn, this coinductive presentation enables us to derive a decidable type system with subtyping for the π-calculus, in which the states of a coalgebra will serve as channel protocols. Going full circle, we exhibit a coalgebra structure on an existing session type system, and show that the relations and type system resulting from our coalgebraic perspective coincide with existing ones. We further apply to session coalgebras the coalgebraic approach to regular languages via the so-called rational fixed point, inspired by the trinity of automata, regular languages, and regular expressions with session coalgebras, rational fixed point, and session types, respectively. We establish a suitable restriction on session coalgebras that determines a similar trinity, and reveals the mismatch between usual session types and our syntax-free coalgebraic approach. Furthermore, we extend our coalgebraic approach to account for context-free session types, by equipping session coalgebras with a stack.

组合方法是软件系统验证的核心。对于并发和通信系统,基于行为类型系统的组合技术受到了广泛关注。通过将通信协议抽象为类型,这些类型系统可以静态地检查程序中的通道是否按照某种协议进行交互——消息是否按照预期的顺序进行交换。在本文中,我们戴上共代数的眼镜来研究会话类型,这是一种被广泛研究的行为类型系统。我们将基于会话的并发性作为协代数的状态提供无语法描述。结果,我们在正则共归纳表示中重新发现了类型等价、对偶性和子类型关系。反过来,这种共归纳表示使我们能够推导出π微积分的具有子类型的可决定类型系统,其中协代数的状态将作为信道协议。我们在一个现有的会话类型系统上展示了一个协代数结构,并表明从我们的协代数角度得到的关系和类型系统与现有的一致。我们进一步通过所谓的有理不动点将正则语言的协代数方法应用于会话协代数,灵感来自于分别具有会话协代数、有理不动点和会话类型的自动机、正则语言和正则表达式的三位一体。我们在会话共代数上建立了一个合适的限制,确定了一个类似的三位一体,并揭示了通常会话类型和我们的无语法共代数方法之间的不匹配。此外,我们扩展了我们的协代数方法,通过为会话协代数配备堆栈来考虑与上下文无关的会话类型。
{"title":"Session Coalgebras: A Coalgebraic View on Regular and Context-free Session Types","authors":"Alex C. Keizer, Henning Basold, Jorge A. Pérez","doi":"https://dl.acm.org/doi/full/10.1145/3527633","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3527633","url":null,"abstract":"<p>Compositional methods are central to the verification of software systems. For concurrent and communicating systems, compositional techniques based on <i>behavioural type systems</i> have received much attention. By abstracting communication protocols as types, these type systems can statically check that channels in a program interact following a certain protocol—whether messages are exchanged in the intended order.</p><p>In this article, we put on our coalgebraic spectacles to investigate <i>session types</i>, a widely studied class of behavioural type systems. We provide a syntax-free description of session-based concurrency as states of coalgebras. As a result, we rediscover type equivalence, duality, and subtyping relations in terms of canonical coinductive presentations. In turn, this coinductive presentation enables us to derive a decidable type system with subtyping for the π-calculus, in which the states of a coalgebra will serve as channel protocols. Going full circle, we exhibit a coalgebra structure on an existing session type system, and show that the relations and type system resulting from our coalgebraic perspective coincide with existing ones. We further apply to session coalgebras the coalgebraic approach to regular languages via the so-called rational fixed point, inspired by the trinity of automata, regular languages, and regular expressions with session coalgebras, rational fixed point, and session types, respectively. We establish a suitable restriction on session coalgebras that determines a similar trinity, and reveals the mismatch between usual session types and our syntax-free coalgebraic approach. Furthermore, we extend our coalgebraic approach to account for <i>context-free</i> session types, by equipping session coalgebras with a stack.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"28 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531544","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
For a Few Dollars More: Verified Fine-Grained Algorithm Analysis Down to LLVM 多花几美元:验证细粒度算法分析到LLVM
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-07-15 DOI: https://dl.acm.org/doi/full/10.1145/3486169
Maximilian P. L. Haslbeck, Peter Lammich

We present a framework to verify both, functional correctness and (amortized) worst-case complexity of practically efficient algorithms. We implemented a stepwise refinement approach, using the novel concept of resource currencies to naturally structure the resource analysis along the refinement chain, and allow a fine-grained analysis of operation counts. Our framework targets the LLVM intermediate representation. We extend its semantics from earlier work with a cost model. As case studies, we verify the amortized constant time push operation on dynamic arrays and the O(nlog n) introsort algorithm, and refine them down to efficient LLVM implementations. Our sorting algorithm performs on par with the state-of-the-art implementation found in the GNU C++ Library, and provably satisfies the complexity required by the C++ standard.

我们提出了一个框架来验证实际有效算法的功能正确性和(平摊)最坏情况复杂度。我们实现了一种逐步改进的方法,使用资源货币的新概念,沿着改进链自然地构建资源分析,并允许对操作计数进行细粒度分析。我们的框架以LLVM中间表示为目标。我们用成本模型从早期工作中扩展了它的语义。作为案例研究,我们验证了动态数组上的平摊常数时间推操作和O(nlog n)内向排序算法,并将它们细化为高效的LLVM实现。我们的排序算法的性能与GNU c++库中最先进的实现相当,并且可以证明满足c++标准所要求的复杂性。
{"title":"For a Few Dollars More: Verified Fine-Grained Algorithm Analysis Down to LLVM","authors":"Maximilian P. L. Haslbeck, Peter Lammich","doi":"https://dl.acm.org/doi/full/10.1145/3486169","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3486169","url":null,"abstract":"<p>We present a framework to verify both, functional correctness and (amortized) worst-case complexity of practically efficient algorithms. We implemented a stepwise refinement approach, using the novel concept of <i>resource currencies</i> to naturally structure the resource analysis along the refinement chain, and allow a fine-grained analysis of operation counts. Our framework targets the LLVM intermediate representation. We extend its semantics from earlier work with a cost model. As case studies, we verify the amortized constant time push operation on dynamic arrays and the <i>O</i>(<i>n</i>log <i>n</i>) introsort algorithm, and refine them down to efficient LLVM implementations. Our sorting algorithm performs on par with the state-of-the-art implementation found in the GNU C++ Library, and provably satisfies the complexity required by the C++ standard.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"38 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531567","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Types for Complexity of Parallel Computation in Pi-calculus pi -微积分中并行计算复杂度的类型
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-07-15 DOI: https://dl.acm.org/doi/full/10.1145/3495529
Patrick Baillot, Alexis Ghyselen

Type systems as a technique to analyse or control programs have been extensively studied for functional programming languages. In particular, some systems allow one to extract from a typing derivation a complexity bound on the program. We explore how to extend such results to parallel complexity in the setting of pi-calculus, considered as a communication-based model for parallel computation. Two notions of time complexity are given: the total computation time without parallelism (the work) and the computation time under maximal parallelism (the span). We define operational semantics to capture those two notions and present two type systems from which one can extract a complexity bound on a process. The type systems are inspired both by sized types and by input/output types, with additional temporal information about communications.

类型系统作为一种分析或控制程序的技术,在函数式编程语言中得到了广泛的研究。特别是,有些系统允许从类型派生中提取程序的复杂性界限。我们探讨了如何将这些结果扩展到pi微积分的并行复杂性,pi微积分被认为是并行计算的一种基于通信的模型。给出了时间复杂度的两个概念:不并行的总计算时间(功)和最大并行下的计算时间(跨度)。我们定义了操作语义来捕获这两个概念,并提供了两种类型系统,人们可以从中提取流程的复杂性界限。类型系统的灵感来自大小类型和输入/输出类型,以及关于通信的额外临时信息。
{"title":"Types for Complexity of Parallel Computation in Pi-calculus","authors":"Patrick Baillot, Alexis Ghyselen","doi":"https://dl.acm.org/doi/full/10.1145/3495529","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3495529","url":null,"abstract":"<p>Type systems as a technique to analyse or control programs have been extensively studied for functional programming languages. In particular, some systems allow one to extract from a typing derivation a complexity bound on the program. We explore how to extend such results to parallel complexity in the setting of pi-calculus, considered as a communication-based model for parallel computation. Two notions of time complexity are given: the total computation time without parallelism (the work) and the computation time under maximal parallelism (the span). We define operational semantics to capture those two notions and present two type systems from which one can extract a complexity bound on a process. The type systems are inspired both by sized types and by input/output types, with additional temporal information about communications.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"39 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531570","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Strong-separation Logic 严格分离的逻辑
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-07-15 DOI: https://dl.acm.org/doi/full/10.1145/3498847
Jens Pagel, Florian Zuleger

Most automated verifiers for separation logic are based on the symbolic-heap fragment, which disallows both the magic-wand operator and the application of classical Boolean operators to spatial formulas. This is not surprising, as support for the magic wand quickly leads to undecidability, especially when combined with inductive predicates for reasoning about data structures. To circumvent these undecidability results, we propose assigning a more restrictive semantics to the separating conjunction. We argue that the resulting logic, strong-separation logic, can be used for symbolic execution and abductive reasoning just like “standard” separation logic, while remaining decidable even in the presence of both the magic wand and inductive predicates (we consider a list-segment predicate and a tree predicate)—a combination of features that leads to undecidability for the standard semantics.

大多数分离逻辑的自动验证器都基于符号堆片段,这既不允许魔术棒操作符,也不允许将经典布尔操作符应用于空间公式。这并不奇怪,因为对魔术棒的支持很快就会导致不可判定性,特别是当与归纳谓词结合使用用于对数据结构进行推理时。为了避免这些不可判定的结果,我们建议为分离连接赋予更严格的语义。我们认为,由此产生的逻辑,即强分离逻辑,可以像“标准”分离逻辑一样用于符号执行和溯因推理,同时即使在魔术棒和归纳谓词(我们考虑一个列表段谓词和一个树谓词)都存在的情况下仍然是可判定的——这是导致标准语义不可判定的特征组合。
{"title":"Strong-separation Logic","authors":"Jens Pagel, Florian Zuleger","doi":"https://dl.acm.org/doi/full/10.1145/3498847","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3498847","url":null,"abstract":"<p>Most automated verifiers for separation logic are based on the symbolic-heap fragment, which disallows both the magic-wand operator and the application of classical Boolean operators to spatial formulas. This is not surprising, as support for the magic wand quickly leads to undecidability, especially when combined with inductive predicates for reasoning about data structures. To circumvent these undecidability results, we propose assigning a more restrictive semantics to the separating conjunction. We argue that the resulting logic, strong-separation logic, can be used for symbolic execution and abductive reasoning just like “standard” separation logic, while remaining decidable even in the presence of both the magic wand and inductive predicates (we consider a list-segment predicate and a tree predicate)—a combination of features that leads to undecidability for the standard semantics.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"16 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531568","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Runtime Complexity Bounds Using Squeezers 使用挤压器的运行时复杂度界限
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-07-15 DOI: https://dl.acm.org/doi/full/10.1145/3527632
Oren Ish-Shalom, Shachar Itzhaky, Noam Rinetzky, Sharon Shoham

Determining upper bounds on the time complexity of a program is a fundamental problem with a variety of applications, such as performance debugging, resource certification, and compile-time optimizations. Automated techniques for cost analysis excel at bounding the resource complexity of programs that use integer values and linear arithmetic. Unfortunately, they fall short when the complexity depends more intricately on the evolution of data during execution. In such cases, state-of-the-art analyzers have shown to produce loose bounds, or even no bound at all.

We propose a novel technique that generalizes the common notion of recurrence relations based on ranking functions. Existing methods usually unfold one loop iteration and examine the resulting arithmetic relations between variables. These relations assist in establishing a recurrence that bounds the number of loop iterations. We propose a different approach, where we derive recurrences by comparing whole traces with whole traces of a lower rank, avoiding the need to analyze the complexity of intermediate states. We offer a set of global properties, defined with respect to whole traces, that facilitate such a comparison and show that these properties can be checked efficiently using a handful of local conditions. To this end, we adapt state squeezers, an induction mechanism previously used for verifying safety properties. We demonstrate that this technique encompasses the reasoning power of bounded unfolding, and more. We present some seemingly innocuous, yet intricate, examples that previous tools based on cost relations and control flow analysis fail to solve, and that our squeezer-powered approach succeeds.

确定程序时间复杂度的上限是各种应用程序的基本问题,例如性能调试、资源认证和编译时优化。成本分析的自动化技术擅长限制使用整数值和线性算法的程序的资源复杂性。不幸的是,当复杂性更复杂地依赖于执行期间数据的演变时,它们就会失效。在这种情况下,最先进的分析已经显示出产生松散的界限,甚至根本没有界限。我们提出了一种基于排序函数的递归关系的新技术。现有的方法通常展开一个循环迭代,并检查变量之间的算术关系。这些关系有助于建立循环迭代次数的循环。我们提出了一种不同的方法,我们通过比较整个轨迹与较低秩的整个轨迹来推导递归,避免了分析中间状态的复杂性。我们提供了一组全局属性,这些属性是根据整个轨迹定义的,它们有助于进行这种比较,并表明可以使用少量局部条件有效地检查这些属性。为此,我们采用了状态挤压器,这是一种以前用于验证安全性能的感应机制。我们证明了这种技术包含有界展开的推理能力,以及更多。我们提出了一些看似无害,但复杂的例子,这些例子是以前基于成本关系和控制流分析的工具无法解决的,而我们的挤压动力方法成功了。
{"title":"Runtime Complexity Bounds Using Squeezers","authors":"Oren Ish-Shalom, Shachar Itzhaky, Noam Rinetzky, Sharon Shoham","doi":"https://dl.acm.org/doi/full/10.1145/3527632","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3527632","url":null,"abstract":"<p>Determining upper bounds on the time complexity of a program is a fundamental problem with a variety of applications, such as performance debugging, resource certification, and compile-time optimizations. Automated techniques for cost analysis excel at bounding the resource complexity of programs that use integer values and linear arithmetic. Unfortunately, they fall short when the complexity depends more intricately on the evolution of data during execution. In such cases, state-of-the-art analyzers have shown to produce loose bounds, or even no bound at all.</p><p>We propose a novel technique that generalizes the common notion of recurrence relations based on ranking functions. Existing methods usually unfold one loop iteration and examine the resulting arithmetic relations between variables. These relations assist in establishing a recurrence that bounds the number of loop iterations. We propose a different approach, where we derive recurrences by comparing <i>whole traces</i> with <i>whole traces</i> of a lower rank, avoiding the need to analyze the complexity of intermediate states. We offer a set of global properties, defined with respect to whole traces, that facilitate such a comparison and show that these properties can be checked efficiently using a handful of local conditions. To this end, we adapt <i>state squeezers</i>, an induction mechanism previously used for verifying safety properties. We demonstrate that this technique encompasses the reasoning power of bounded unfolding, and more. We present some seemingly innocuous, yet intricate, examples that previous tools based on <i>cost relations</i> and control flow analysis fail to solve, and that our squeezer-powered approach succeeds.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"179 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-07-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531547","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Fast Graph Simplification for Interleaved-Dyck Reachability 交错堤岸可达性的快速图化简
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-05-27 DOI: https://dl.acm.org/doi/full/10.1145/3492428
Yuanbo Li, Qirun Zhang, Thomas Reps

Many program-analysis problems can be formulated as graph-reachability problems. Interleaved Dyck language reachability (InterDyck-reachability) is a fundamental framework to express a wide variety of program-analysis problems over edge-labeled graphs. The InterDyck language represents an intersection of multiple matched-parenthesis languages (i.e., Dyck languages). In practice, program analyses typically leverage one Dyck language to achieve context-sensitivity, and other Dyck languages to model data dependencies, such as field-sensitivity and pointer references/dereferences. In the ideal case, an InterDyck-reachability framework should model multiple Dyck languages simultaneously.

Unfortunately, precise InterDyck-reachability is undecidable. Any practical solution must over-approximate the exact answer. In the literature, a lot of work has been proposed to over-approximate the InterDyck-reachability formulation. This article offers a new perspective on improving both the precision and the scalability of InterDyck-reachability: we aim at simplifying the underlying input graph G. Our key insight is based on the observation that if an edge is not contributing to any InterDyck-paths, we can safely eliminate it from G. Our technique is orthogonal to the InterDyck-reachability formulation and can serve as a pre-processing step with any over-approximating approach for InterDyck-reachability. We have applied our graph simplification algorithm to pre-processing the graphs from a recent InterDyck-reachability-based taint analysis for Android. Our evaluation of three popular InterDyck-reachability algorithms yields promising results. In particular, our graph-simplification method improves both the scalability and precision of all three InterDyck-reachability algorithms, sometimes dramatically.

许多程序分析问题可以表述为图形可达性问题。交错Dyck语言可达性(interdyck -可达性)是一种基本框架,用于表达各种边标记图上的程序分析问题。InterDyck语言表示多种匹配括号语言(即Dyck语言)的交集。在实践中,程序分析通常利用一种Dyck语言来实现上下文敏感性,并利用其他Dyck语言来建模数据依赖性,例如字段敏感性和指针引用/解引用。在理想情况下,一个interdyck可达性框架应该同时对多种Dyck语言建模。不幸的是,准确的跨桥可达性是无法确定的。任何实际的解决方案都必须过于接近确切的答案。在文献中,已经提出了大量的工作,以过度逼近堤岸间可达性公式。本文提供了一个新的视角提高精度和可伸缩性InterDyck-reachability:我们旨在简化底层输入图g .关键的见解是基于这样的观察:如果没有导致任何InterDyck-paths优势,我们可以安全地从g .消除技术是正交InterDyck-reachability配方,可以作为预处理步骤与任何over-approximating InterDyck-reachability方法。我们已经将我们的图形简化算法用于预处理最近基于interdyck可达性的Android污染分析的图形。我们对三种流行的dyck可达性算法的评估产生了有希望的结果。特别是,我们的图简化方法提高了所有三种interdyck可达性算法的可伸缩性和精度,有时甚至是显著的。
{"title":"Fast Graph Simplification for Interleaved-Dyck Reachability","authors":"Yuanbo Li, Qirun Zhang, Thomas Reps","doi":"https://dl.acm.org/doi/full/10.1145/3492428","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3492428","url":null,"abstract":"<p>Many program-analysis problems can be formulated as graph-reachability problems. Interleaved Dyck language reachability (<span>InterDyck</span>-reachability) is a fundamental framework to express a wide variety of program-analysis problems over edge-labeled graphs. The <span>InterDyck</span> language represents an intersection of multiple matched-parenthesis languages (i.e., Dyck languages). In practice, program analyses typically leverage one Dyck language to achieve context-sensitivity, and other Dyck languages to model data dependencies, such as field-sensitivity and pointer references/dereferences. In the ideal case, an <span>InterDyck</span>-reachability framework should model multiple Dyck languages <i>simultaneously</i>.</p><p>Unfortunately, precise <span>InterDyck</span>-reachability is undecidable. Any practical solution must over-approximate the exact answer. In the literature, a lot of work has been proposed to over-approximate the <span>InterDyck</span>-reachability formulation. This article offers a new perspective on improving both the precision and the scalability of <span>InterDyck</span>-reachability: we aim at simplifying the underlying input graph <i>G</i>. Our key insight is based on the observation that if an edge is not contributing to any <span>InterDyck</span>-paths, we can safely eliminate it from <i>G</i>. Our technique is orthogonal to the <span>InterDyck</span>-reachability formulation and can serve as a pre-processing step with any over-approximating approach for <span>InterDyck</span>-reachability. We have applied our graph simplification algorithm to pre-processing the graphs from a recent <span>InterDyck</span>-reachability-based taint analysis for Android. Our evaluation of three popular <span>InterDyck</span>-reachability algorithms yields promising results. In particular, our graph-simplification method improves both the scalability and precision of all three <span>InterDyck</span>-reachability algorithms, sometimes dramatically.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"1 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-05-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531592","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
TF-Coder: Program Synthesis for Tensor Manipulations TF-Coder:张量操作的程序合成
IF 1.3 2区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2022-05-27 DOI: https://dl.acm.org/doi/full/10.1145/3517034
Kensen Shi, David Bieber, Rishabh Singh

The success and popularity of deep learning is on the rise, partially due to powerful deep learning frameworks such as TensorFlow and PyTorch, which make it easier to develop deep learning models. However, these libraries also come with steep learning curves, since programming in these frameworks is quite different from traditional imperative programming with explicit loops and conditionals. In this work, we present a tool called TF-Coder for programming by example in TensorFlow. TF-Coder uses a bottom-up weighted enumerative search, with value-based pruning of equivalent expressions and flexible type- and value-based filtering to ensure that expressions adhere to various requirements imposed by the TensorFlow library. We train models to predict TensorFlow operations from features of the input and output tensors and natural language descriptions of tasks to prioritize relevant operations during search. TF-Coder solves 63 of 70 real-world tasks within 5 minutes, sometimes finding simpler solutions in less time compared to experienced human programmers.

深度学习的成功和普及程度正在上升,部分原因是强大的深度学习框架,如TensorFlow和PyTorch,使开发深度学习模型变得更加容易。然而,这些库也有陡峭的学习曲线,因为在这些框架中编程与带有显式循环和条件的传统命令式编程有很大不同。在这项工作中,我们提出了一个名为TF-Coder的工具,用于在TensorFlow中进行示例编程。TF-Coder使用自下而上的加权枚举搜索,对等价表达式进行基于值的修剪,以及灵活的基于类型和基于值的过滤,以确保表达式符合TensorFlow库施加的各种要求。我们训练模型从输入和输出张量的特征和任务的自然语言描述来预测TensorFlow操作,以便在搜索过程中优先考虑相关操作。TF-Coder在5分钟内解决了70个现实世界任务中的63个,与经验丰富的人类程序员相比,有时可以在更短的时间内找到更简单的解决方案。
{"title":"TF-Coder: Program Synthesis for Tensor Manipulations","authors":"Kensen Shi, David Bieber, Rishabh Singh","doi":"https://dl.acm.org/doi/full/10.1145/3517034","DOIUrl":"https://doi.org/https://dl.acm.org/doi/full/10.1145/3517034","url":null,"abstract":"<p>The success and popularity of deep learning is on the rise, partially due to powerful deep learning frameworks such as TensorFlow and PyTorch, which make it easier to develop deep learning models. However, these libraries also come with steep learning curves, since programming in these frameworks is quite different from traditional imperative programming with explicit loops and conditionals. In this work, we present a tool called TF-Coder for programming by example in TensorFlow. TF-Coder uses a bottom-up weighted enumerative search, with value-based pruning of equivalent expressions and flexible type- and value-based filtering to ensure that expressions adhere to various requirements imposed by the TensorFlow library. We train models to predict TensorFlow operations from features of the input and output tensors and natural language descriptions of tasks to prioritize relevant operations during search. TF-Coder solves 63 of 70 real-world tasks within 5 minutes, sometimes finding simpler solutions in less time compared to experienced human programmers.</p>","PeriodicalId":50939,"journal":{"name":"ACM Transactions on Programming Languages and Systems","volume":"2 1","pages":""},"PeriodicalIF":1.3,"publicationDate":"2022-05-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138531539","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":2,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
期刊
ACM Transactions on Programming Languages and Systems
全部 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