首页 > 最新文献

Journal of Functional Programming最新文献

英文 中文
StkTokens: Enforcing well-bracketed control flow and stack encapsulation using linear capabilities StkTokens:使用线性功能强制括号内控制流和堆栈封装
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-04-15 DOI: 10.1017/s095679682100006x
LAU SKORSTENGAARD, DOMINIQUE DEVRIESE, LARS BIRKEDAL
We propose and study StkTokens: a new calling convention that provably enforces well-bracketed control flow and local state encapsulation on a capability machine. The calling convention is based on linear capabilities: a type of capabilities that are prevented from being duplicated by the hardware. In addition to designing and formalizing this new calling convention, we also contribute a new way to formalize and prove that it effectively enforces well-bracketed control flow and local state encapsulation using what we call a fully abstract overlay semantics.
我们提出并研究了StkTokens:一种新的调用约定,可证明它在功能机器上强制执行良好的括号控制流和本地状态封装。调用约定基于线性功能:一种防止被硬件复制的功能。除了设计和形式化这种新的调用约定之外,我们还提供了一种新的方法来形式化并证明它使用我们称之为完全抽象的覆盖语义有效地强制括起来的控制流和本地状态封装。
{"title":"StkTokens: Enforcing well-bracketed control flow and stack encapsulation using linear capabilities","authors":"LAU SKORSTENGAARD, DOMINIQUE DEVRIESE, LARS BIRKEDAL","doi":"10.1017/s095679682100006x","DOIUrl":"https://doi.org/10.1017/s095679682100006x","url":null,"abstract":"We propose and study StkTokens: a new calling convention that provably enforces well-bracketed control flow and local state encapsulation on a capability machine. The calling convention is based on linear capabilities: a type of capabilities that are prevented from being duplicated by the hardware. In addition to designing and formalizing this new calling convention, we also contribute a new way to formalize and prove that it effectively enforces well-bracketed control flow and local state encapsulation using what we call a fully abstract overlay semantics.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-04-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138508012","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Cubical Agda: A dependently typed programming language with univalence and higher inductive types 立方议程:一种独立类型的程序设计语言,具有单一性和高级归纳类型
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-04-06 DOI: 10.1017/s0956796821000034
ANDREA VEZZOSI, ANDERS MÖRTBERG, ANDREAS ABEL
Proof assistants based on dependent type theory provide expressive languages for both programming and proving within the same system. However, all of the major implementations lack powerful extensionality principles for reasoning about equality, such as function and propositional extensionality. These principles are typically added axiomatically which disrupts the constructive properties of these systems. Cubical type theory provides a solution by giving computational meaning to Homotopy Type Theory and Univalent Foundations, in particular to the univalence axiom and higher inductive types (HITs). This paper describes an extension of the dependently typed functional programming language Agda with cubical primitives, making it into a full-blown proof assistant with native support for univalence and a general schema of HITs. These new primitives allow the direct definition of function and propositional extensionality as well as quotient types, all with computational content. Additionally, thanks also to copatterns, bisimilarity is equivalent to equality for coinductive types. The adoption of cubical type theory extends Agda with support for a wide range of extensionality principles, without sacrificing type checking and constructivity.
基于依赖类型理论的证明助手为同一系统内的编程和证明提供了表达语言。然而,所有主要的实现都缺乏强大的关于等式推理的可拓性原则,例如函数和命题的可拓性。这些原则通常是公理化地添加的,这破坏了这些系统的构造性质。三次类型理论通过赋予同伦类型理论和一元基础,特别是一元公理和高归纳类型(hit)计算意义,提供了一个解决方案。本文描述了使用立方原语对依赖类型函数式编程语言Agda进行的扩展,使其成为一个具有本机单一性支持的完备证明助手和hit的通用模式。这些新的原语允许直接定义函数和命题扩展性以及商类型,所有这些都具有计算内容。此外,由于有了共同模式,对于共归纳类型,双相似性等价于相等性。立方体类型理论的采用在不牺牲类型检查和构造性的前提下,通过支持广泛的可扩展性原则扩展了Agda。
{"title":"Cubical Agda: A dependently typed programming language with univalence and higher inductive types","authors":"ANDREA VEZZOSI, ANDERS MÖRTBERG, ANDREAS ABEL","doi":"10.1017/s0956796821000034","DOIUrl":"https://doi.org/10.1017/s0956796821000034","url":null,"abstract":"Proof assistants based on dependent type theory provide expressive languages for both programming and proving within the same system. However, all of the major implementations lack powerful extensionality principles for reasoning about equality, such as function and propositional extensionality. These principles are typically added axiomatically which disrupts the constructive properties of these systems. Cubical type theory provides a solution by giving computational meaning to Homotopy Type Theory and Univalent Foundations, in particular to the univalence axiom and higher inductive types (HITs). This paper describes an extension of the dependently typed functional programming language Agda with cubical primitives, making it into a full-blown proof assistant with native support for univalence and a general schema of HITs. These new primitives allow the direct definition of function and propositional extensionality as well as quotient types, all with computational content. Additionally, thanks also to copatterns, bisimilarity is equivalent to equality for coinductive types. The adoption of cubical type theory extends Agda with support for a wide range of extensionality principles, without sacrificing type checking and constructivity.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-04-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138508011","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Lambda calculus with algebraic simplification for reduction parallelisation: Extended study λ演算与代数简化减少并行化:扩展研究
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-04-05 DOI: 10.1017/S0956796821000058
Akimasa Morihata
Abstract Parallel reduction is a major component of parallel programming and widely used for summarisation and aggregation. It is not well understood, however, what sorts of non-trivial summarisations can be implemented as parallel reductions. This paper develops a calculus named λAS, a simply typed lambda calculus with algebraic simplification. This calculus provides a foundation for studying a parallelisation of complex reductions by equational reasoning. Its key feature is δ abstraction. A δ abstraction is observationally equivalent to the standard λ abstraction, but its body is simplified before the arrival of its arguments using algebraic properties such as associativity and commutativity. In addition, the type system of λAS guarantees that simplifications due to δ abstractions do not lead to serious overheads. The usefulness of λAS is demonstrated on examples of developing complex parallel reductions, including those containing more than one reduction operator, loops with conditional jumps, prefix sum patterns and even tree manipulations.
摘要并行约简是并行编程的一个重要组成部分,广泛用于摘要和聚合。然而,人们还不太清楚,什么样的非琐碎的总结可以作为并行缩减来实现。本文发展了λAS微积分,一个具有代数化简的简单型λ微积分。这种演算方法为通过方程推理来研究复杂约简的并行化提供了基础。它的主要特点是δ抽象。一个δ抽象在观测上等同于标准λ抽象,但是在它的参数到来之前,它的主体被简化了,使用了诸如结合性和交换性之类的代数性质。此外,λAS的类型系统保证了由于δ抽象而进行的简化不会导致严重的开销。λAS的有用性通过开发复杂并行约简的例子得到了证明,包括那些包含多个约简算子的并行约简,带有条件跳跃的循环,前缀和模式,甚至树操作。
{"title":"Lambda calculus with algebraic simplification for reduction parallelisation: Extended study","authors":"Akimasa Morihata","doi":"10.1017/S0956796821000058","DOIUrl":"https://doi.org/10.1017/S0956796821000058","url":null,"abstract":"Abstract Parallel reduction is a major component of parallel programming and widely used for summarisation and aggregation. It is not well understood, however, what sorts of non-trivial summarisations can be implemented as parallel reductions. This paper develops a calculus named λAS, a simply typed lambda calculus with algebraic simplification. This calculus provides a foundation for studying a parallelisation of complex reductions by equational reasoning. Its key feature is δ abstraction. A δ abstraction is observationally equivalent to the standard λ abstraction, but its body is simplified before the arrival of its arguments using algebraic properties such as associativity and commutativity. In addition, the type system of λAS guarantees that simplifications due to δ abstractions do not lead to serious overheads. The usefulness of λAS is demonstrated on examples of developing complex parallel reductions, including those containing more than one reduction operator, loops with conditional jumps, prefix sum patterns and even tree manipulations.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-04-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796821000058","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48501070","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Linear capabilities for fully abstract compilation of separation-logic-verified code 对分离逻辑验证代码进行完全抽象编译的线性能力
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-03-30 DOI: 10.1017/s0956796821000022
THOMAS VAN STRYDONCK, FRANK PIESSENS, DOMINIQUE DEVRIESE
Separation logic is a powerful program logic for the static modular verification of imperative programs. However, dynamic checking of separation logic contracts on the boundaries between verified and untrusted modules is hard because it requires one to enforce (among other things) that outcalls from a verified to an untrusted module do not access memory resources currently owned by the verified module. This paper proposes an approach to dynamic contract checking by relying on support for capabilities, a well-studied form of unforgeable memory pointers that enables fine-grained, efficient memory access control. More specifically, we rely on a form of capabilities called linear capabilities for which the hardware enforces that they cannot be copied. We formalize our approach as a fully abstract compiler from a statically verified source language to an unverified target language with support for linear capabilities. The key insight behind our compiler is that memory resources described by spatial separation logic predicates can be represented at run time by linear capabilities. The compiler is separation-logic-proof-directed: it uses the separation logic proof of the source program to determine how memory accesses in the source program should be compiled to linear capability accesses in the target program. The full abstraction property of the compiler essentially guarantees that compiled verified modules can interact with untrusted target language modules as if they were compiled from verified code as well. This article is an extended version of one that was presented at ICFP 2019 (Van Strydonck et al., 2019).
分离逻辑是一种功能强大的程序逻辑,用于命令式程序的静态模块化验证。然而,对已验证模块和不受信任模块之间边界上的分离逻辑契约进行动态检查是困难的,因为它需要强制执行(除其他事项外)从已验证模块到不受信任模块的输出调用不访问当前由已验证模块拥有的内存资源。本文提出了一种动态契约检查的方法,它依赖于对功能的支持,这是一种经过充分研究的不可伪造内存指针形式,可以实现细粒度、高效的内存访问控制。更具体地说,我们依赖于一种称为线性能力的能力形式,硬件强制它们不能被复制。我们将我们的方法形式化为一个完全抽象的编译器,从静态验证的源语言到支持线性功能的未经验证的目标语言。我们编译器背后的关键见解是,由空间分离逻辑谓词描述的内存资源可以在运行时通过线性能力表示。编译器是面向分离逻辑证明的:它使用源程序的分离逻辑证明来确定源程序中的内存访问应该如何编译为目标程序中的线性能力访问。编译器的完整抽象属性本质上保证编译后的经过验证的模块可以与不受信任的目标语言模块交互,就好像它们是从经过验证的代码中编译出来的一样。本文是在ICFP 2019上发表的一篇文章的扩展版本(Van Strydonck et al., 2019)。
{"title":"Linear capabilities for fully abstract compilation of separation-logic-verified code","authors":"THOMAS VAN STRYDONCK, FRANK PIESSENS, DOMINIQUE DEVRIESE","doi":"10.1017/s0956796821000022","DOIUrl":"https://doi.org/10.1017/s0956796821000022","url":null,"abstract":"Separation logic is a powerful program logic for the static modular verification of imperative programs. However, <jats:italic>dynamic</jats:italic> checking of separation logic contracts on the boundaries between verified and untrusted modules is hard because it requires one to enforce (among other things) that outcalls from a verified to an untrusted module do not access memory resources currently owned by the verified module. This paper proposes an approach to dynamic contract checking by relying on support for capabilities, a well-studied form of unforgeable memory pointers that enables fine-grained, efficient memory access control. More specifically, we rely on a form of capabilities called <jats:italic>linear</jats:italic> capabilities for which the hardware enforces that they cannot be copied. We formalize our approach as a fully abstract compiler from a statically verified source language to an unverified target language with support for linear capabilities. The key insight behind our compiler is that memory resources described by spatial separation logic predicates can be represented at run time by linear capabilities. The compiler is <jats:italic>separation-logic-proof-directed</jats:italic>: it uses the separation logic proof of the source program to determine how memory accesses in the source program should be compiled to linear capability accesses in the target program. The full abstraction property of the compiler essentially guarantees that compiled verified modules can interact with untrusted target language modules as if they were compiled from verified code as well. This article is an extended version of one that was presented at ICFP 2019 (Van Strydonck et al., 2019).","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-03-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138508005","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Classical (co)recursion: Mechanics 经典(共)递归:力学
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-03-15 DOI: 10.1017/S0956796822000168
P. Downen, Z. M. Ariola
Abstract Recursion is a mature, well-understood topic in the theory and practice of programming. Yet its dual, corecursion is underappreciated and still seen as exotic. We aim to put them both on equal footing by giving a foundation for primitive corecursion based on computation, giving a terminating calculus analogous to the original computational foundation of recursion. We show how the implementation details in an abstract machine strengthens their connection, syntactically deriving corecursion from recursion via logical duality. We also observe the impact of evaluation strategy on the computational complexity of primitive (co)recursive combinators: call-by-name allows for more efficient recursion, but call-by-value allows for more efficient corecursion.
摘要递归是编程理论和实践中一个成熟的、被广泛理解的话题。然而,它的双重共草书却被低估了,仍然被视为异国情调。我们的目标是通过为基于计算的原始共运算提供基础,并提供类似于递归的原始计算基础的终止演算,使它们处于平等的地位。我们展示了抽象机器中的实现细节是如何加强它们之间的联系的,通过逻辑对偶从递归中语法推导出同体。我们还观察到评估策略对基元(共)递归组合子计算复杂性的影响:按名称调用可以实现更高效的递归,但按值调用可以实现更有效率的共递归。
{"title":"Classical (co)recursion: Mechanics","authors":"P. Downen, Z. M. Ariola","doi":"10.1017/S0956796822000168","DOIUrl":"https://doi.org/10.1017/S0956796822000168","url":null,"abstract":"Abstract Recursion is a mature, well-understood topic in the theory and practice of programming. Yet its dual, corecursion is underappreciated and still seen as exotic. We aim to put them both on equal footing by giving a foundation for primitive corecursion based on computation, giving a terminating calculus analogous to the original computational foundation of recursion. We show how the implementation details in an abstract machine strengthens their connection, syntactically deriving corecursion from recursion via logical duality. We also observe the impact of evaluation strategy on the computational complexity of primitive (co)recursive combinators: call-by-name allows for more efficient recursion, but call-by-value allows for more efficient corecursion.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-03-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"46423017","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Ready, Set, Verify! Applying hs-to-coq to real-world Haskell code 准备,设置,验证!将hs-to-coq应用于实际的Haskell代码
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-02-26 DOI: 10.1017/s0956796820000283
JOACHIM BREITNER, ANTAL SPECTOR-ZABUSKY, YAO LI, CHRISTINE RIZKALLAH, JOHN WIEGLEY, JOSHUA COHEN, STEPHANIE WEIRICH
Good tools can bring mechanical verification to programs written in mainstream functional languages. We use hs-to-coq to translate significant portions of Haskell’s containers library into Coq, and verify it against specifications that we derive from a variety of sources including type class laws, the library’s test suite, and interfaces from Coq’s standard library. Our work shows that it is feasible to verify mature, widely used, highly optimized, and unmodified Haskell code. We also learn more about the theory of weight-balanced trees, extend hs-to-coq to handle partiality, and – since we found no bugs – attest to the superb quality of well-tested functional code.
好的工具可以为用主流函数式语言编写的程序带来机械验证。我们使用hs-to-coq将Haskell容器库的重要部分转换为Coq,并根据我们从各种来源获得的规范来验证它,包括类型类定律、库的测试套件和Coq标准库的接口。我们的工作表明,验证成熟、广泛使用、高度优化和未修改的Haskell代码是可行的。我们还学习了更多关于权重平衡树的理论,扩展了hs-to-coq来处理偏好,并且——因为我们没有发现任何bug——证明了经过良好测试的功能代码的高质量。
{"title":"Ready, Set, Verify! Applying hs-to-coq to real-world Haskell code","authors":"JOACHIM BREITNER, ANTAL SPECTOR-ZABUSKY, YAO LI, CHRISTINE RIZKALLAH, JOHN WIEGLEY, JOSHUA COHEN, STEPHANIE WEIRICH","doi":"10.1017/s0956796820000283","DOIUrl":"https://doi.org/10.1017/s0956796820000283","url":null,"abstract":"Good tools can bring mechanical verification to programs written in mainstream functional languages. We use <jats:monospace>hs-to-coq</jats:monospace> to translate significant portions of Haskell’s <jats:monospace>containers</jats:monospace> library into Coq, and verify it against specifications that we derive from a variety of sources including type class laws, the library’s test suite, and interfaces from Coq’s standard library. Our work shows that it is feasible to verify mature, widely used, highly optimized, and unmodified Haskell code. We also learn more about the theory of weight-balanced trees, extend <jats:monospace>hs-to-coq</jats:monospace> to handle partiality, and – since we found no bugs – attest to the superb quality of well-tested functional code.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-02-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138508002","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Integrating region memory management and tag-free generational garbage collection 集成了区域内存管理和无标记分代垃圾收集
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-02-22 DOI: 10.1017/S0956796821000010
M. Elsman, Niels Hallenberg
Abstract We present a region-based memory management scheme with support for generational garbage collection. The scheme features a compile-time region inference algorithm, which associates values with logical regions, and builds on a region type system that deploys region types at runtime to avoid the overhead of write barriers and to support partly tag-free garbage collection. The scheme is implemented in the MLKit Standard ML compiler, which generates native x64 machine code. Besides demonstrating a number of important formal properties of the scheme, we measure the scheme’s characteristics, for a number of benchmarks, and compare the performance of the generated executables with the performance of executables generated with the MLton state-of-the-art Standard ML compiler and configurations of the MLKit with and without region inference and generational garbage collection enabled. Although region inference often serves the purpose of generations, combining region inference with generational garbage collection is shown often to be superior to combining region inference with non-generational collection despite the overhead introduced by a larger amount of memory waste, due to region fragmentation.
摘要我们提出了一种基于区域的内存管理方案,支持代垃圾收集。该方案采用编译时区域推理算法,将值与逻辑区域相关联,并建立在区域类型系统的基础上,该系统在运行时部署区域类型,以避免写障碍的开销,并支持部分无标记的垃圾收集。该方案在MLKit Standard ML编译器中实现,该编译器生成本机x64计算机代码。除了证明该方案的一些重要形式性质外,我们还测量了该方案的特性,用于许多基准,并将生成的可执行文件的性能与使用MLton最先进的标准ML编译器生成的可运行文件的性能以及启用和不启用区域推断和世代垃圾收集的MLKit的配置进行比较。尽管区域推断通常有助于生成,但将区域推断与生成垃圾收集相结合通常比将区域推断和非生成收集相结合要好,尽管由于区域碎片化,大量内存浪费会带来开销。
{"title":"Integrating region memory management and tag-free generational garbage collection","authors":"M. Elsman, Niels Hallenberg","doi":"10.1017/S0956796821000010","DOIUrl":"https://doi.org/10.1017/S0956796821000010","url":null,"abstract":"Abstract We present a region-based memory management scheme with support for generational garbage collection. The scheme features a compile-time region inference algorithm, which associates values with logical regions, and builds on a region type system that deploys region types at runtime to avoid the overhead of write barriers and to support partly tag-free garbage collection. The scheme is implemented in the MLKit Standard ML compiler, which generates native x64 machine code. Besides demonstrating a number of important formal properties of the scheme, we measure the scheme’s characteristics, for a number of benchmarks, and compare the performance of the generated executables with the performance of executables generated with the MLton state-of-the-art Standard ML compiler and configurations of the MLKit with and without region inference and generational garbage collection enabled. Although region inference often serves the purpose of generations, combining region inference with generational garbage collection is shown often to be superior to combining region inference with non-generational collection despite the overhead introduced by a larger amount of memory waste, due to region fragmentation.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-02-22","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796821000010","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"42689016","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 9
Protocol combinators for modeling, testing, and execution of distributed systems 用于建模、测试和执行分布式系统的协议组合器
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-02-15 DOI: 10.1017/S095679682000026X
K. Andersen, Ilya Sergey
Abstract Distributed systems are hard to get right, model, test, debug, and teach. Their textbook definitions, typically given in a form of replicated state machines, are concise, yet prone to introducing programming errors if naïvely translated into runnable implementations. In this work, we present Distributed Protocol Combinators (DPC), a declarative programming framework that aims to bridge the gap between specifications and runnable implementations of distributed systems, and facilitate their modeling, testing, and execution. DPC builds on the ideas from the state-of-the art logics for compositional systems verification. The contribution of DPC is a novel family of program-level primitives, which facilitates construction of larger distributed systems from smaller components, streamlining the usage of the most common asynchronous message-passing communication patterns, and providing machinery for testing and user-friendly dynamic verification of systems. This paper describes the main ideas behind the design of the framework and presents its implementation in Haskell. We introduce DPC through a series of characteristic examples and showcase it on a number of distributed protocols from the literature. This paper extends our preceeding conference publication (Andersen & Sergey, 2019a) with an exploration of randomized testing for protocols and their implementations, and an additional case study demonstrating bounded model checking of protocols.
摘要分布式系统很难进行正确的建模、测试、调试和教学。他们的教科书定义通常以复制状态机的形式给出,简洁明了,但如果天真地转换为可运行的实现,则容易引入编程错误。在这项工作中,我们介绍了分布式协议组合器(DPC),这是一个声明性编程框架,旨在弥合分布式系统的规范和可运行实现之间的差距,并促进它们的建模、测试和执行。DPC建立在最先进的逻辑思想之上,用于组合系统验证。DPC的贡献是一个新的程序级原语家族,它有助于从较小的组件构建更大的分布式系统,简化最常见的异步消息传递通信模式的使用,并为系统的测试和用户友好的动态验证提供机制。本文描述了框架设计背后的主要思想,并介绍了它在Haskell中的实现。我们通过一系列特征示例介绍了DPC,并在文献中的许多分布式协议中展示了它。本文扩展了我们之前的会议出版物(Andersen和Sergey,2019a),探索了协议的随机测试及其实现,并进行了一项额外的案例研究,证明了协议的有界模型检查。
{"title":"Protocol combinators for modeling, testing, and execution of distributed systems","authors":"K. Andersen, Ilya Sergey","doi":"10.1017/S095679682000026X","DOIUrl":"https://doi.org/10.1017/S095679682000026X","url":null,"abstract":"Abstract Distributed systems are hard to get right, model, test, debug, and teach. Their textbook definitions, typically given in a form of replicated state machines, are concise, yet prone to introducing programming errors if naïvely translated into runnable implementations. In this work, we present Distributed Protocol Combinators (DPC), a declarative programming framework that aims to bridge the gap between specifications and runnable implementations of distributed systems, and facilitate their modeling, testing, and execution. DPC builds on the ideas from the state-of-the art logics for compositional systems verification. The contribution of DPC is a novel family of program-level primitives, which facilitates construction of larger distributed systems from smaller components, streamlining the usage of the most common asynchronous message-passing communication patterns, and providing machinery for testing and user-friendly dynamic verification of systems. This paper describes the main ideas behind the design of the framework and presents its implementation in Haskell. We introduce DPC through a series of characteristic examples and showcase it on a number of distributed protocols from the literature. This paper extends our preceeding conference publication (Andersen & Sergey, 2019a) with an exploration of randomized testing for protocols and their implementations, and an additional case study demonstrating bounded model checking of protocols.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-02-15","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S095679682000026X","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"45586478","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Not by equations alone 不是单靠方程
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-01-27 DOI: 10.1017/S0956796820000271
O. Kiselyov, Shin-Cheng Mu, A. Sabry
Abstract The challenge of reasoning about programs with (multiple) effects such as mutation, jumps, or IO dates back to the inception of program semantics in the works of Strachey and Landin. Using monads to represent individual effects and the associated equational laws to reason about them proved exceptionally effective. Even then it is not always clear what laws are to be associated with a monad—for a good reason, as we show for non-determinism. Combining expressions using different effects brings challenges not just for monads, which do not compose, but also for equational reasoning: the interaction of effects may invalidate their individual laws, as well as induce emerging properties that are not apparent in the semantics of individual effects. Overall, the problems are judging the adequacy of a law; determining if or when a law continues to hold upon addition of new effects; and obtaining and easily verifying emergent laws. We present a solution relying on the framework of (algebraic, extensible) effects, which already proved itself for writing programs with multiple effects. Equipped with a fairly conventional denotational semantics, this framework turns useful, as we demonstrate, also for reasoning about and optimizing programs with multiple interacting effects. Unlike the conventional approach, equational laws are not imposed on programs/effect handlers, but induced from them: our starting point hence is a program (model), whose denotational semantics, besides being used directly, suggests and justifies equational laws and clarifies side conditions. The main technical result is the introduction of the notion of equivalence modulo handlers (“modulo observation”) or a particular combination of handlers—and proving it to be a congruence. It is hence usable for reasoning in any context, not just evaluation contexts—provided particular conditions are met. Concretely, we describe several realistic handlers for non-determinism and elucidate their laws (some of which hold in the presence of any other effect). We demonstrate appropriate equational laws of non-determinism in the presence of global state, which have been a challenge to state and prove before.
摘要对具有(多种)影响(如突变、跳跃或IO)的程序进行推理的挑战可以追溯到Strachey和Landin作品中程序语义的诞生。事实证明,用单子来表示个体效应和相关的等式定律来推理它们是非常有效的。即便如此,也不总是清楚什么定律与monad相关——这是有充分理由的,正如我们在非决定论中所展示的那样。将使用不同效果的表达式组合在一起,不仅给不组合的单子带来了挑战,也给等式推理带来了挑战:效果的相互作用可能会使其各自的规律失效,并引发在单个效果的语义中不明显的新特性。总的来说,问题在于判断法律是否充分;确定法律是否或何时继续适用于添加新效果;以及获得并容易验证紧急定律。我们提出了一个依赖于(代数,可扩展)效果框架的解决方案,该框架已经证明了自己可以编写具有多种效果的程序。正如我们所展示的,这个框架配备了一个相当传统的指称语义,对于具有多种交互效果的程序的推理和优化也很有用。与传统方法不同,等式定律不是强加在程序/效果处理程序上,而是由它们诱导而来:因此,我们的出发点是一个程序(模型),其指称语义除了直接使用外,还提出和证明了等式定律,并澄清了边条件。主要的技术结果是引入了等价的模处理程序(“模观察”)或处理程序的特定组合的概念,并证明它是一个同余。因此,只要满足特定条件,它就可以用于任何上下文中的推理,而不仅仅是评估上下文。具体来说,我们描述了几个现实的非决定论处理者,并阐明了他们的规律(其中一些在存在任何其他影响的情况下成立)。我们证明了在全球国家存在的情况下,非决定论的适当等式定律,这是对国家和证明的挑战。
{"title":"Not by equations alone","authors":"O. Kiselyov, Shin-Cheng Mu, A. Sabry","doi":"10.1017/S0956796820000271","DOIUrl":"https://doi.org/10.1017/S0956796820000271","url":null,"abstract":"Abstract The challenge of reasoning about programs with (multiple) effects such as mutation, jumps, or IO dates back to the inception of program semantics in the works of Strachey and Landin. Using monads to represent individual effects and the associated equational laws to reason about them proved exceptionally effective. Even then it is not always clear what laws are to be associated with a monad—for a good reason, as we show for non-determinism. Combining expressions using different effects brings challenges not just for monads, which do not compose, but also for equational reasoning: the interaction of effects may invalidate their individual laws, as well as induce emerging properties that are not apparent in the semantics of individual effects. Overall, the problems are judging the adequacy of a law; determining if or when a law continues to hold upon addition of new effects; and obtaining and easily verifying emergent laws. We present a solution relying on the framework of (algebraic, extensible) effects, which already proved itself for writing programs with multiple effects. Equipped with a fairly conventional denotational semantics, this framework turns useful, as we demonstrate, also for reasoning about and optimizing programs with multiple interacting effects. Unlike the conventional approach, equational laws are not imposed on programs/effect handlers, but induced from them: our starting point hence is a program (model), whose denotational semantics, besides being used directly, suggests and justifies equational laws and clarifies side conditions. The main technical result is the introduction of the notion of equivalence modulo handlers (“modulo observation”) or a particular combination of handlers—and proving it to be a congruence. It is hence usable for reasoning in any context, not just evaluation contexts—provided particular conditions are met. Concretely, we describe several realistic handlers for non-determinism and elucidate their laws (some of which hold in the presence of any other effect). We demonstrate appropriate equational laws of non-determinism in the presence of global state, which have been a challenge to state and prove before.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-01-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000271","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48381643","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 1
Longest segment of balanced parentheses: an exercise in program inversion in a segment problem 平衡括号的最长段:段问题中程序反转的练习
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2021-01-24 DOI: 10.1017/S0956796821000253
Shin-Cheng Mu, Tsung-Ju Chiang
Abstract Given a string of parentheses, the task is to find the longest consecutive segment that is balanced, in linear time. We find this problem interesting because it involves a combination of techniques: the usual approach for solving segment problems and a theorem for constructing the inverse of a function—through which we derive an instance of shift-reduce parsing.
摘要给定一系列括号,任务是在线性时间内找到平衡的最长连续段。我们发现这个问题很有趣,因为它涉及到多种技术的结合:求解分段问题的常用方法和构造函数逆的定理——通过它我们导出了移位-减少解析的实例。
{"title":"Longest segment of balanced parentheses: an exercise in program inversion in a segment problem","authors":"Shin-Cheng Mu, Tsung-Ju Chiang","doi":"10.1017/S0956796821000253","DOIUrl":"https://doi.org/10.1017/S0956796821000253","url":null,"abstract":"Abstract Given a string of parentheses, the task is to find the longest consecutive segment that is balanced, in linear time. We find this problem interesting because it involves a combination of techniques: the usual approach for solving segment problems and a theorem for constructing the inverse of a function—through which we derive an instance of shift-reduce parsing.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2021-01-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"44475813","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":3,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
期刊
Journal of Functional Programming
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1