arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2512.00314cs.FLcs.CCcs.LOcs.PL
收藏

在正则语言中计数和采样踪迹

Counting and Sampling Traces in Regular Languages

University of Toronto(多伦多大学);National University of Singapore(新加坡国立大学)

Alexis de Colnet, Kuldeep S. Meel, Umang Mathur

AI总结:

本文提出了一种在正则语言中计数和采样Mazurkiewicz踪迹的算法,解决了计数问题的#P难性,并给出了近似均匀采样的方法。

摘要:

在本文中,我们研究了正则语言所触及的Mazurkiewicz踪迹的计数和采样问题。固定一个字母表$Σ$和一个独立关系$\mathbb{I} \subseteq Σ\times Σ$。输入由一个正则语言$L \subseteq Σ^*$组成,该语言由具有$m$个状态的有限自动机给出,以及一个自然数$n$(以 unary 表示)。对于计数问题,目标是计算与第$n$个切片$L_n = L \cap Σ^n$相交的Mazurkiewicz踪迹的数量,即至少有一个线性化在$L_n$中的踪迹。对于采样问题,目标是输出一个从近似均匀分布在所有这些踪迹上的分布中抽取的踪迹。这些任务受到有界模型检查中部分序约简的启发,其中对约简后的状态空间的先验估计是有价值的,同时也受到并发程序测试方法中使用部分序感知随机探索的启发。我们首先证明,即使当$L$由确定性自动机接受时,计数问题也是#P难的,这与DFA单词计数的多项式时间可解性形成鲜明对比。然后我们证明,无论$L$是否为踪迹闭合,该问题都位于#P中。我们的主要算法贡献是一个完全多项式时间随机近似方案(FPRAS),它以高概率在给定的精度内近似所需的计数,以及一个完全多项式时间几乎均匀采样器(FPAUS),它生成的踪迹分布被证明接近均匀。

英文摘要:

In this work, we study the problems of counting and sampling Mazurkiewicz traces that a regular language touches. Fix an alphabet $Σ$ and an independence relation $\mathbb{I} \subseteq Σ\times Σ$. The input consists of a regular language $L \subseteq Σ^*$, given by a finite automaton with $m$ states, and a natural number $n$ (in unary). For the counting problem, the goal is to compute the number of Mazurkiewicz traces (induced by $\mathbb{I}$) that intersect the $n^\text{th}$ slice $L_n = L \cap Σ^n$, i.e., traces that admit at least one linearization in $L_n$. For the sampling problem, the goal is to output a trace drawn from a distribution that is approximately uniform over all such traces. These tasks are motivated by bounded model checking with partial-order reduction, where an \emph{a priori} estimate of the reduced state space is valuable, and by testing methods for concurrent programs that use partial-order-aware random exploration. We first show that the counting problem is #P-hard even when $L$ is accepted by a deterministic automaton, in sharp contrast to counting words of a DFA, which is polynomial-time solvable. We then prove that the problem lies in #P for both NFAs and DFAs, irrespective of whether $L$ is trace-closed. Our main algorithmic contributions are a \emph{fully polynomial-time randomized approximation scheme} (FPRAS) that, with high probability, approximates the desired count within a prescribed accuracy, and a \emph{fully polynomial-time almost uniform sampler} (FPAUS) that generates traces whose distribution is provably close to uniform.

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

↑