字符串求解中处理位置约束的统一框架(技术报告)
A Uniform Framework for Handling Position Constraints in String Solving (Technical Report)
AI总结:
本文提出一个统一框架,通过将位置字符串约束归约为基于特殊有限自动机 Parikh 映像的整数冲突检查,避免词方程编码,使求解复杂度降至 NP 完全甚至 PTime,并在 Z3-Noodler 中显著提升性能,同时可扩展处理部分 not-contains 问题。
摘要:
我们引入了一种新颖的判定过程,用于求解位置字符串约束类,其中包括字符串不等关系、非前缀关系、非后缀关系、str$.$at 以及非 str$.$at。这些约束在几乎所有字符串约束求解应用中都会频繁产生。我们的过程避免了将约束昂贵地编码为词方程,而是将问题归约为检查位置上的冲突,这些位置满足一个整数约束,该整数约束来自具有特殊结构的多项式大小有限自动机的 Parikh 映像。通过归约到计数问题,求解位置约束变为 NP 完全问题,并且在某些情况下甚至落入 PTime。这比之前使用的技术便宜得多,之前的技术要么使用生成词方程和长度约束的归约(现代字符串求解器为此使用指数空间算法),要么使用不完全技术。我们的方法尤其适用于基于自动机的字符串求解器,这些求解器最近在实际效率、通用性和完备性保证方面取得了最佳结果。这项工作使它们也能在位置约束上表现出色,而位置约束过去是它们的弱点。除了效率提升之外,我们还表明我们的框架可以扩展以求解 not-contains 的一个大型片段(在 NExpTime 中),该问题的可判定性长期以来一直悬而未决,并为求解一般问题带来了希望。我们在 Z3-Noodler 求解器中对该技术的实现显著提升了其在位置约束上的性能。
英文摘要:
We introduce a novel decision procedure for solving the class of position string constraints, which includes string disequalities, not-prefixof, not-suffixof, str$.$at, and not-str$.$at. These constraints are generated frequently in almost any application of string constraint solving. Our procedure avoids expensive encoding of the constraints to word equations and, instead, reduces the problem to checking conflicts on positions satisfying an integer constraint obtained from the Parikh image of a polynomial-sized finite automaton with a special structure. By the reduction to counting, solving position constraints becomes NP-complete and for some cases even falls into PTime. This is much cheaper than the previously used techniques, which either used reductions generating word equations and length constraints (for which modern string solvers use exponential-space algorithms) or incomplete techniques. Our method is relevant especially for automata-based string solvers, which have recently achieved the best results in terms of practical efficiency, generality, and completeness guarantees. This work allows them to excel also on position constraints, which used to be their weakness. Besides the efficiency gains, we show that our framework may be extended to solve a large fragment of not-contains (in NExpTime), for which decidability has been long open, and gives a hope to solve the general problem. Our implementation of the technique within the Z3-Noodler solver significantly improves its performance on position constraints.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。