首页 > 最新文献

Journal of Functional Programming最新文献

英文 中文
Signature restriction for polymorphic algebraic effects 多态代数效应的特征限制
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-05-27 DOI: 10.1017/s0956796824000054
TARO SEKIYAMA, TAKESHI TSUKADA, ATSUSHI IGARASHI
The naive combination of polymorphic effects and polymorphic type assignment has been well known to break type safety. In the literature, there are two kinds of approaches to this problem: one is to restrict how effects are triggered and the other is to restrict how they are implemented. This work explores a new approach to ensuring the safety of the use of polymorphic effects in polymorphic type assignment. A novelty of our work is to restrict effect interfaces. To formalize our idea, we employ algebraic effects and handlers, where an effect interface is given by a set of operations coupled with type signatures. We propose signature restriction, a new notion to restrict the type signatures of operations and show that signature restriction ensures type safety of a language equipped with polymorphic effects and unrestricted polymorphic type assignment. We also develop a type-and-effect system to enable the use of both of the operations that satisfy and those that do not satisfy the signature restriction in a single program.
众所周知,多态效应和多态类型赋值的天真结合会破坏类型安全。文献中有两种解决这个问题的方法:一种是限制如何触发效应,另一种是限制如何实现效应。这项工作探索了一种新方法,以确保在多态类型赋值中使用多态效应的安全性。我们工作的新颖之处在于限制效应接口。为了使我们的想法正规化,我们采用了代数效应和处理程序,其中效应接口由一组与类型签名耦合的操作给出。我们提出了限制操作类型签名的新概念--签名限制,并证明签名限制确保了具有多态效应和无限制多态类型赋值的语言的类型安全。我们还开发了一个类型-效果系统,使满足和不满足签名限制的操作都能在一个程序中使用。
{"title":"Signature restriction for polymorphic algebraic effects","authors":"TARO SEKIYAMA, TAKESHI TSUKADA, ATSUSHI IGARASHI","doi":"10.1017/s0956796824000054","DOIUrl":"https://doi.org/10.1017/s0956796824000054","url":null,"abstract":"The naive combination of polymorphic effects and polymorphic type assignment has been well known to break type safety. In the literature, there are two kinds of approaches to this problem: one is to restrict how effects are triggered and the other is to restrict how they are implemented. This work explores a new approach to ensuring the safety of the use of polymorphic effects in polymorphic type assignment. A novelty of our work is to restrict <jats:italic>effect interfaces</jats:italic>. To formalize our idea, we employ algebraic effects and handlers, where an effect interface is given by a set of operations coupled with type signatures. We propose <jats:italic>signature restriction</jats:italic>, a new notion to restrict the type signatures of operations and show that signature restriction ensures type safety of a language equipped with polymorphic effects and unrestricted polymorphic type assignment. We also develop a type-and-effect system to enable the use of both of the operations that satisfy and those that do not satisfy the signature restriction in a single program.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-05-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141171807","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
Asymptotic speedup via effect handlers 通过效应处理程序实现渐进提速
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-04-05 DOI: 10.1017/s0956796824000030
DANIEL HILLERSTRÖM, SAM LINDLEY, JOHN LONGLEY
We study a fundamental efficiency benefit afforded by delimited control, showing that for certain higher-order functions, a language with advanced control features offers an asymptotic improvement in runtime over a language without them. Specifically, we consider the generic count problem in the context of a pure functional base language ${lambda_{textrm{b}}}$ and an extension ${lambda_{textrm{h}}}$ with general effect handlers. We prove that ${lambda_{textrm{h}}}$ admits an asymptotically more efficient implementation of generic count than any implementation in ${lambda_{textrm{b}}}$ . We also show that this gap remains even when ${lambda_{textrm{b}}}$ is extended to a language ${{{{{{lambda_{textrm{a}}}}}}}}$ with affine effect handlers, which is strong enough to encode exceptions, local state, coroutines and single-shot continuations. This locates the efficiency difference in the gap between ‘single-shot’ and ‘multi-shot’ versions of delimited control. To our knowledge, these results are the first of their kind for control operators.
我们研究了分界控制带来的基本效率优势,结果表明,对于某些高阶函数,具有高级控制特性的语言比不具有高级控制特性的语言在运行时间上有渐进的改善。具体来说,我们在纯函数式基础语言 ${lambda_{textrm{b}}$ 和带有一般效应处理程序的扩展语言 ${lambda_{textrm{h}}$ 的背景下考虑了泛型计数问题。我们证明,${/lambda_{textrm{h}}$ 在实现泛型计数时的效率在渐近上要高于 ${lambda_{textrm{b}}$ 中的任何实现。我们还证明,即使将 ${lambda_{textrm{b}}$ 扩展为具有仿射效应处理程序的语言 ${{{{{{/lambda_{textrm{a}}}}}}}}$,这种语言的强度足以编码异常、局部状态、例行程序和单次连续,这种差距依然存在。这就找到了 "单发 "和 "多发 "版本的分隔控制之间的效率差异。据我们所知,这些结果是首次针对控制运算符得出的。
{"title":"Asymptotic speedup via effect handlers","authors":"DANIEL HILLERSTRÖM, SAM LINDLEY, JOHN LONGLEY","doi":"10.1017/s0956796824000030","DOIUrl":"https://doi.org/10.1017/s0956796824000030","url":null,"abstract":"We study a fundamental efficiency benefit afforded by delimited control, showing that for certain higher-order functions, a language with advanced control features offers an asymptotic improvement in runtime over a language without them. Specifically, we consider the <jats:italic>generic count</jats:italic> problem in the context of a pure functional base language <jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796824000030_inline1.png\" /> <jats:tex-math> ${lambda_{textrm{b}}}$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> and an extension <jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796824000030_inline2.png\" /> <jats:tex-math> ${lambda_{textrm{h}}}$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> with general <jats:italic>effect handlers</jats:italic>. We prove that <jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796824000030_inline3.png\" /> <jats:tex-math> ${lambda_{textrm{h}}}$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> admits an asymptotically more efficient implementation of generic count than any implementation in <jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796824000030_inline4.png\" /> <jats:tex-math> ${lambda_{textrm{b}}}$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>. We also show that this gap remains even when <jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796824000030_inline5.png\" /> <jats:tex-math> ${lambda_{textrm{b}}}$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> is extended to a language <jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796824000030_inline6.png\" /> <jats:tex-math> ${{{{{{lambda_{textrm{a}}}}}}}}$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> with <jats:italic>affine effect handlers</jats:italic>, which is strong enough to encode exceptions, local state, coroutines and single-shot continuations. This locates the efficiency difference in the gap between ‘single-shot’ and ‘multi-shot’ versions of delimited control. To our knowledge, these results are the first of their kind for control operators.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-04-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"140568980","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
Static Blame for gradual typing 渐进打字的静态责任
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-03-25 DOI: 10.1017/s0956796824000029
CHENGHAO SU, LIN CHEN, LI YANHUI, YUMING ZHOU
Gradual typing integrates static and dynamic typing by introducing a dynamic type and a consistency relation. A problem of gradual type systems is that dynamic types can easily hide erroneous data flows since consistency relations are not transitive. Therefore, a more rigorous static check is required to reveal these hidden data flows statically. However, in order to preserve the expressiveness of gradually typed languages, static checks for gradually typed languages cannot simply reject programs with potentially erroneous data flows. By contrast, a more reasonable request is to show how these data flows can affect the execution of the program. In this paper, we propose and formalize Static Blame, a framework that can reveal hidden data flows for gradually typed programs and establish the correspondence between static-time data flows and runtime behavior. With this correspondence, we build a classification of potential errors detected from hidden data flows and formally characterize the possible impact of potential errors in each category on program execution, without simply rejecting the whole program. We implemented Static Blame on Grift, an academic gradually typed language, and evaluated the effectiveness of Static Blame by mutation analysis to verify our theoretical results. Our findings revealed that Static Blame exhibits a notable level of precision and recall in detecting type-related bugs. Furthermore, we conducted a manual classification to elucidate the reasons behind instances of failure. We also evaluated the performance of Static Blame, showing a quadratic growth in run time as program size increases.
渐进式类型通过引入动态类型和一致性关系,将静态和动态类型整合在一起。渐进类型系统的一个问题是,由于一致性关系不是传递性的,动态类型很容易隐藏错误的数据流。因此,需要更严格的静态检查来静态地揭示这些隐藏的数据流。然而,为了保持渐进类型语言的表现力,渐进类型语言的静态检查不能简单地拒绝可能存在错误数据流的程序。相比之下,更合理的要求是说明这些数据流如何影响程序的执行。在本文中,我们提出并正式确定了静态责备(Static Blame)框架,该框架可以揭示渐进类型程序的隐藏数据流,并建立静态数据流与运行时行为之间的对应关系。有了这种对应关系,我们就能对从隐藏数据流中检测到的潜在错误进行分类,并正式描述每个类别中的潜在错误对程序执行可能产生的影响,而不会简单地拒绝整个程序。我们在学术渐进类型语言 Grift 上实施了静态责备,并通过突变分析评估了静态责备的有效性,以验证我们的理论结果。我们的研究结果表明,Static Blame 在检测与类型相关的错误方面表现出了显著的精确度和召回率。此外,我们还进行了人工分类,以阐明故障实例背后的原因。我们还对 Static Blame 的性能进行了评估,结果表明随着程序规模的增大,运行时间呈二次曲线增长。
{"title":"Static Blame for gradual typing","authors":"CHENGHAO SU, LIN CHEN, LI YANHUI, YUMING ZHOU","doi":"10.1017/s0956796824000029","DOIUrl":"https://doi.org/10.1017/s0956796824000029","url":null,"abstract":"Gradual typing integrates static and dynamic typing by introducing a dynamic type and a consistency relation. A problem of gradual type systems is that dynamic types can easily hide erroneous data flows since consistency relations are not transitive. Therefore, a more rigorous static check is required to reveal these hidden data flows statically. However, in order to preserve the expressiveness of gradually typed languages, static checks for gradually typed languages cannot simply reject programs with potentially erroneous data flows. By contrast, a more reasonable request is to show how these data flows can affect the execution of the program. In this paper, we propose and formalize <jats:italic>Static Blame</jats:italic>, a framework that can reveal hidden data flows for gradually typed programs and establish the correspondence between static-time data flows and runtime behavior. With this correspondence, we build a classification of potential errors detected from hidden data flows and formally characterize the possible impact of potential errors in each category on program execution, without simply rejecting the whole program. We implemented Static Blame on Grift, an academic gradually typed language, and evaluated the effectiveness of Static Blame by mutation analysis to verify our theoretical results. Our findings revealed that Static Blame exhibits a notable level of precision and recall in detecting type-related bugs. Furthermore, we conducted a manual classification to elucidate the reasons behind instances of failure. We also evaluated the performance of Static Blame, showing a quadratic growth in run time as program size increases.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-03-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"140302331","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
Knuth–Morris–Pratt illustrated Knuth-Morris-Pratt 图解
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-01-30 DOI: 10.1017/s0956796824000017
CAMERON MOY

The Knuth–Morris–Pratt (KMP) algorithm for string search is notoriously difficult to understand. Lost in a sea of index arithmetic, most explanations of KMP obscure its essence. This paper constructs KMP incrementally, using pictures to illustrate each step. The end result is easier to comprehend. Additionally, the derivation uses only elementary functional programming techniques.

用于字符串搜索的 Knuth-Morris-Pratt (KMP) 算法是出了名的难懂。在索引运算的汪洋大海中,大多数对 KMP 的解释都掩盖了其本质。本文通过图片说明每一步,逐步构建 KMP 算法。最终结果更容易理解。此外,推导过程只使用了初级函数式编程技术。
{"title":"Knuth–Morris–Pratt illustrated","authors":"CAMERON MOY","doi":"10.1017/s0956796824000017","DOIUrl":"https://doi.org/10.1017/s0956796824000017","url":null,"abstract":"<p>The Knuth–Morris–Pratt (KMP) algorithm for string search is notoriously difficult to understand. Lost in a sea of index arithmetic, most explanations of KMP obscure its essence. This paper constructs KMP incrementally, using pictures to illustrate each step. The end result is easier to comprehend. Additionally, the derivation uses only elementary functional programming techniques.</p>","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-01-30","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139590358","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
Sparcl: A language for partially invertible computation Sparcl:部分可逆计算语言
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-01-26 DOI: 10.1017/s0956796823000126
KAZUTAKA MATSUDA, MENG WANG
Invertibility is a fundamental concept in computer science, with various manifestations in software development (serializer/deserializer, parser/printer, redo/undo, compressor/decompressor, and so on). Full invertibility necessarily requires bijectivity, but the direct approach of composing bijective functions to develop invertible programs is too restrictive to be useful. In this paper, we take a different approach by focusing on partially invertible functions—functions that become invertible if some of their arguments are fixed. The simplest example of such is addition, which becomes invertible when fixing one of the operands. More involved examples include entropy-based compression methods (e.g., Huffman coding), which carry the occurrence frequency of input symbols (in certain formats such as Huffman tree), and fixing this frequency information makes the compression methods invertible. We develop a language Sparcl for programming such functions in a natural way, where partial invertibility is the norm and bijectivity is a special case, hence gaining significant expressiveness without compromising correctness. The challenge in designing such a language is to allow ordinary programming (the “partially” part) to interact with the invertible part freely, and yet guarantee invertibility by construction. The language Sparcl is linear-typed and has a type constructor to distinguish data that are subject to invertible computation and those that are not. We present the syntax, type system, and semantics of the language and prove that Sparcl correctly guarantees invertibility for its programs. We demonstrate the expressiveness of Sparcl with examples including tree rebuilding from preorder and inorder traversals, Huffman coding, arithmetic coding, and LZ77 compression.
可逆性是计算机科学中的一个基本概念,在软件开发中有多种表现形式(序列器/解序列器、解析器/打印机、重做/重做、压缩器/解压缩器等)。完全可反转性必然要求双射性,但直接通过组合双射函数来开发可反转程序的方法限制太多,难以发挥作用。在本文中,我们采取了一种不同的方法,将重点放在部分可逆函数上--如果部分参数是固定的,这些函数就会变成可逆函数。最简单的例子是加法,当固定其中一个操作数时,它就会变得可逆。更复杂的例子包括基于熵的压缩方法(如哈夫曼编码),它携带输入符号的出现频率(在某些格式中,如哈夫曼树),固定这些频率信息会使压缩方法变得可逆。我们开发了一种语言 Sparcl,用于以自然的方式对此类函数进行编程,其中部分可逆性是规范,双射性是特例,因此在不影响正确性的情况下获得了显著的表达能力。设计这样一种语言的挑战在于,既要允许普通编程("部分 "部分)与可反转部分自由交互,又要通过构造保证可反转性。Sparcl 语言是线性类型的,并有一个类型构造函数来区分可反转计算的数据和不可反转计算的数据。我们介绍了该语言的语法、类型系统和语义,并证明 Sparcl 能正确保证其程序的可逆性。我们通过从前序和无序遍历中重建树、哈夫曼编码、算术编码和 LZ77 压缩等示例来证明 Sparcl 的表达能力。
{"title":"Sparcl: A language for partially invertible computation","authors":"KAZUTAKA MATSUDA, MENG WANG","doi":"10.1017/s0956796823000126","DOIUrl":"https://doi.org/10.1017/s0956796823000126","url":null,"abstract":"Invertibility is a fundamental concept in computer science, with various manifestations in software development (serializer/deserializer, parser/printer, redo/undo, compressor/decompressor, and so on). Full invertibility necessarily requires bijectivity, but the direct approach of composing bijective functions to develop invertible programs is too restrictive to be useful. In this paper, we take a different approach by focusing on <jats:italic>partially invertible</jats:italic> functions—functions that become invertible if some of their arguments are fixed. The simplest example of such is addition, which becomes invertible when fixing one of the operands. More involved examples include entropy-based compression methods (e.g., Huffman coding), which carry the occurrence frequency of input symbols (in certain formats such as Huffman tree), and fixing this frequency information makes the compression methods invertible. We develop a language <jats:sc>Sparcl</jats:sc> for programming such functions in a natural way, where partial invertibility is the norm and bijectivity is a special case, hence gaining significant expressiveness without compromising correctness. The challenge in designing such a language is to allow ordinary programming (the “partially” part) to interact with the invertible part freely, and yet guarantee invertibility by construction. The language <jats:sc>Sparcl</jats:sc> is linear-typed and has a type constructor to distinguish data that are subject to invertible computation and those that are not. We present the syntax, type system, and semantics of the language and prove that <jats:sc>Sparcl</jats:sc> correctly guarantees invertibility for its programs. We demonstrate the expressiveness of <jats:sc>Sparcl</jats:sc> with examples including tree rebuilding from preorder and inorder traversals, Huffman coding, arithmetic coding, and LZ77 compression.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-01-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139579436","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
Alice or Bob?: Process polymorphism in choreographies 爱丽丝还是鲍勃?编排图中的进程多态性
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-01-23 DOI: 10.1017/s0956796823000114
EVA GRAVERSEN, ANDREW K. HIRSCH, FABRIZIO MONTESI
We present PolyChor $lambda$ , a language for higher-order functional choreographic programming—an emerging paradigm for concurrent programming. In choreographic programming, programmers write the desired cooperative behaviour of a system of processes and then compile it into an implementation for each process, a translation called endpoint projection. Unlike its predecessor, Chor $lambda$ , PolyChor $lambda$ has both type and process polymorphism inspired by System F $_omega$ . That is, PolyChor $lambda$ is the first (higher-order) functional choreographic language which gives programmers the ability to write generic choreographies and determine the participants at runtime. This novel combination of features also allows PolyChor $lambda$ processes to communicate distributed values, leading to a new and intuitive way to write delegation. While some of the functional features of PolyChor $lambda$ give it a weaker correspondence between the semantics of choreographies and their endpoint-projected concurrent systems than some other choreographic languages, we still get the hallmark end result of choreographic programming: projected programmes are dead
我们介绍 PolyChor $lambda$ ,这是一种用于高阶函数式编排编程的语言--一种新兴的并发编程范式。在编排式编程中,程序员编写进程系统所需的合作行为,然后将其编译成每个进程的实现,这种转换称为端点投影。与它的前身 Chor $lambda$ 不同,PolyChor $lambda$ 在 System F $_omega$ 的启发下具有类型和进程多态性。也就是说,PolyChor $lambda$ 是第一种(高阶)功能编排语言,它使程序员能够编写通用编排,并在运行时确定参与者。这种新颖的功能组合还允许 PolyChor $lambda$ 进程交流分布式值,从而为编写委托提供了一种新的直观方式。虽然与其他一些编排语言相比,PolyChor $lambda$ 的一些功能特性使其在编排语义与端点投射并发系统之间的对应关系较弱,但我们仍然得到了编排编程的标志性最终结果:投射程序在设计上是无死锁的。
{"title":"Alice or Bob?: Process polymorphism in choreographies","authors":"EVA GRAVERSEN, ANDREW K. HIRSCH, FABRIZIO MONTESI","doi":"10.1017/s0956796823000114","DOIUrl":"https://doi.org/10.1017/s0956796823000114","url":null,"abstract":"We present PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline1.png\" /> <jats:tex-math> $lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>, a language for higher-order functional <jats:italic>choreographic programming</jats:italic>—an emerging paradigm for concurrent programming. In choreographic programming, programmers write the desired cooperative behaviour of a system of processes and then compile it into an implementation for each process, a translation called <jats:italic>endpoint projection</jats:italic>. Unlike its predecessor, Chor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline2.png\" /> <jats:tex-math> $lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>, PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline3.png\" /> <jats:tex-math> $lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> has both type and <jats:italic>process</jats:italic> polymorphism inspired by System F<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline4.png\" /> <jats:tex-math> $_omega$ </jats:tex-math> </jats:alternatives> </jats:inline-formula>. That is, PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline5.png\" /> <jats:tex-math> $lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> is the first (higher-order) functional choreographic language which gives programmers the ability to write generic choreographies and determine the participants at runtime. This novel combination of features also allows PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline6.png\" /> <jats:tex-math> $lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> processes to communicate <jats:italic>distributed values</jats:italic>, leading to a new and intuitive way to write delegation. While some of the functional features of PolyChor<jats:inline-formula> <jats:alternatives> <jats:inline-graphic xmlns:xlink=\"http://www.w3.org/1999/xlink\" mime-subtype=\"png\" xlink:href=\"S0956796823000114_inline7.png\" /> <jats:tex-math> $lambda$ </jats:tex-math> </jats:alternatives> </jats:inline-formula> give it a weaker correspondence between the semantics of choreographies and their endpoint-projected concurrent systems than some other choreographic languages, we still get the hallmark end result of choreographic programming: projected programmes are dead","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-01-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139561776","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
PhD Abstracts 博士论文摘要
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2024-01-05 DOI: 10.1017/S0956796823000138
Graham Hutton
Developing reliable software for the Internet of Things (IoT) is difficult because IoT systems are dynamic, interactive, distributed, collaborative, multi-tiered
为物联网 (IoT) 开发可靠的软件非常困难,因为物联网系统是动态的、交互的、分布式的、协作的、多层次的
{"title":"PhD Abstracts","authors":"Graham Hutton","doi":"10.1017/S0956796823000138","DOIUrl":"https://doi.org/10.1017/S0956796823000138","url":null,"abstract":"Developing reliable software for the Internet of Things (IoT) is difficult because IoT systems are dynamic, interactive, distributed, collaborative, multi-tiered","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2024-01-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"139381691","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
Trace contracts 跟踪合同
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2023-12-13 DOI: 10.1017/s0956796823000096
CAMERON MOY, MATTHIAS FELLEISEN

Behavioral software contracts allow programmers to strengthen the obligations and promises that they express with conventional types. They lack expressive power, though, when it comes to invariants that hold across several function calls. Trace contracts narrow this expressiveness gap. A trace contract is a predicate over the sequence of values that flow through function calls and returns. This paper presents a principled design, an implementation, and an evaluation of trace contracts.

行为软件契约允许程序员加强他们用传统类型表达的义务和承诺。不过,当涉及到在多次函数调用中保持不变时,行为软件合约就缺乏表现力了。跟踪合约缩小了这种表达能力上的差距。跟踪合约是对函数调用和返回值序列的谓词。本文介绍了跟踪合约的原理设计、实现和评估。
{"title":"Trace contracts","authors":"CAMERON MOY, MATTHIAS FELLEISEN","doi":"10.1017/s0956796823000096","DOIUrl":"https://doi.org/10.1017/s0956796823000096","url":null,"abstract":"<p>Behavioral software contracts allow programmers to strengthen the obligations and promises that they express with conventional types. They lack expressive power, though, when it comes to invariants that hold across several function calls. Trace contracts narrow this expressiveness gap. A trace contract is a predicate over the sequence of values that flow through function calls and returns. This paper presents a principled design, an implementation, and an evaluation of trace contracts.</p>","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2023-12-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138580519","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
Certified, total serialisers with an application to Huffman encoding 经过认证的总序列化器,应用于哈夫曼编码
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2023-12-12 DOI: 10.1017/s095679682200017x
RALF HINZE

The other day, I was assembling lecture material for a course on Agda. Pursuing an application-driven approach, I was looking for correctness proofs of popular algorithms. One of my all-time favourites is Huffman data compression (Huffman, 1952). Even though it is probably safe to assume that you are familiar with this algorithmic gem, a brief reminder of the essential idea may not be amiss.

前几天,我正在为一门关于 Agda 的课程准备授课材料。我采用应用驱动的方法,寻找流行算法的正确性证明。我最喜欢的算法之一是哈夫曼数据压缩法(Huffman,1952 年)。尽管可以肯定的是,你对这一算法瑰宝并不陌生,但简单提醒一下其基本思想也未尝不可。
{"title":"Certified, total serialisers with an application to Huffman encoding","authors":"RALF HINZE","doi":"10.1017/s095679682200017x","DOIUrl":"https://doi.org/10.1017/s095679682200017x","url":null,"abstract":"<p>The other day, I was assembling lecture material for a course on Agda. Pursuing an application-driven approach, I was looking for correctness proofs of popular algorithms. One of my all-time favourites is Huffman data compression (Huffman, 1952). Even though it is probably safe to assume that you are familiar with this algorithmic gem, a brief reminder of the essential idea may not be amiss.</p>","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2023-12-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138573957","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
Level-p-complexity of Boolean functions using thinning, memoization, and polynomials 利用稀疏化、记忆化和多项式实现布尔函数的平穷复杂性
IF 1.1 3区 计算机科学 Q4 Computer Science Pub Date : 2023-12-12 DOI: 10.1017/s0956796823000102
JULIA JANSSON, PATRIK JANSSON

This paper describes a purely functional library for computing level-p-complexity of Boolean functions and applies it to two-level iterated majority. Boolean functions are simply functions from n bits to one bit, and they can describe digital circuits, voting systems, etc. An example of a Boolean function is majority, which returns the value that has majority among the n input bits for odd n. The complexity of a Boolean function f measures the cost of evaluating it: how many bits of the input are needed to be certain about the result of f. There are many competing complexity measures, but we focus on level-p-complexity — a function of the probability p that a bit is 1. The level-p-complexity $D_p(f)$ is the minimum expected cost when the input bits are independent and identically distributed with Bernoulli(p) distribution. We specify the problem as choosing the minimum expected cost of all possible decision trees — which directly translates to a clearly correct, but very inefficient implementation. The library uses thinning and memoization for efficiency and type classes for separation of concerns. The complexity is represented using (sets of) polynomials, and the order relation used for thinning is implemented using polynomial factorization and root counting. Finally, we compute the complexity for two-level iterated majority and improve on an earlier result by J. Jansson.

本文描述了一个用于计算布尔函数级数-p 复杂性的纯函数库,并将其应用于两级迭代多数。布尔函数是简单的从 n 位到 1 位的函数,可以描述数字电路、投票系统等。布尔函数的一个例子是多数函数,它返回奇数 n 的 n 个输入比特中的多数值。布尔函数 f 的复杂度衡量的是求值的成本:需要多少比特的输入才能确定 f 的结果。有许多相互竞争的复杂度度量,但我们关注的是水平-比特复杂度--一个比特为 1 的概率 p 的函数。水平-比特复杂度 $D_p(f)$ 是当输入比特是独立且相同的伯努利(p)分布时的最小预期成本。我们将问题定义为从所有可能的决策树中选择最小的预期成本--这直接转化为一个明显正确但效率极低的实现方法。为了提高效率,库使用了精简和 memoization,并使用类型类来分离关注点。复杂度使用(多项式集)表示,而用于稀疏化的阶次关系则使用多项式因式分解和根计数来实现。最后,我们计算了两级迭代多数的复杂度,并改进了 J. Jansson 早期的一个结果。
{"title":"Level-p-complexity of Boolean functions using thinning, memoization, and polynomials","authors":"JULIA JANSSON, PATRIK JANSSON","doi":"10.1017/s0956796823000102","DOIUrl":"https://doi.org/10.1017/s0956796823000102","url":null,"abstract":"<p>This paper describes a purely functional library for computing level-<span>p</span>-complexity of Boolean functions and applies it to two-level iterated majority. Boolean functions are simply functions from <span>n</span> bits to one bit, and they can describe digital circuits, voting systems, etc. An example of a Boolean function is majority, which returns the value that has majority among the <span>n</span> input bits for odd <span>n</span>. The complexity of a Boolean function <span>f</span> measures the <span>cost</span> of evaluating it: how many bits of the input are needed to be certain about the result of <span>f</span>. There are many competing complexity measures, but we focus on level-<span>p</span>-complexity — a function of the probability <span>p</span> that a bit is 1. The level-<span>p</span>-complexity <span><span><img data-mimesubtype=\"png\" data-type=\"\" src=\"https://static.cambridge.org/binary/version/id/urn:cambridge.org:id:binary:20231209151452171-0101:S0956796823000102:S0956796823000102_inline1.png\"><span data-mathjax-type=\"texmath\"><span>$D_p(f)$</span></span></img></span></span> is the minimum expected cost when the input bits are independent and identically distributed with Bernoulli(<span>p</span>) distribution. We specify the problem as choosing the minimum expected cost of all possible decision trees — which directly translates to a clearly correct, but very inefficient implementation. The library uses thinning and memoization for efficiency and type classes for separation of concerns. The complexity is represented using (sets of) polynomials, and the order relation used for thinning is implemented using polynomial factorization and root counting. Finally, we compute the complexity for two-level iterated majority and improve on an earlier result by J. Jansson.</p>","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":null,"pages":null},"PeriodicalIF":1.1,"publicationDate":"2023-12-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"138573960","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