首页 > 最新文献

Proceedings of the 18th ACM SIGPLAN international conference on Functional programming最新文献

英文 中文
Experience report: functional programming of mHealth applications 经验报告:移动健康应用的函数式编程
C. Petersen, M. Görges, D. Dunsmuir, J. Ansermino, G. Dumont
A modular framework for the development of medical applications that promotes deterministic, robust and correct code is presented. The system is based on the portable Gambit Scheme programming language and provides a flexible cross-platform environment for developing graphical applications on mobile devices as well as medical instrumentation interfaces running on embedded platforms. Real world applications of this framework for mobile diagnostics, telemonitoring and automated drug infusions are reported. The source code for the core framework is open source and available at: https://github.com/part-cw/lambdanative.
提出了一种用于医学应用开发的模块化框架,该框架促进了代码的确定性、鲁棒性和正确性。该系统基于便携式Gambit Scheme编程语言,为开发移动设备上的图形应用程序以及运行在嵌入式平台上的医疗仪器接口提供了灵活的跨平台环境。报告了该框架在移动诊断、远程监测和自动药物输注方面的实际应用。核心框架的源代码是开源的,可以在https://github.com/part-cw/lambdanative上获得。
{"title":"Experience report: functional programming of mHealth applications","authors":"C. Petersen, M. Görges, D. Dunsmuir, J. Ansermino, G. Dumont","doi":"10.1145/2500365.2500615","DOIUrl":"https://doi.org/10.1145/2500365.2500615","url":null,"abstract":"A modular framework for the development of medical applications that promotes deterministic, robust and correct code is presented. The system is based on the portable Gambit Scheme programming language and provides a flexible cross-platform environment for developing graphical applications on mobile devices as well as medical instrumentation interfaces running on embedded platforms. Real world applications of this framework for mobile diagnostics, telemonitoring and automated drug infusions are reported. The source code for the core framework is open source and available at: https://github.com/part-cw/lambdanative.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"16 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"85027363","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 24
The bedrock structured programming system: combining generative metaprogramming and hoare logic in an extensible program verifier 基础结构化编程系统:在可扩展的程序验证器中结合生成元编程和hoare逻辑
A. Chlipala
We report on the design and implementation of an extensible programming language and its intrinsic support for formal verification. Our language is targeted at low-level programming of infrastructure like operating systems and runtime systems. It is based on a cross-platform core combining characteristics of assembly languages and compiler intermediate languages. From this foundation, we take literally the saying that C is a "macro assembly language": we introduce an expressive notion of certified low-level macros, sufficient to build up the usual features of C and beyond as macros with no special support in the core. Furthermore, our macros have integrated support for strongest postcondition calculation and verification condition generation, so that we can provide a high-productivity formal verification environment within Coq for programs composed from any combination of macros. Our macro interface is expressive enough to support features that low-level programs usually only access through external tools with no formal guarantees, such as declarative parsing or SQL-inspired querying. The abstraction level of these macros only imposes a compile-time cost, via the execution of functional Coq programs that compute programs in our intermediate language; but the run-time cost is not substantially greater than for more conventional C code. We describe our experiences constructing a full C-like language stack using macros, with some experiments on the verifiability and performance of individual programs running on that stack.
我们报告了可扩展编程语言的设计和实现及其对形式化验证的内在支持。我们的语言针对的是底层的基础设施编程,比如操作系统和运行时系统。它是基于一个跨平台的核心,结合了汇编语言和编译中间语言的特点。在此基础上,我们从字面上理解C是一种“宏汇编语言”的说法:我们引入了一个表达性的概念,即经过认证的低级宏,它足以构建C的常用特性,甚至可以作为宏,而在核心中没有特殊的支持。此外,我们的宏集成了对最强后置条件计算和验证条件生成的支持,因此我们可以在Coq中为由任意宏组合组成的程序提供高生产率的形式化验证环境。我们的宏接口具有足够的表现力,可以支持低级程序通常只能通过没有正式保证的外部工具访问的特性,例如声明性解析或sql启发的查询。这些宏的抽象层通过执行用中间语言计算程序的Coq函数程序,只施加了编译时成本;但是运行时成本并不比更传统的C代码高多少。我们描述了使用宏构建完整的类c语言堆栈的经验,并对在该堆栈上运行的单个程序的可验证性和性能进行了一些实验。
{"title":"The bedrock structured programming system: combining generative metaprogramming and hoare logic in an extensible program verifier","authors":"A. Chlipala","doi":"10.1145/2500365.2500592","DOIUrl":"https://doi.org/10.1145/2500365.2500592","url":null,"abstract":"We report on the design and implementation of an extensible programming language and its intrinsic support for formal verification. Our language is targeted at low-level programming of infrastructure like operating systems and runtime systems. It is based on a cross-platform core combining characteristics of assembly languages and compiler intermediate languages. From this foundation, we take literally the saying that C is a \"macro assembly language\": we introduce an expressive notion of certified low-level macros, sufficient to build up the usual features of C and beyond as macros with no special support in the core. Furthermore, our macros have integrated support for strongest postcondition calculation and verification condition generation, so that we can provide a high-productivity formal verification environment within Coq for programs composed from any combination of macros. Our macro interface is expressive enough to support features that low-level programs usually only access through external tools with no formal guarantees, such as declarative parsing or SQL-inspired querying. The abstraction level of these macros only imposes a compile-time cost, via the execution of functional Coq programs that compute programs in our intermediate language; but the run-time cost is not substantially greater than for more conventional C code. We describe our experiences constructing a full C-like language stack using macros, with some experiments on the verifiability and performance of individual programs running on that stack.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"20 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"84933973","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 108
Calculating threesomes, with blame 算计三人行,带着责备
Ronald Garcia
Coercions and threesomes both enable a language to combine static and dynamic types while avoiding cast-based space leaks. Coercion calculi elegantly specify space-efficient cast behavior, even when augmented with blame tracking, but implementing their semantics directly is difficult. Threesomes, on the other hand, have a straightforward recursive implementation, but endowing them with blame tracking is challenging. In this paper, we show that you can use that elegant spec to produce that straightforward implementation: we use the coercion calculus to derive threesomes with blame. In particular, we construct novel threesome calculi for blame tracking strategies that detect errors earlier, catch more errors, and reflect an intuitive conception of safe and unsafe casts based on traditional subtyping.
强制转换和三元转换都使语言能够结合静态和动态类型,同时避免基于强制转换的空间泄漏。强制演算优雅地指定了空间效率高的强制转换行为,即使在增加了责任跟踪的情况下也是如此,但是直接实现它们的语义是困难的。另一方面,三人游戏具有直接的递归实现,但赋予它们责任跟踪功能是具有挑战性的。在本文中,我们展示了您可以使用优雅的规范来生成直接的实现:我们使用强制演算来派生带有责备的三人组。特别地,我们构建了新的三人演算用于责任跟踪策略,该策略可以更早地检测错误,捕获更多错误,并反映基于传统子类型的安全和不安全强制转换的直观概念。
{"title":"Calculating threesomes, with blame","authors":"Ronald Garcia","doi":"10.1145/2500365.2500603","DOIUrl":"https://doi.org/10.1145/2500365.2500603","url":null,"abstract":"Coercions and threesomes both enable a language to combine static and dynamic types while avoiding cast-based space leaks. Coercion calculi elegantly specify space-efficient cast behavior, even when augmented with blame tracking, but implementing their semantics directly is difficult. Threesomes, on the other hand, have a straightforward recursive implementation, but endowing them with blame tracking is challenging. In this paper, we show that you can use that elegant spec to produce that straightforward implementation: we use the coercion calculus to derive threesomes with blame. In particular, we construct novel threesome calculi for blame tracking strategies that detect errors earlier, catch more errors, and reflect an intuitive conception of safe and unsafe casts based on traditional subtyping.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"14 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"88617209","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 31
Functional geometry and the Traité de Lutherie: functional pearl 功能几何与卢瑟里特征:功能珍珠
Harry G. Mairson
We describe a functional programming approach to the design of outlines of eighteenth-century string instruments. The approach is based on the research described in François Denis's book, Traité de lutherie. The programming vernacular for Denis's instructions, which we call functional geometry, is meant to reiterate the historically justified language and techniques of this musical instrument design. The programming metaphor is entirely Euclidean, involving straightedge and compass constructions, with few (if any) numbers, and no Cartesian equations or grid. As such, it is also an interesting approach to teaching programming and mathematics without numerical calculation or equational reasoning. The advantage of this language-based, functional approach to lutherie is founded in the abstract characterization of common patterns in instrument design. These patterns include not only the abstraction of common straightedge and compass constructions, but of higher-order conceptualization of the instrument design process. We also discuss the role of arithmetic, geometric, harmonic, and subharmonic proportions, and the use of their rational approximants.
我们描述了一种函数式编程方法来设计18世纪弦乐器的轮廓。这种方法是基于弗朗索瓦·丹尼斯(francois Denis)的书《鲁特理论》(trait de lutherie)中所描述的研究。丹尼斯指令的编程语言,我们称之为功能几何,旨在重申这种乐器设计的历史合理的语言和技术。编程的隐喻完全是欧几里得式的,包括直线和罗盘结构,很少(如果有的话)数字,没有笛卡尔方程或网格。因此,它也是一种有趣的方法来教授编程和数学,而不需要数值计算或方程推理。这种基于语言的功能方法的优势是建立在乐器设计中常见模式的抽象表征上。这些模式不仅包括对普通直尺和罗盘结构的抽象,还包括对仪器设计过程的高阶概念化。我们还讨论了算术比例、几何比例、调和比例和次调和比例的作用,以及它们的有理近似的使用。
{"title":"Functional geometry and the Traité de Lutherie: functional pearl","authors":"Harry G. Mairson","doi":"10.1145/2500365.2500617","DOIUrl":"https://doi.org/10.1145/2500365.2500617","url":null,"abstract":"We describe a functional programming approach to the design of outlines of eighteenth-century string instruments. The approach is based on the research described in François Denis's book, Traité de lutherie. The programming vernacular for Denis's instructions, which we call functional geometry, is meant to reiterate the historically justified language and techniques of this musical instrument design. The programming metaphor is entirely Euclidean, involving straightedge and compass constructions, with few (if any) numbers, and no Cartesian equations or grid. As such, it is also an interesting approach to teaching programming and mathematics without numerical calculation or equational reasoning. The advantage of this language-based, functional approach to lutherie is founded in the abstract characterization of common patterns in instrument design. These patterns include not only the abstraction of common straightedge and compass constructions, but of higher-order conceptualization of the instrument design process. We also discuss the role of arithmetic, geometric, harmonic, and subharmonic proportions, and the use of their rational approximants.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"47 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"88565047","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 4
System FC with explicit kind equality 具有显式类相等的系统FC
Stephanie Weirich, Justin Hsu, R. Eisenberg
System FC, the core language of the Glasgow Haskell Compiler, is an explicitly-typed variant of System F with first-class type equality proofs called coercions. This extensible proof system forms the foundation for type system extensions such as type families (type-level functions) and Generalized Algebraic Datatypes (GADTs). Such features, in conjunction with kind polymorphism and datatype promotion, support expressive compile-time reasoning. However, the core language lacks explicit kind equality proofs. As a result, type-level computation does not have access to kind-level functions or promoted GADTs, the type-level analogues to expression-level features that have been so useful. In this paper, we eliminate such discrepancies by introducing kind equalities to System FC. Our approach is based on dependent type systems with heterogeneous equality and the "Type-in-Type" axiom, yet it preserves the metatheoretic properties of FC. In particular, type checking is simple, decidable and syntax directed. We prove the preservation and progress theorems for the extended language.
System FC是格拉斯哥Haskell编译器的核心语言,是System F的显式类型变体,具有称为强制的一等类型相等证明。这个可扩展的证明系统构成了类型系统扩展的基础,例如类型族(类型级函数)和广义代数数据类型(gadt)。这些特性与种类多态性和数据类型提升结合在一起,支持表达性编译时推理。然而,核心语言缺乏明确的类相等证明。因此,类型级计算不能访问类型级函数或提升的gadt,类型级类似于非常有用的表达式级特性。在本文中,我们通过在系统FC中引入类等式来消除这种差异。我们的方法基于具有异构相等的依赖类型系统和“类型中的类型”公理,但它保留了FC的元理论性质。特别是,类型检查是简单的、可确定的和有语法指导的。我们证明了扩展语言的保存定理和进展定理。
{"title":"System FC with explicit kind equality","authors":"Stephanie Weirich, Justin Hsu, R. Eisenberg","doi":"10.1145/2500365.2500599","DOIUrl":"https://doi.org/10.1145/2500365.2500599","url":null,"abstract":"System FC, the core language of the Glasgow Haskell Compiler, is an explicitly-typed variant of System F with first-class type equality proofs called coercions. This extensible proof system forms the foundation for type system extensions such as type families (type-level functions) and Generalized Algebraic Datatypes (GADTs). Such features, in conjunction with kind polymorphism and datatype promotion, support expressive compile-time reasoning. However, the core language lacks explicit kind equality proofs. As a result, type-level computation does not have access to kind-level functions or promoted GADTs, the type-level analogues to expression-level features that have been so useful. In this paper, we eliminate such discrepancies by introducing kind equalities to System FC. Our approach is based on dependent type systems with heterogeneous equality and the \"Type-in-Type\" axiom, yet it preserves the metatheoretic properties of FC. In particular, type checking is simple, decidable and syntax directed. We prove the preservation and progress theorems for the extended language.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"21 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"85867788","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 49
Optimising purely functional GPU programs 优化纯功能GPU程序
T. L. McDonell
Purely functional, embedded array programs are a good match for SIMD hardware, such as GPUs. However, the naive compilation of such programs quickly leads to both code explosion and an excessive use of intermediate data structures. The resulting slow-down is not acceptable on target hardware that is usually chosen to achieve high performance. In this paper, we discuss two optimisation techniques, sharing recovery and array fusion, that tackle code explosion and eliminate superfluous intermediate structures. Both techniques are well known from other contexts, but they present unique challenges for an embedded language compiled for execution on a GPU. We present novel methods for implementing sharing recovery and array fusion, and demonstrate their effectiveness on a set of benchmarks.
纯功能的嵌入式数组程序非常适合SIMD硬件,例如gpu。然而,这种程序的幼稚编译很快就会导致代码爆炸和过度使用中间数据结构。在目标硬件上产生的慢速是不可接受的,通常选择目标硬件是为了实现高性能。在本文中,我们讨论了两种优化技术,共享恢复和阵列融合,以解决代码爆炸和消除多余的中间结构。这两种技术在其他环境中都是众所周知的,但它们对在GPU上执行编译的嵌入式语言提出了独特的挑战。我们提出了实现共享恢复和阵列融合的新方法,并在一组基准上证明了它们的有效性。
{"title":"Optimising purely functional GPU programs","authors":"T. L. McDonell","doi":"10.1145/2500365.2500595","DOIUrl":"https://doi.org/10.1145/2500365.2500595","url":null,"abstract":"Purely functional, embedded array programs are a good match for SIMD hardware, such as GPUs. However, the naive compilation of such programs quickly leads to both code explosion and an excessive use of intermediate data structures. The resulting slow-down is not acceptable on target hardware that is usually chosen to achieve high performance. In this paper, we discuss two optimisation techniques, sharing recovery and array fusion, that tackle code explosion and eliminate superfluous intermediate structures. Both techniques are well known from other contexts, but they present unique challenges for an embedded language compiled for execution on a GPU. We present novel methods for implementing sharing recovery and array fusion, and demonstrate their effectiveness on a set of benchmarks.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"3 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"88380283","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 97
A nanopass framework for commercial compiler development 用于商业编译器开发的纳米框架
Andrew W. Keep, R. Dybvig
Contemporary compilers must typically handle sophisticated high-level source languages, generate efficient code for multiple hardware architectures and operating systems, and support source-level debugging, profiling, and other program development tools. As a result, compilers tend to be among the most complex of software systems. Nanopass frameworks are designed to help manage this complexity. A nanopass compiler is comprised of many single-task passes with formally defined intermediate languages. The perceived downside of a nanopass compiler is that the extra passes will lead to substantially longer compilation times. To determine whether this is the case, we have created a plug replacement for the commercial Chez Scheme compiler, implemented using an updated nanopass framework, and we have compared the speed of the new compiler and the code it generates against the original compiler for a large set of benchmark programs. This paper describes the updated nanopass framework, the new compiler, and the results of our experiments. The compiler produces faster code than the original, averaging 15-27% depending on architecture and optimization level, due to a more sophisticated but slower register allocator and improvements to several optimizations. Compilation times average well within a factor of two of the original compiler, despite the slower register allocator and the replacement of five passes of the original 10 with over 50 nanopasses.
现代编译器通常必须处理复杂的高级源语言,为多种硬件体系结构和操作系统生成高效的代码,并支持源级调试、分析和其他程序开发工具。因此,编译器往往是最复杂的软件系统之一。纳米ass框架旨在帮助管理这种复杂性。纳米通道编译器由许多具有正式定义的中间语言的单任务通道组成。纳米通道编译器的缺点是额外的通道将导致更长的编译时间。为了确定情况是否如此,我们为商业Chez Scheme编译器创建了一个插件替代品,使用更新的纳米ass框架实现,我们将新编译器的速度及其生成的代码与大量基准程序的原始编译器进行了比较。本文介绍了更新的纳米ass框架,新的编译器,以及我们的实验结果。编译器生成的代码比原始代码快,根据体系结构和优化级别的不同,平均速度为15-27%,这是由于使用了更复杂但更慢的寄存器分配器以及对若干优化的改进。编译时间平均在原始编译器的两倍之内,尽管寄存器分配器较慢,并且用超过50个纳米粒子替换了原来10次中的5次。
{"title":"A nanopass framework for commercial compiler development","authors":"Andrew W. Keep, R. Dybvig","doi":"10.1145/2500365.2500618","DOIUrl":"https://doi.org/10.1145/2500365.2500618","url":null,"abstract":"Contemporary compilers must typically handle sophisticated high-level source languages, generate efficient code for multiple hardware architectures and operating systems, and support source-level debugging, profiling, and other program development tools. As a result, compilers tend to be among the most complex of software systems. Nanopass frameworks are designed to help manage this complexity. A nanopass compiler is comprised of many single-task passes with formally defined intermediate languages. The perceived downside of a nanopass compiler is that the extra passes will lead to substantially longer compilation times. To determine whether this is the case, we have created a plug replacement for the commercial Chez Scheme compiler, implemented using an updated nanopass framework, and we have compared the speed of the new compiler and the code it generates against the original compiler for a large set of benchmark programs. This paper describes the updated nanopass framework, the new compiler, and the results of our experiments. The compiler produces faster code than the original, averaging 15-27% depending on architecture and optimization level, due to a more sophisticated but slower register allocator and improvements to several optimizations. Compilation times average well within a factor of two of the original compiler, despite the slower register allocator and the replacement of five passes of the original 10 with over 50 nanopasses.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"7 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"83220427","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 28
Verified decision procedures for MSO on words based on derivatives of regular expressions 验证了基于正则表达式导数的词的MSO决策程序
Dmitriy Traytel, T. Nipkow
Monadic second-order logic on finite words (MSO) is a decidable yet expressive logic into which many decision problems can be encoded. Since MSO formulas correspond to regular languages, equivalence of MSO formulas can be reduced to the equivalence of some regular structures (e.g. automata). This paper presents a verified functional decision procedure for MSO formulas that is not based on automata but on regular expressions. Functional languages are ideally suited for this task: regular expressions are data types and functions on them are defined by pattern matching and recursion and are verified by structural induction. Decision procedures for regular expression equivalence have been formalized before, usually based on Brzozowski derivatives. Yet, for a straightforward embedding of MSO formulas into regular expressions an extension of regular expressions with a projection operation is required. We prove total correctness and completeness of an equivalence checker for regular expressions extended in that way. We also define a language-preserving translation of formulas into regular expressions with respect to two different semantics of MSO. Our results have been formalized and verified in the theorem prover Isabelle. Using Isabelle's code generation facility, this yields purely functional, formally verified programs that decide equivalence of MSO formulas.
有限字一元二阶逻辑(MSO)是一种可决定的、可表达的逻辑,许多决策问题都可以用它来编码。由于MSO公式对应于规则语言,因此MSO公式的等价可以简化为一些规则结构(例如自动机)的等价。本文提出了一个经过验证的基于正则表达式而非自动机的MSO公式的函数决策过程。函数式语言非常适合此任务:正则表达式是数据类型,其上的函数由模式匹配和递归定义,并通过结构归纳法进行验证。正则表达式等价的决策过程以前已经形式化,通常基于Brzozowski导数。然而,为了将MSO公式直接嵌入到正则表达式中,需要使用投影操作对正则表达式进行扩展。我们证明了以这种方式扩展正则表达式的等价检查器的完全正确性和完备性。我们还针对MSO的两种不同语义定义了一种保持语言的将公式转换为正则表达式的方法。我们的结果已经在定理证明者Isabelle中被形式化并验证了。使用Isabelle的代码生成工具,这将产生纯功能的、经过正式验证的程序,以确定MSO公式的等价性。
{"title":"Verified decision procedures for MSO on words based on derivatives of regular expressions","authors":"Dmitriy Traytel, T. Nipkow","doi":"10.1145/2500365.2500612","DOIUrl":"https://doi.org/10.1145/2500365.2500612","url":null,"abstract":"Monadic second-order logic on finite words (MSO) is a decidable yet expressive logic into which many decision problems can be encoded. Since MSO formulas correspond to regular languages, equivalence of MSO formulas can be reduced to the equivalence of some regular structures (e.g. automata). This paper presents a verified functional decision procedure for MSO formulas that is not based on automata but on regular expressions. Functional languages are ideally suited for this task: regular expressions are data types and functions on them are defined by pattern matching and recursion and are verified by structural induction. Decision procedures for regular expression equivalence have been formalized before, usually based on Brzozowski derivatives. Yet, for a straightforward embedding of MSO formulas into regular expressions an extension of regular expressions with a projection operation is required. We prove total correctness and completeness of an equivalence checker for regular expressions extended in that way. We also define a language-preserving translation of formulas into regular expressions with respect to two different semantics of MSO. Our results have been formalized and verified in the theorem prover Isabelle. Using Isabelle's code generation facility, this yields purely functional, formally verified programs that decide equivalence of MSO formulas.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"7 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"89975260","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 13
Productive coprogramming with guarded recursion 带保护递归的高效协同编程
R. Atkey, Conor McBride
Total functional programming offers the beguiling vision that, just by virtue of the compiler accepting a program, we are guaranteed that it will always terminate. In the case of programs that are not intended to terminate, e.g., servers, we are guaranteed that programs will always be productive. Productivity means that, even if a program generates an infinite amount of data, each piece will be generated in finite time. The theoretical underpinning for productive programming with infinite output is provided by the category theoretic notion of final coalgebras. Hence, we speak of coprogramming with non-well-founded codata, as a dual to programming with well-founded data like finite lists and trees. Systems that offer facilities for productive coprogramming, such as the proof assistants Coq and Agda, currently do so through syntactic guardedness checkers. Syntactic guardedness checkers ensure that all self-recursive calls are guarded by a use of a constructor. Such a check ensures productivity. Unfortunately, these syntactic checks are not compositional, and severely complicate coprogramming. Guarded recursion, originally due to Nakano, is tantalising as a basis for a flexible and compositional type-based approach to coprogramming. However, as we show, by itself, guarded recursion is not suitable for coprogramming due to the fact that there is no way to make finite observations on pieces of infinite data. In this paper, we introduce the concept of clock variables that index Nakano's guarded recursion. Clock variables allow us to "close over" the generation of infinite data, and to make finite observations, something that is not possible with guarded recursion alone.
完全函数式编程提供了一种诱人的愿景,即只要编译器接受一个程序,我们就可以保证它总是会终止。对于不打算终止的程序,例如服务器,我们可以保证程序始终是高效的。生产力意味着,即使一个程序产生无限数量的数据,每个片段也将在有限的时间内生成。最终余代数的范畴论概念为具有无穷输出的生产性规划提供了理论基础。因此,我们将使用无充分根据的协数据进行协同编程,作为使用有限列表和树等充分根据的数据进行编程的对偶。提供高效协同编程功能的系统,如证明助手Coq和Agda,目前都是通过语法保护检查器来实现的。语法保护检查器确保使用构造函数保护所有自递归调用。这样的检查确保了生产力。不幸的是,这些语法检查不是组合的,并且严重复杂化了协同编程。保护递归最初是由Nakano提出的,它是一种灵活的、基于组合类型的协同编程方法的基础。然而,正如我们所展示的,保护递归本身并不适合于协同编程,因为没有办法对无限数据块进行有限的观察。本文引入了索引Nakano保护递归的时钟变量的概念。时钟变量允许我们“关闭”无限数据的生成,并进行有限的观察,这是单独使用保护递归无法实现的。
{"title":"Productive coprogramming with guarded recursion","authors":"R. Atkey, Conor McBride","doi":"10.1145/2500365.2500597","DOIUrl":"https://doi.org/10.1145/2500365.2500597","url":null,"abstract":"Total functional programming offers the beguiling vision that, just by virtue of the compiler accepting a program, we are guaranteed that it will always terminate. In the case of programs that are not intended to terminate, e.g., servers, we are guaranteed that programs will always be productive. Productivity means that, even if a program generates an infinite amount of data, each piece will be generated in finite time. The theoretical underpinning for productive programming with infinite output is provided by the category theoretic notion of final coalgebras. Hence, we speak of coprogramming with non-well-founded codata, as a dual to programming with well-founded data like finite lists and trees. Systems that offer facilities for productive coprogramming, such as the proof assistants Coq and Agda, currently do so through syntactic guardedness checkers. Syntactic guardedness checkers ensure that all self-recursive calls are guarded by a use of a constructor. Such a check ensures productivity. Unfortunately, these syntactic checks are not compositional, and severely complicate coprogramming. Guarded recursion, originally due to Nakano, is tantalising as a basis for a flexible and compositional type-based approach to coprogramming. However, as we show, by itself, guarded recursion is not suitable for coprogramming due to the fact that there is no way to make finite observations on pieces of infinite data. In this paper, we introduce the concept of clock variables that index Nakano's guarded recursion. Clock variables allow us to \"close over\" the generation of infinite data, and to make finite observations, something that is not possible with guarded recursion alone.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"6 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"74045946","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 88
Functional reactive programming with liveness guarantees 具有活动性保证的函数式响应式编程
A. Jeffrey
Functional Reactive Programming (FRP) is an approach to the development of reactive systems which provides a pure functional interface, but which may be implemented as an abstraction of an imperative event-driven layer. FRP systems typically provide a model of behaviours (total time-indexed values, implemented as pull systems) and event sources (partial time-indexed values, implemented as push systems). In this paper, we investigate a type system for event-driven FRP programs which provide liveness guarantees, that is every input event is guaranteed to generate an output event. We show that FRP can be implemented on top of a model of sets and relations, and that the isomorphism between event sources and behaviours corresponds to the isomorphism between relations and set-valued functions. We then implement sets and relations using a model of continuations using the usual double-negation CPS transform. The implementation of behaviours as pull systems based on futures, and of event sources as push systems based on the observer pattern, thus arises from first principles. We also discuss a Java implementation of the FRP model.
函数式响应式编程(FRP)是一种开发响应式系统的方法,它提供了纯功能接口,但可以作为命令式事件驱动层的抽象来实现。FRP系统通常提供行为模型(总时间指标值,作为拉系统实现)和事件源模型(部分时间指标值,作为推系统实现)。在本文中,我们研究了一个事件驱动FRP程序的类型系统,它提供了活动性保证,即每个输入事件都保证产生一个输出事件。我们证明FRP可以在集合和关系的模型之上实现,并且事件源和行为之间的同构对应于关系和集值函数之间的同构。然后,我们使用使用通常的双否定CPS转换的延续模型来实现集合和关系。将行为实现为基于未来的拉系统,将事件源实现为基于观察者模式的推系统,这些都源于第一原则。我们还讨论了FRP模型的Java实现。
{"title":"Functional reactive programming with liveness guarantees","authors":"A. Jeffrey","doi":"10.1145/2500365.2500584","DOIUrl":"https://doi.org/10.1145/2500365.2500584","url":null,"abstract":"Functional Reactive Programming (FRP) is an approach to the development of reactive systems which provides a pure functional interface, but which may be implemented as an abstraction of an imperative event-driven layer. FRP systems typically provide a model of behaviours (total time-indexed values, implemented as pull systems) and event sources (partial time-indexed values, implemented as push systems). In this paper, we investigate a type system for event-driven FRP programs which provide liveness guarantees, that is every input event is guaranteed to generate an output event. We show that FRP can be implemented on top of a model of sets and relations, and that the isomorphism between event sources and behaviours corresponds to the isomorphism between relations and set-valued functions. We then implement sets and relations using a model of continuations using the usual double-negation CPS transform. The implementation of behaviours as pull systems based on futures, and of event sources as push systems based on the observer pattern, thus arises from first principles. We also discuss a Java implementation of the FRP model.","PeriodicalId":20504,"journal":{"name":"Proceedings of the 18th ACM SIGPLAN international conference on Functional programming","volume":"67 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2013-09-25","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"78094382","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 12
期刊
Proceedings of the 18th ACM SIGPLAN international conference on 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