On the Simplification and Equivalence Problems for Straight-Line Programs

The sunphficaUon and equivalence problems are examined for several classes of straightline programs. It is shown that the problems are unsolvable for all nontrivlal classes. For example, it is proved that there is no algorithm to determine if an arbRrary program using only the constructs x ,,-1, r , x + y , x ,,-x / y , where x / y ~s integer diwsion with truncation, computes the ftinction which has value l for all integer inputs. The result holds even if one considers only programs with three input variables which compute total 0/l-functions. Thus, under any criteria of smaplification, no algorithm exists for simphfymg such programs When x ,-x + y is replaced by x ~-x y , the number of input variables can be reduced to two This ~s the best possible, since equivalence Is decidable for {x ~1, x ~ x + y, x , , x y , x ~ x * y , x ~-x / y } p r o g r a m s wtth one input variable All the results translate directly to simdar results concermng arithmetic expressions. Categortes and Subject Descriptors: D.3.1 [Programming Languages]: Formal Definitions and Theory; F.2 1 [Analysis of Algorithms and Problem Complexity]: Numerical Algorithms and Problems; F 2 2 [Analysis of Algorithms and Problem Complexity]Nonnumencal Algorithms and Problems; F.3.3 [Logics and Meanings of Programs]: Studies of Program Constructs; F.4.1 [Mathematical I.~gic and Formal Languages]. Mathematical Logic General Terms: Algorithms, Theory AddRional