arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1411.5437cs.CCcs.FL
收藏

一些正则表达式纵横字谜问题的复杂性

The complexity of some regex crossword problems

Stephen A. Fenner

摘要:

在一个典型的正则表达式(regex)纵横字谜游戏中,你会得到两个非空列表$R_1,\ldots,R_m$和$C_1,\ldots,C_n$,它们是某个字母表上的正则表达式,你的目标是用该字母表中的字母填充$m\times n$网格,这样对于所有$1\le i\le m$和$1\le j\le n$,由$i$第行形成的字符串就在$L(R_i)$中,由$j$第列形成的字符串就在$L(C_j)$中。这样的网格是解决这个难题的一个办法。已知判定解是否存在是NP完全的。我们考虑这个问题的一些限制和变体,其中所有的$R_i$都等于某个正则表达式$R$,并且所有的$C_j$都等于某个正则表达式$C$。我们把这样一个难题的解决方案称为$(R,C)$ -纵横字谜。我们的主要结果如下:1.在字母表$\{0,1\}$上存在一个固定的正则表达式$C$,使得下面的问题是NP完全的:“给定$\{0,1\}$上的正则表达式$R$和一元中的正整数$m$和$n$,存在$m\times n$ $(R,C)$ -纵横字谜吗?“这改善了上面提到的结果。2.下面的问题是NP难的:“给定$\{0,1\}$上的正则表达式$E$和一元中的正整数$m$和$n$,存在$m\times n$ $(E,E)$ -纵横字谜吗?“3.存在一个固定的正则表达式$C$ over $\{0,1\}$,使得以下问题是不可判定的(等价于停机问题):“给定一个正则表达式$R$ over $\{0,1\}$,是否存在一个$(R,C)$ -纵横字谜(任何大小)?“4.下面的问题是不可判定的(相当于停机问题):“给定一个正则表达式$E$ over $\{0,1\}$,是否存在一个$(E,E)$ -纵横字谜(任何大小)?"

英文摘要:

In a typical regular expression (regex) crossword puzzle, you are given two nonempty lists $R_1,\ldots,R_m$ and $C_1,\ldots,C_n$ of regular expressions over some alphabet, and your goal is to fill in an $m\times n$ grid with letters from that alphabet so that the string formed by the $i$th row is in $L(R_i)$, and the string formed by the $j$th column is in $L(C_j)$, for all $1\le i\le m$ and $1\le j\le n$. Such a grid is a solution to the puzzle. It is known that determining whether a solution exists is NP-complete. We consider a number of restrictions and variants to this problem where all the $R_i$ are equal to some regular expression $R$, and all the $C_j$ are equal to some regular expression $C$. We call the solution to such a puzzle an $(R,C)$-crossword. Our main results are the following: 1. There exists a fixed regular expression $C$ over the alphabet $\{0,1\}$ such that the following problem is NP-complete: "Given a regular expression $R$ over $\{0,1\}$ and positive integers $m$ and $n$ given in unary, does an $m\times n$ $(R,C)$-crossword exist?" This improves the result mentioned above. 2. The following problem is NP-hard: "Given a regular expression $E$ over $\{0,1\}$ and positive integers $m$ and $n$ given in unary, does an $m\times n$ $(E,E)$-crossword exist?" 3. There exists a fixed regular expression $C$ over $\{0,1\}$ such that the following problem is undecidable (equivalent to the Halting Problem): "Given a regular expression $R$ over $\{0,1\}$, does an $(R,C)$-crossword exist (of any size)?" 4. The following problem is undecidable (equivalent to the Halting Problem): "Given a regular expression $E$ over $\{0,1\}$, does an $(E,E)$-crossword exist (of any size)?"

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

↑