首页 > 最新文献

Journal of Functional Programming最新文献

英文 中文
Runtime verification and validation of functional reactive systems 功能反应系统的运行时验证和确认
IF 1.1 3区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-26 DOI: 10.1017/S0956796820000210
Ivan Perez, H. Nilsson
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.
许多类型的交互式应用程序,包括在硬件中实现的响应式系统,交互式物理模拟和游戏,在测试和调试时提出了特别的挑战。原因包括事实上缺乏可再现性和难以自动生成合适的测试数据。本文证明了在纯函数式语言中实现的函数式响应式编程(FRP)的某些变体可以通过在整个程序级别提供参考透明度来减轻这些困难。这为跨平台的测试和调试提供了一个多管齐下的方法,包括基于时间逻辑的断言,记录和重播运行(也来自已部署的代码),以及使用QuickCheck的自动随机测试。当与允许约束副作用的可扩展FRP形式相结合时,它不仅允许我们验证软件模拟,还允许我们分析反应系统中故障的影响,确认容错机制的有效性,并执行软件和硬件在环测试。该方法已经在几个现有FRP实现中实现的重要系统上得到了验证,通过使用一个工具进行仔细调试,该工具允许在审查下控制测试或模拟,沿着执行时间线移动,并在个人计算机和外部设备上精确指出违反断言的情况。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-24 DOI: 10.1017/S0956796820000246
Sam Caldwell, Tony Garnock-Jones, M. Felleisen
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.
参与者通过消息交换进行协作以达到共同的目标。然而,经验表明,纯粹的基于消息的通信是有限的,并迫使开发人员使用设计模式。最近引入的数据空间参与者模型借鉴了元组空间领域的思想。它为演员组提供了一个严格控制的共享存储设施。在这个模型中,参与者断言他们希望分享的事实,并对这些断言感兴趣。数据空间将他们感兴趣的断言集的更改通知相关方。虽然向非类型化语言添加数据空间模型很简单,但是添加类型化接口既必要又具有挑战性。如果不对交换的数据进行限制,错误的参与者可能会通过错误的断言传播错误的数据,从而导致本来表现良好的参与者崩溃——这违反了故障隔离的关键原则。适当设计的类型系统可以防止这种情况,并排除其他类型的不合作参与者。本文提出了参与者数据空间模型的第一个结构类型系统;它没有解决面向断言协议的行为类型问题。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-21 DOI: 10.1017/S0956796820000234
Matt McCutchen, J. Borghouts, A. Gordon, Simon Peyton Jones, Advait Sarkar
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.
抽象表格定义函数(sdf)为电子表格世界带来了模块化和抽象性。可惜,最终用户自然会编写在固定大小数组上工作的sdf,这限制了它们的可重用性。为了帮助最终用户程序员编写更可重用的sdf,我们描述了一种原则性的方法,将这些函数泛化为可以处理任意大小输入的弹性sdf。我们证明在自然的,可检查的条件下,我们的算法返回一个输入SDF的主泛化。我们描述了弹性sdf的形式化语义和几种有效的实现策略。一项针对电子表格用户的用户研究将使用弹性sdf编程的人类体验与依赖数组处理组合子的替代方案进行了比较。我们的用户研究发现,弹性sdf的认知负荷低于具有map/reduce数组组合子的sdf,这是最接近的替代解决方案。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-20 DOI: 10.1017/S0956796820000209
P. Bahr, G. Hutton
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.
摘要在“计算正确的编译器”(Bahr&Hutton,2015)中,我们开发了一种直接根据编译器正确性规范计算编译器的新方法。我们的方法只需要基本的推理技术,并已用于计算各种语言特征及其组合的编译器。然而,该方法侧重于基于堆栈的目标机器,而真正的编译器通常针对基于寄存器的机器。在本文中,我们展示了我们的方法如何自然地适用于计算寄存器机的编译器。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-06 DOI: 10.1017/S0956796820000222
Karl Crary
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.
在ml风格的模块类型理论中,密封通常会导致类型变量必须离开作用域的情况,这就需要签名来避免这些变量。不幸的是,通常不存在避免变量的最佳签名,因此模块并不总是享受主体签名。这种现象被称为回避问题。在过去,使用各种移动变量的设备可以避免这个问题,这样它们就可以保持在范围内。这些设备可以工作,但迄今为止缺乏逻辑基础。它们还缺乏动态语义与静态语义在相同的短语上给出的表示,这限制了它们的应用。我们可以提供一个最好的超级签名,通过添加一个存在签名,它是其实例的最小上界。这个想法很老了,但是一个可行的元理论以前还没有被提出。这项工作利用从聚焦逻辑中借鉴的思想来解决元理论问题。我们表明,新的理论结果的类型纪律非常类似于上述设备在以前的工作中使用。顺便说一句,这为ML模块的静态语义早期使用的生成戳戳提供了类型理论的依据。所有的证明都在Coq中形式化。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-05 DOI: 10.1017/S0956796821000204
N. Botta, N. Brede, Patrik Jansson, T. Richter
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 $$f,g , : , A , to , B$$ are extensionally equal, that is, $$forall x in A$$ , $$f , x = g , x$$ , then $$map , f , : , List , A to List , B$$ and $$map , g$$ 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.
摘要在经过验证的泛型编程中,不能利用具体数据类型的结构,而必须依赖于精心选择的规范集或抽象数据类型(ADT)。函数和单元是函数编程的许多应用程序的核心。这就提出了一个问题,即对于已验证的函子和单元,什么样的ADT是有用的。许多重要单元的函数映射保持了外延相等性。例如,如果$$f,g,:,A,to,B$$外延相等,也就是说,$$对于A$$,$$f,x=g,x$$中的所有x,那么$$map,f,:List,AtoList,B$$和$$map ,g$$也外延相等。这表明,在经过验证的泛型编程中,保持外延相等可能是一个有用的原则。我们用一种极简主义的方法来探索这种可能性:我们在不扩展理论或使用完整的setoid的情况下,处理Martin-Löf的内涵类型理论中(缺乏)外延平等的问题。也许令人惊讶的是,这种最小的方法被证明是非常有用的。它允许人们导出一元定律的简单通用证明,但也可以在动力系统和控制理论中得到验证的通用结果。反过来,这些结果避免了乏味的代码重复和特别的证明。因此,我们的工作是对实用的、经过验证的通用编程的贡献。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-08-05 DOI: 10.1017/S0956796821000228
N. Brede, N. Botta
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.
摘要在控制理论中,解决有限时域序列决策问题(SDP)通常意味着在采取给定数量的决策步骤时,找到一系列决策规则,这些规则会产生最优的预期总回报(或成本)。SDP通常使用Bellman的反向归纳法求解。教科书作者(例如Bertsekas或Puterman)通常会给出或多或少的形式证明,以表明后向归纳算法作为确定性和随机SDP的求解方法是正确的。Botta、Jansson和Ionescu提出了一个有限时域、一元SDP的通用框架,以及用于求解此类SDP的一元后向归纳版本。在monadic SDP中,monad捕获了不确定性的通用概念,而通用度量函数聚合了奖励。在本文中,我们定义了一元SDP的正确性概念,并确定了三个条件,使我们能够证明一元后向归纳的正确性结果,该结果与普通后向归纳教科书的正确性证明相当。我们强加的条件是相当普遍的,可以使用Eilenberg–Moore代数的概念用范畴理论的术语来描述。它们适用于熟悉的设置,如确定性或随机SDP,但我们也给出了它们失败的例子。我们的结果表明,反向归纳法可以安全地用于比教科书中通常处理的更广泛的SDP类别。然而,他们也排除了在Botta等人的通用框架中被认为是可接受的某些情况。我们的发展在Idris中正式化,作为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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING Pub Date : 2020-07-28 DOI: 10.1017/S0956796820000106
Ruben P. Pieters, Exequiel Rivas, T. Schrijvers
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.].
摘要代数效应和处理程序是一种方便的方法,可以用原始效应运算构造一元效应,并将语法与这些运算的解释分离开来。然而,传统处理程序的范围是有限的,因为并非所有的副作用本质上都是单一的。本文将代数效应和处理程序的概念从单胚推广到广义单胚,其中特别涵盖了应用函子和箭头以及单胚。为此,我们将范畴理论基础从自由代数转换为自由幺半群。此外,我们还展示了lax单体函子如何在不同的计算类中重用处理程序和程序,例如,使用单体处理程序处理应用性计算。我们在构建系统的上下文中激发并呈现这些处理程序接口。构建系统中的任务由自由计算和它们作为处理程序的解释来表示。该用例基于Mokhov等人的工作。[(2018).PACML2(ICFP),79:1–79:29]。
{"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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING 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区 计算机科学 Q4 COMPUTER SCIENCE, SOFTWARE ENGINEERING 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
期刊
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学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1