The Expressive Power of Stratified Logic Programs with Value Invention

Luca Cabibbo
1998 Information and Computation  
Part of the results in this paper appeared under the title"On the power of stratified logic programs with value invention for expressing database transformations" in International Conference on Database Theory, 1995. This work was partially supported by MURST, within the Project"Metodi formali e strumenti per basi di dati evoluti," and by Consiglio Nazionale delle Ricerche, within"Progetto Finalizzato Sistemi Informatici e Calcolo Parallelo, Obiettivo LOGIDATA+." EXPRESSIVE POWER OF STRATIFIED
more » ... OGIC PROGRAMS formalism of ILOG c (Hull and Yoshikawa, 1990) , which enjoys all the above charateristics. The language ILOG c , originally proposed to express queries in the context of object databases, can be syntactically limited to specify relational queries only, that is, generic database mappings. (We do so by requiring weak safety in the use of value invention, that is, by allowing invented values in temporary relations only.) The language obtained in this way, called wILOG c , expresses the computable queries of Chandra and Harel this fact can be formally proved as a consequence of previous results (Hull and Su, 1989; Hull and Su, 1997) . We strengthen this result, showing that the same expressive power can be achieved by means of a syntactically simpler language, obtained by limiting the use of negation to two strata programs, that is, programs made of a positive stratum followed by a semipositive one. Starting from this first completeness result, we investigate languages with even more limited use of negation. We show that the language wILOG { , in which the only form of negation allowed is nonequality, expresses the monotone queries, that is, all the computable queries that satisfy the monotonicity property. We then study the language wILOG 1Â2, c of semipositive programs, in which negation can be applied to input relations only. The language is shown to express the semimonotone queries, that is, the queries that satisfy a weak monotonicity property, also called"queries preserved under extensions" in the literature (Afrati et al., 1991) . These results characterize the expressive power of stratified Datalog extended with value invention, with respect to a number of limitations in the use of negation. The languages considered express exactly some well-defined subclasses of the computable queries. In contrast, the classes of queries expressed by stratified Datalog c , with the same limitations in the use of negation, are not always well-defined subclasses of the ptime queries (Afrati et al., 1991; Kolaitis, 1991; Kolaitis and Vardi, 1990; Papadimitriou, 1985) . This highlights the profound impact that value invention has in database manipulation. The paper is organized as follows. We recall some preliminary definitions in Section 2. Section 3 introduces the family ILOG (c) of languages, with some examples. Then, Sections 4, 5, and 6 are devoted to the study of the query languages wILOG 1, c , wILOG { , and wILOG 1Â2, c , which express the classes of computable queries, monotone queries, and semimonotone queries, respectively. In Section 7 we discuss why we do not have any expressiveness result concerning the language wILOG of positive programs. Concluding remarks are proposed in Section 8. PRELIMINARIES The Data Model We assume the reader is familiar with the basic elements of relational database theory (Abiteboul et al., 1995; Kanellakis, 1990) . We now briefly review some database terminology and notation. We assume the existence of three countably infinite and pairwise disjoint sets: the set L r of relation names, the set L a of attribute names, and the set 2 of constants, called the domain. 24 LUCA CABIBBO
doi:10.1006/inco.1998.2734 fatcat:cjhwwnxtuba55jz5ausf3vknji