In a previous paper, we have proved tight complexity bounds for the equivalence of recursive and nonrecursive Datalog programs: triply-exponential time in general and doublyexponential space for linear programs. In this paper, we show that under realistic restrictions on the classes programs under consideration, equivalence of recursive and nonrecursive programs can be less intractable; for the
... [Show full abstract] classes of programs we consider the complexity of equivalence ranges from NP to co-NEXPTIME. 1 Introduction It has been recognized for some time that first-order database query languages are lacking in expressive power [AU79, GM78, Zl76]. Since then, many higherorder query languages have been investigated [AV89, CH80, Ch81, CH82, Im86, Va82]. A query language that has received considerable attention is Datalog, the language of logic programs (known also as Horn-clause programs) without function symbols [Ka90, Ul89], which is essentially a fragment of fixpoint logic [CH85, Mo74]. The gain in ex...