Elixir 的可执行合约

IF 0.7 4区 数学 Q3 COMPUTER SCIENCE, THEORY & METHODS
Luis Eduardo Bueso de Barrio, Lars-Åke Fredlund, Ángel Herranz, Julio Mariño, Clara Benac Earle
{"title":"Elixir 的可执行合约","authors":"Luis Eduardo Bueso de Barrio,&nbsp;Lars-Åke Fredlund,&nbsp;Ángel Herranz,&nbsp;Julio Mariño,&nbsp;Clara Benac Earle","doi":"10.1016/j.jlamp.2024.101019","DOIUrl":null,"url":null,"abstract":"<div><div>This article presents the design of a library for attaching and checking executable contracts to code written in the Elixir programming language. In addition to classical contract constructs such as preconditions and postconditions, the library allows specifying exceptional behaviour (i.e., which exceptions are thrown and under which conditions), detecting non-termination issues in recursive functions by specifying a strictly decreasing order in function arguments, and associating timers with function calls to detect slow computations. The library also focuses on language-specific features, enabling the association of contracts with the reception of messages sent by processes and the attachment of constraints to variable names (useful due to variable shadowing in Elixir). Moreover, stateful contracts (i.e., with a model state) permit specifying the behaviour of stateful APIs whose operations can be linearized. Using the stateful contracts, a monitor can be employed to check that the observed state can be explained in terms of possible linearizations.</div></div>","PeriodicalId":48797,"journal":{"name":"Journal of Logical and Algebraic Methods in Programming","volume":"142 ","pages":"Article 101019"},"PeriodicalIF":0.7000,"publicationDate":"2024-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Executable contracts for Elixir\",\"authors\":\"Luis Eduardo Bueso de Barrio,&nbsp;Lars-Åke Fredlund,&nbsp;Ángel Herranz,&nbsp;Julio Mariño,&nbsp;Clara Benac Earle\",\"doi\":\"10.1016/j.jlamp.2024.101019\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"<div><div>This article presents the design of a library for attaching and checking executable contracts to code written in the Elixir programming language. In addition to classical contract constructs such as preconditions and postconditions, the library allows specifying exceptional behaviour (i.e., which exceptions are thrown and under which conditions), detecting non-termination issues in recursive functions by specifying a strictly decreasing order in function arguments, and associating timers with function calls to detect slow computations. The library also focuses on language-specific features, enabling the association of contracts with the reception of messages sent by processes and the attachment of constraints to variable names (useful due to variable shadowing in Elixir). Moreover, stateful contracts (i.e., with a model state) permit specifying the behaviour of stateful APIs whose operations can be linearized. Using the stateful contracts, a monitor can be employed to check that the observed state can be explained in terms of possible linearizations.</div></div>\",\"PeriodicalId\":48797,\"journal\":{\"name\":\"Journal of Logical and Algebraic Methods in Programming\",\"volume\":\"142 \",\"pages\":\"Article 101019\"},\"PeriodicalIF\":0.7000,\"publicationDate\":\"2024-10-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Journal of Logical and Algebraic Methods in Programming\",\"FirstCategoryId\":\"94\",\"ListUrlMain\":\"https://www.sciencedirect.com/science/article/pii/S2352220824000737\",\"RegionNum\":4,\"RegionCategory\":\"数学\",\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"Q3\",\"JCRName\":\"COMPUTER SCIENCE, THEORY & METHODS\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Logical and Algebraic Methods in Programming","FirstCategoryId":"94","ListUrlMain":"https://www.sciencedirect.com/science/article/pii/S2352220824000737","RegionNum":4,"RegionCategory":"数学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, THEORY & METHODS","Score":null,"Total":0}
引用次数: 0

摘要

本文介绍了一个库的设计,该库用于附加和检查用 Elixir 编程语言编写的代码中的可执行合约。除了前置条件和后置条件等经典合约构造外,该库还允许指定异常行为(即在哪些条件下抛出异常),通过指定函数参数的严格递减顺序来检测递归函数中的非终止问题,以及将计时器与函数调用关联起来以检测缓慢的计算。该库还侧重于特定语言的功能,可将合约与接收进程发送的消息关联起来,并将约束附加到变量名上(Elixir 中的变量阴影非常有用)。此外,有状态合约(即具有模型状态)允许指定有状态应用程序接口的行为,这些应用程序接口的操作可以线性化。使用有状态合约,可以使用监控器来检查观察到的状态是否可以用可能的线性化来解释。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Executable contracts for Elixir
This article presents the design of a library for attaching and checking executable contracts to code written in the Elixir programming language. In addition to classical contract constructs such as preconditions and postconditions, the library allows specifying exceptional behaviour (i.e., which exceptions are thrown and under which conditions), detecting non-termination issues in recursive functions by specifying a strictly decreasing order in function arguments, and associating timers with function calls to detect slow computations. The library also focuses on language-specific features, enabling the association of contracts with the reception of messages sent by processes and the attachment of constraints to variable names (useful due to variable shadowing in Elixir). Moreover, stateful contracts (i.e., with a model state) permit specifying the behaviour of stateful APIs whose operations can be linearized. Using the stateful contracts, a monitor can be employed to check that the observed state can be explained in terms of possible linearizations.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
Journal of Logical and Algebraic Methods in Programming
Journal of Logical and Algebraic Methods in Programming COMPUTER SCIENCE, THEORY & METHODS-LOGIC
CiteScore
2.60
自引率
22.20%
发文量
48
期刊介绍: The Journal of Logical and Algebraic Methods in Programming is an international journal whose aim is to publish high quality, original research papers, survey and review articles, tutorial expositions, and historical studies in the areas of logical and algebraic methods and techniques for guaranteeing correctness and performability of programs and in general of computing systems. All aspects will be covered, especially theory and foundations, implementation issues, and applications involving novel ideas.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信