A Lightweight Modeling and Verification Framework for Programs Over Weak Memory Models in an Algebraic Semantics Style

IF 1.6 4区 计算机科学 Q3 COMPUTER SCIENCE, SOFTWARE ENGINEERING
Lili Xiao, Huibiao Zhu, Jonathan P. Bowen
{"title":"A Lightweight Modeling and Verification Framework for Programs Over Weak Memory Models in an Algebraic Semantics Style","authors":"Lili Xiao,&nbsp;Huibiao Zhu,&nbsp;Jonathan P. Bowen","doi":"10.1002/smr.70149","DOIUrl":null,"url":null,"abstract":"<div>\n \n <p>Modeling and verification of multithreaded programs are difficult since one must consider all the ways that instructions in different threads can be interleaved. Modern hardware architectures and mainstream programming languages employ weak memory models (WMMs) for efficiency reasons, and the additional interleavings from them make the modeling and verification more complex. In addition, different WMMs cause various relaxed-memory effects, and their operational semantics has distinguished expressions and transition rules. On this basis, multiple algorithms are required to be designed to conduct verification on programs over WMMs. In this paper, we propose a lightweight modeling and verification framework for programs over WMMs. Above all, we apply <i>Unifying Theories of Programming</i> (UTP) to investigate the unified algebraic semantics. A set of algebraic laws are explored, which can dynamically generate configuration sequences of programs under WMMs. Two memory models, total store order (TSO) implemented in the <span></span><math>\n <semantics>\n <mrow>\n <mo>×</mo>\n </mrow>\n <annotation>$$ \\times $$</annotation>\n </semantics></math>86 architecture and SPARC implementations, and ARMv8 supported by the ARM architecture, are used to instantiate the proposed algebraic modeling method. During this process, we record the data state of each configuration and define properties capturing the unique features of the TSO and ARMv8 memory models, and then check whether the properties are satisfied. The algebraic laws are implemented in the rewriting engine Maude, and the verification is also conducted in Maude. The verification results show that the properties all agree with our expectations.</p>\n </div>","PeriodicalId":48898,"journal":{"name":"Journal of Software-Evolution and Process","volume":"38 7","pages":""},"PeriodicalIF":1.6000,"publicationDate":"2026-07-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Journal of Software-Evolution and Process","FirstCategoryId":"94","ListUrlMain":"https://onlinelibrary.wiley.com/doi/10.1002/smr.70149","RegionNum":4,"RegionCategory":"计算机科学","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"Q3","JCRName":"COMPUTER SCIENCE, SOFTWARE ENGINEERING","Score":null,"Total":0}
引用次数: 0

Abstract

Modeling and verification of multithreaded programs are difficult since one must consider all the ways that instructions in different threads can be interleaved. Modern hardware architectures and mainstream programming languages employ weak memory models (WMMs) for efficiency reasons, and the additional interleavings from them make the modeling and verification more complex. In addition, different WMMs cause various relaxed-memory effects, and their operational semantics has distinguished expressions and transition rules. On this basis, multiple algorithms are required to be designed to conduct verification on programs over WMMs. In this paper, we propose a lightweight modeling and verification framework for programs over WMMs. Above all, we apply Unifying Theories of Programming (UTP) to investigate the unified algebraic semantics. A set of algebraic laws are explored, which can dynamically generate configuration sequences of programs under WMMs. Two memory models, total store order (TSO) implemented in the × $$ \times $$ 86 architecture and SPARC implementations, and ARMv8 supported by the ARM architecture, are used to instantiate the proposed algebraic modeling method. During this process, we record the data state of each configuration and define properties capturing the unique features of the TSO and ARMv8 memory models, and then check whether the properties are satisfied. The algebraic laws are implemented in the rewriting engine Maude, and the verification is also conducted in Maude. The verification results show that the properties all agree with our expectations.

基于代数语义风格的弱内存模型程序的轻量级建模与验证框架
多线程程序的建模和验证是困难的,因为必须考虑不同线程中的指令可以交错的所有方式。现代硬件体系结构和主流编程语言出于效率的考虑采用了弱内存模型(wmm),而它们之间的额外交错使得建模和验证变得更加复杂。此外,不同的wmm会产生不同的松弛记忆效应,其操作语义具有不同的表达和转换规则。在此基础上,需要设计多种算法对wmm上的程序进行验证。在本文中,我们为wmm上的程序提出了一个轻量级的建模和验证框架。首先,我们应用统一规划理论(UTP)来研究统一代数语义。探索了一套能动态生成wmm下程序组态序列的代数规律。采用两种内存模型,即在x $$ \times $$ 86体系结构和SPARC实现中实现的总存储顺序(TSO)模型,以及ARM体系结构支持的ARMv8模型来实例化所提出的代数建模方法。在此过程中,我们记录每个配置的数据状态,并定义捕获TSO和ARMv8内存模型的独特特性的属性,然后检查属性是否满足。在重写引擎Maude中实现了代数定律,并在Maude中进行了验证。验证结果表明,这些性能都符合我们的预期。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
Journal of Software-Evolution and Process
Journal of Software-Evolution and Process COMPUTER SCIENCE, SOFTWARE ENGINEERING-
自引率
10.00%
发文量
109
×
引用
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学术文献互助群
群 号:604180095
Book学术官方微信
小红书