Journal of Functional Programming最新文献

筛选
英文 中文
Runtime verification and validation of functional reactive systems 功能反应系统的运行时验证和确认
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-26 DOI: 10.1017/S0956796820000210
Ivan Perez, H. Nilsson
{"title":"Runtime verification and validation of functional reactive systems","authors":"Ivan Perez, H. Nilsson","doi":"10.1017/S0956796820000210","DOIUrl":"https://doi.org/10.1017/S0956796820000210","url":null,"abstract":"Abstract Many types of interactive applications, including reactive systems implemented in hardware, interactive physics simulations and games, raise particular challenges when it comes to testing and debugging. Reasons include de facto lack of reproducibility and difficulties of automatically generating suitable test data. This paper demonstrates that certain variants of functional reactive programming (FRP) implemented in pure functional languages can mitigate such difficulties by offering referential transparency at the level of whole programs. This opens up for a multi-pronged approach for assisting with testing and debugging that works across platforms, including assertions based on temporal logic, recording and replaying of runs (also from deployed code), and automated random testing using QuickCheck. When combined with extensible forms of FRP that allow for constrained side effects, it allows us to not only validate software simulations but to analyse the effect of faults in reactive systems, confirm the efficacy of fault tolerance mechanisms and perform software- and hardware-in-the-loop testing. The approach has been validated on non-trivial systems implemented in several existing FRP implementations, by means of careful debugging using a tool that allows the test or simulation under scrutiny to be controlled, moving along the execution time line, and pin-pointing of violations of assertions on personal computers as well as external devices.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-26","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000210","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"46098103","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}
引用次数: 2
Typed dataspace actors 类型化数据空间角色
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-24 DOI: 10.1017/S0956796820000246
Sam Caldwell, Tony Garnock-Jones, M. Felleisen
{"title":"Typed dataspace actors","authors":"Sam Caldwell, Tony Garnock-Jones, M. Felleisen","doi":"10.1017/S0956796820000246","DOIUrl":"https://doi.org/10.1017/S0956796820000246","url":null,"abstract":"Video Abstract Absatract Actors collaborate via message exchanges to reach a common goal. Experience has shown, however, that pure message-based communication is limiting and forces developers to use design patterns. The recently introduced dataspace actor model borrows ideas from the tuple space realm. It offers a tightly controlled, shared storage facility for groups of actors. In this model, actors assert facts that they wish to share and interests in such assertions. The dataspace notifies interested parties of changes to the set of assertions that they are interested in. Although it is straightforward to add the dataspace model to untyped languages, adding a typed interface is both necessary and challenging. Without restrictions on exchanged data, a faulty actor may propagate erroneous data through a malformed assertion, causing an otherwise well-behaved actor to crash—violating the key principle of failure isolation. A properly designed type system can prevent this scenario and rule out other kinds of uncooperative actors. This paper presents the first structural type system for the dataspace model of actors; it does not address the question of behavioral types for assertion-oriented protocols.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000246","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"47409804","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
Elastic sheet-defined functions: Generalising spreadsheet functions to variable-size input arrays 弹性工作表定义函数:将电子表格函数泛化为可变大小的输入数组
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-21 DOI: 10.1017/S0956796820000234
Matt McCutchen, J. Borghouts, A. Gordon, Simon Peyton Jones, Advait Sarkar
{"title":"Elastic sheet-defined functions: Generalising spreadsheet functions to variable-size input arrays","authors":"Matt McCutchen, J. Borghouts, A. Gordon, Simon Peyton Jones, Advait Sarkar","doi":"10.1017/S0956796820000234","DOIUrl":"https://doi.org/10.1017/S0956796820000234","url":null,"abstract":"Abstract Sheet-defined functions (SDFs) bring modularity and abstraction to the world of spreadsheets. Alas, end users naturally write SDFs that work over fixed-size arrays, which limits their reusability. To help end user programmers write more reusable SDFs, we describe a principled approach to generalising such functions to become elastic SDFs that work over inputs of arbitrary size. We prove that under natural, checkable conditions, our algorithm returns the principal generalisation of an input SDF. We describe a formal semantics and several efficient implementation strategies for elastic SDFs. A user study with spreadsheet users compares the human experience of programming with elastic SDFs to the alternative of relying on array-processing combinators. Our user study finds that the cognitive load of elastic SDFs is lower than for SDFs with map/reduce array combinators, the closest alternative solution.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000234","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"44787791","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
Calculating correct compilers II: Return of the register machines 计算正确编译器II:寄存器机的返回
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-20 DOI: 10.1017/S0956796820000209
P. Bahr, G. Hutton
{"title":"Calculating correct compilers II: Return of the register machines","authors":"P. Bahr, G. Hutton","doi":"10.1017/S0956796820000209","DOIUrl":"https://doi.org/10.1017/S0956796820000209","url":null,"abstract":"Abstract In ‘Calculating Correct Compilers’ (Bahr & Hutton, 2015), we developed a new approach to calculating compilers directly from specifications of their correctness. Our approach only required elementary reasoning techniques and has been used to calculate compilers for a wide range of language features and their combination. However, the methodology was focused on stack-based target machines, whereas real compilers often target register-based machines. In this article, we show how our approach can naturally be adapted to calculate compilers for register machines.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":"6 2","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000209","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"41308693","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}
引用次数: 6
A focused solution to the avoidance problem 有针对性地解决回避问题
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-06 DOI: 10.1017/S0956796820000222
Karl Crary
{"title":"A focused solution to the avoidance problem","authors":"Karl Crary","doi":"10.1017/S0956796820000222","DOIUrl":"https://doi.org/10.1017/S0956796820000222","url":null,"abstract":"Abstract In ML-style module type theory, sealing often leads to situations in which type variables must leave scope, and this creates a need for signatures that avoid such variables. Unfortunately, in general, there is no best signature that avoids a variable, so modules do not always enjoy principal signatures. This observation is called the avoidance problem. In the past, the problem has been circumvented using a variety of devices for moving variables so they can remain in scope. These devices work, but have heretofore lacked a logical foundation. They have also lacked a presentation in which the dynamic semantics is given on the same phrases as the static semantics, which limits their applications. We can provide a best supersignature avoiding a variable by fiat, by adding an existential signature that is the least upper bound of its instances. This idea is old, but a workable metatheory has not previously been worked out. This work resolves the metatheoretic issues using ideas borrowed from focused logic. We show that the new theory results in a type discipline very similar to the aforementioned devices used in prior work. In passing, this gives a type-theoretic justification for the generative stamps used in the early days of the static semantics of ML modules. All the proofs are formalized in Coq.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000222","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48630942","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}
引用次数: 2
Extensional equality preservation and verified generic programming 可扩展的等式保持和已验证的泛型编程
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-05 DOI: 10.1017/S0956796821000204
N. Botta, N. Brede, Patrik Jansson, T. Richter
{"title":"Extensional equality preservation and verified generic programming","authors":"N. Botta, N. Brede, Patrik Jansson, T. Richter","doi":"10.1017/S0956796821000204","DOIUrl":"https://doi.org/10.1017/S0956796821000204","url":null,"abstract":"Abstract In verified generic programming, one cannot exploit the structure of concrete data types but has to rely on well chosen sets of specifications or abstract data types (ADTs). Functors and monads are at the core of many applications of functional programming. This raises the question of what useful ADTs for verified functors and monads could look like. The functorial map of many important monads preserves extensional equality. For instance, if \u0000$$f,g , : , A , to , B$$\u0000 are extensionally equal, that is, \u0000$$forall x in A$$\u0000 , \u0000$$f , x = g , x$$\u0000 , then \u0000$$map , f , : , List , A to List , B$$\u0000 and \u0000$$map , g$$\u0000 are also extensionally equal. This suggests that preservation of extensional equality could be a useful principle in verified generic programming. We explore this possibility with a minimalist approach: we deal with (the lack of) extensional equality in Martin-Löf’s intensional type theories without extending the theories or using full-fledged setoids. Perhaps surprisingly, this minimal approach turns out to be extremely useful. It allows one to derive simple generic proofs of monadic laws but also verified, generic results in dynamical systems and control theory. In turn, these results avoid tedious code duplication and ad-hoc proofs. Thus, our work is a contribution toward pragmatic, verified generic programming.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48085308","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}
引用次数: 4
On the correctness of monadic backward induction 关于一元后向归纳法的正确性
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-08-05 DOI: 10.1017/S0956796821000228
N. Brede, N. Botta
{"title":"On the correctness of monadic backward induction","authors":"N. Brede, N. Botta","doi":"10.1017/S0956796821000228","DOIUrl":"https://doi.org/10.1017/S0956796821000228","url":null,"abstract":"Abstract In control theory, to solve a finite-horizon sequential decision problem (SDP) commonly means to find a list of decision rules that result in an optimal expected total reward (or cost) when taking a given number of decision steps. SDPs are routinely solved using Bellman’s backward induction. Textbook authors (e.g. Bertsekas or Puterman) typically give more or less formal proofs to show that the backward induction algorithm is correct as solution method for deterministic and stochastic SDPs. Botta, Jansson and Ionescu propose a generic framework for finite horizon, monadic SDPs together with a monadic version of backward induction for solving such SDPs. In monadic SDPs, the monad captures a generic notion of uncertainty, while a generic measure function aggregates rewards. In the present paper, we define a notion of correctness for monadic SDPs and identify three conditions that allow us to prove a correctness result for monadic backward induction that is comparable to textbook correctness proofs for ordinary backward induction. The conditions that we impose are fairly general and can be cast in category-theoretical terms using the notion of Eilenberg–Moore algebra. They hold in familiar settings like those of deterministic or stochastic SDPs, but we also give examples in which they fail. Our results show that backward induction can safely be employed for a broader class of SDPs than usually treated in textbooks. However, they also rule out certain instances that were considered admissible in the context of Botta et al. ’s generic framework. Our development is formalised in Idris as an extension of the Botta et al. framework and the sources are available as supplementary material.","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-08-05","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"49597401","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}
引用次数: 3
Generalized monoidal effects and handlers 广义单模态效应及其处理方法
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-07-28 DOI: 10.1017/S0956796820000106
Ruben P. Pieters, Exequiel Rivas, T. Schrijvers
{"title":"Generalized monoidal effects and handlers","authors":"Ruben P. Pieters, Exequiel Rivas, T. Schrijvers","doi":"10.1017/S0956796820000106","DOIUrl":"https://doi.org/10.1017/S0956796820000106","url":null,"abstract":"Abstract Algebraic effects and handlers are a convenient method for structuring monadic effects with primitive effectful operations and separating the syntax from the interpretation of these operations. However, the scope of conventional handlers is limited as not all side effects are monadic in nature. This paper generalizes the notion of algebraic effects and handlers from monads to generalized monoids, which notably covers applicative functors and arrows as well as monads. For this purpose, we switch the category theoretical basis from free algebras to free monoids. In addition, we show how lax monoidal functors enable the reuse of handlers and programs across different computation classes, for example, handling applicative computations with monadic handlers. We motivate and present these handler interfaces in the context of build systems. Tasks in a build system are represented by a free computation and their interpretation as a handler. This use case is based on the work of Mokhov et al. [(2018). PACMPL2(ICFP), 79:1–79:29.].","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-07-28","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000106","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48060555","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}
引用次数: 3
Review of "Functional and Reactive Domain Modeling" by Debasish Ghosh, Manning, 2017, ISBN 978-1-617-29224-8 “功能和反应域建模”综述,Debasish Ghosh,Manning,2017,ISBN 978-1-617-29224-8
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-07-27 DOI: 10.1017/S0956796820000180
Michael Sperber
{"title":"Review of \"Functional and Reactive Domain Modeling\" by Debasish Ghosh, Manning, 2017, ISBN 978-1-617-29224-8","authors":"Michael Sperber","doi":"10.1017/S0956796820000180","DOIUrl":"https://doi.org/10.1017/S0956796820000180","url":null,"abstract":"","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-07-27","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/S0956796820000180","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"48616512","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
Review of "Algorithms for Functional Programming" by John David Stone, Springer-Verlag, 2018 对John David Stone的“函数式编程算法”的回顾,Springer-Verlag, 2018
IF 1.1 3区 计算机科学
Journal of Functional Programming Pub Date : 2020-07-16 DOI: 10.1017/s0956796820000179
P. Ragde
{"title":"Review of \"Algorithms for Functional Programming\" by John David Stone, Springer-Verlag, 2018","authors":"P. Ragde","doi":"10.1017/s0956796820000179","DOIUrl":"https://doi.org/10.1017/s0956796820000179","url":null,"abstract":"","PeriodicalId":15874,"journal":{"name":"Journal of Functional Programming","volume":" ","pages":""},"PeriodicalIF":1.1,"publicationDate":"2020-07-16","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"https://sci-hub-pdf.com/10.1017/s0956796820000179","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"47013952","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
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
相关产品
×
本文献相关产品
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信