arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2508.07855cs.PL
收藏

检查事件驱动迹的一致性

Checking Consistency of Event-driven Traces

Parosh Aziz Abdulla, Mohamed Faouzi Atig, R. Govind, Samuel Grahn, Ramanathan S. Thinniyam

AI总结:

本文提出事件驱动程序的公理语义以检查执行迹一致性,证明该问题为NP完全,并发现无嵌套发布时可在多项式时间内解决,最后通过原型工具验证了方法有效性。

摘要:

事件驱动编程是一种流行的范式,其执行流程由两个特性控制:(1)共享内存和(2)在多个处理程序线程(简称处理程序)之间发送和接收消息。每个处理程序都有一个邮箱(建模为队列)用于接收消息,约束条件是处理程序按顺序处理其消息。不同处理程序对消息的执行可能会交错进行。在这种背景下,一个核心问题是检查候选执行是否与事件驱动程序的语义一致。在本文中,我们基于迹(也称为执行图)的标准概念,提出了一种事件驱动程序的公理语义。我们证明了公理语义和操作语义的等价性。这使我们能够以公理方式重新表述一致性问题,从而得出事件驱动一致性问题:检查给定迹是否一致。我们分析了该问题的计算复杂性,并证明即使处理程序线程的数量有界,它也是NP完全的。然后,我们确定了一个可处理的片段:在没有嵌套发布的情况下,即处理程序在处理消息时不发布新消息,一致性检查可以在多项式时间内完成。最后,我们在原型工具中实现了我们的方法,并报告了在广泛基准上的实验结果。

英文摘要:

Event-driven programming is a popular paradigm where the flow of execution is controlled by two features: (1) shared memory and (2) sending and receiving of messages between multiple handler threads (just called handler). Each handler has a mailbox (modelled as a queue) for receiving messages, with the constraint that the handler processes its messages sequentially. Executions of messages by different handlers may be interleaved. A central problem in this setting is checking whether a candidate execution is consistent with the semantics of event-driven programs. In this paper, we propose an axiomatic semantics for eventdriven programs based on the standard notion of traces (also known as execution graphs). We prove the equivalence of axiomatic and operational semantics. This allows us to rephrase the consistency problem axiomatically, resulting in the event-driven consistency problem: checking whether a given trace is consistent. We analyze the computational complexity of this problem and show that it is NP-complete, even when the number of handler threads is bounded. We then identify a tractable fragment: in the absence of nested posting, where handlers do not post new messages while processing a message, consistency checking can be performed in polynomial time. Finally, we implement our approach in a prototype tool and report on experimental results on a wide range of benchmarks.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑