The Complexity of the Equivalence Problem for Simple Loop-Free Programs
暂无分享,去创建一个
We consider a simple class of loop-free programs whose instruction repertoire consists of $x \leftarrow 0$, $x \leftarrow c$, $x \leftarrow cx$, $x \leftarrow x/c$, $x \leftarrow x + y$, $x \leftarrow x - y$, $\textbf{skip } l$, $\textbf{if } p(x,y)$$\textbf{then skip }l$, and $\textbf{halt}$. (x and y are integer variables, c is a positive integer, $x/c$ is integer division, l is a nonnegative integer, and $p(x,y)$ is a predicate of the form $x > y$, $x \geqq y$, $x = y$, $x \ne y$, $x \leqq y$, or $x < y$; $\textbf{skip }l$ causes the $(l + 1)$st instruction following the current instruction to be executed next.) We show that the equivalence problem for this class is decidable in $2^{\lambda N^2 } $ time ($N = $ sum of the sizes of the programs and $\lambda $ is a fixed positive constant). The bound cannot be reduced to a polynomial in N unless ${\text{P}} = {\text{NP}}$. In fact, we have the following rather surprising result: The equivalence problem for programs with one input variable (which also ser...