The Complexity of the Equivalence Problem for Simple Programs

The complexity of the eqmvalence problem for several sunple programming languages ,s investigated. In pamcular, ~t is shown that a class of programs, called XL, has an NP-complete mequwalence problem; hence its equivalence problem is decidable in determimstw tune 2 p~N~, wherep(N) ,s a polynomtal in the sum of the stzes of the programs. This bound is a four-level exponential improvement over a previously known result A very sunple subset of XL, called SL, is also considered, and it is shown that every XL-program ~s polynomial-time reducible to an eqmvalent SL-program. Moreover, SL is minimal in the sense that all its mstrucUons are independent On the other hand, XL Is maximal m that a "slight" generalization yields a language with an undecidable eqmvalence problem. XL-programs realize precisely the relations (functions) definable by Presburger formulas.