New Generation Computing

, Volume 16, Issue 4, pp 373–395 | Cite as

Non-determinism and weak constraints in Datalog

  • Sergio Greco
Regular Papers


This paper introduces a simple and powerful extension of stratified DATALOG which permits to express various DB-complexity classes. The new language, called DATALOG¬s,c,p , extends DATALOG with stratified negation, a non-deterministic construct, calledchoice, and a weak form of constraints, calledpreference rules, that is, constraints that should be respected but, if they cannot be eventually enforced, they only invalidate the portions of the program which they are concerned with. Although DATALOG with stratified negation is not able to express all polynomial time queries,20) the introduction of the non-deterministic constructchoice permits to express, exactly, the ‘deterministic fragment’ of the class of DB-queriesP, under the non-deterministic semantics,NP, under the possible semantics, and coNP, under the certain semantics. The introduction of preference rules, further increases the expressive power of the language, and permits to express the complexity classes Σ 2 p , under the possibility semantics, and Π 2 p , under the certainty semantics.


Logic Programming Datalog Expressive Power Data Complexity Nondeterminism 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1).
    Abiteboul, S., Simon, E., and Vianu, V., “Non-Deterministic Language to Compute Deterministic Transformation,” inProc. of the Ninth ACM Symposium on Principles of Database Systems, pp. 218–229, 1990.Google Scholar
  2. 2).
    Abiteboul, S. and Vianu, V., “Datalog Extensions for Databases Queries and Updates,”Journal of Computer and System Science, 43, 1, pp. 62–124, 1991.MATHCrossRefMathSciNetGoogle Scholar
  3. 3).
    Abiteboul, S., Hull, R., and Vianu, V.,Foundations of Databases, Addison-Wesley, 1994.Google Scholar
  4. 4).
    Afrati, F., Cosmadakis, S.S., and Yannakakis, M., “On Datalog vs. Polynomial Time,” inProc. of the Tenth ACM Symposium on Principles of Database Systems, pp. 13–25, 1991.Google Scholar
  5. 5).
    Apt, C., Blair, H., and Walker, A., “Towards a Theory of Declarative Knowledge,” inProc. Workshop on Found. of Deductive Database and Logic Programming (Minker, ed.), pp. 89–149, 1988.Google Scholar
  6. 6).
    Baral, V. and Subrahmanian, V.S., “Stable and Extension Class Theory for Logic Programs and Default Logic,”Journal of Automated Reasoning, 8, pp. 345–366, 1992.MATHCrossRefMathSciNetGoogle Scholar
  7. 7).
    Chandra, A. and Harel, D., “Structures and Complexity of Relational Queries,”Journal of Computer and System Science, 25, pp. 99–128, 1982.MATHCrossRefGoogle Scholar
  8. 8).
    Dung, P., “Negation as Hypotheses: An Abductive Foundation for Logic Programming,” inProc. 8th Conf. on Logic Programming, pp. 3–17, 1991.Google Scholar
  9. 9).
    Eiter, T., Gottlob, G., and Manila, H., “Expressive Power and Complexity of Disjunctive Datalog,”Proc. ACM Symp. on Principles of Database Systems, pp. 267–278, 1994.Google Scholar
  10. 10).
    Fagin, R., “Generalized First-Order Spectra and Polynomial-Time Recognizable Sets,” inComplexity of Computation (R. Karp, ed.),SIAM-AMS Proc., 7, pp. 43–73, 1974.Google Scholar
  11. 11).
    Gelfond, M. and Lifschitz, V., “The Stable Model Semantics of Logic Programming,” inProc. of the Fifth Int. Conference on Logic Programming, pp. 1070–1080, 1988.Google Scholar
  12. 12).
    Giannotti, F., Pedreschi, D., Saccà, D., and Zaniolo, C., “Nondeterminism in Deductive Databases,” inProc. 2nd Int. Conference on Deductive and Object-Oriented Databases, pp. 129–146, 1991.Google Scholar
  13. 13).
    Greco, S., Zaniolo, C., and Ganguly, S., “Greedy by Choice,” inProc. of the Eleventh ACM Symposium on Principles of Database Systems, pp. 105–163, 1992.Google Scholar
  14. 14).
    Greco, S., Saccà, D., and Zaniolo, C., “DATALOG Queries with Stratified Negation and Choice: fromP toD P,” inProc. of the Fifth Int. Conference on Database Theory, pp. 82–96, 1995.Google Scholar
  15. 15).
    Greco S. and Saccà, D., “Possible is Certain: Is Desiderable and Can be Expressive”,Annals of Mathematics and Artificial Intelligence, 19, pp. 147–168, 1997.MATHCrossRefMathSciNetGoogle Scholar
  16. 16).
    Immerman, N., “Languages that Capture Complexity Classes,” inSIAM Journal of Computing, 16, 4, pp. 760–778, 1987.Google Scholar
  17. 17).
    Johnson, D.S., “A Catalog of Complexity Classes,” inHandbook of Theoretical Computer Science, Vol. A (J. Leewen, ed.), North-Holland, pp. 67–161, 1990.Google Scholar
  18. 18).
    Kanellakis, P.C., “Elements of Relational Databases Theory,” inHandbook of Theoretical Computer Science, Vol B (J. Leewen, ed.), North-Holland, pp. 1075–1155, 1990.Google Scholar
  19. 19).
    Kolaitis. P., “The Expressive Power of Stratified Logic Programs,”Information and Computation, 90, pp. 50–66, 1990.Google Scholar
  20. 20).
    Kolaitis, P. and Papadimitriou, C., “Why Not Negation by Fixpoint,”Journal of Computer and System Science, 43, 1, pp. 125–144, 1991.MATHCrossRefMathSciNetGoogle Scholar
  21. 21).
    Krishnamurthy, R. and Naqvi, S., “Non-Deterministic Choice in Datalog,” inProc. of the Seventh ACM Symposium on Principles of Database Systems, 1988.Google Scholar
  22. 22).
    Lloyd, J.W.,Foundations of Logic Programming, Springer-Verlag, Berlin, 1987.MATHGoogle Scholar
  23. 23).
    Marek, W. and Truszczynski, M., “Autoepistemic Logic,”Journal of ACM, 38, 3, pp. 588–619, 1991.MATHCrossRefMathSciNetGoogle Scholar
  24. 24).
    Naqvi, S. and Tsur, S.,A Logic Language for Data and Knowledge Bases, Computer Science Press, 1989.Google Scholar
  25. 25).
    Papadimitriou, C., “A Note on the Expressive Power of Prolog,” inBull of the EATCS, 26, pp. 21–23, 1985.Google Scholar
  26. 26).
    Papadimitriou, C.,Computational Complexity, Addison-Wesley, 1994.Google Scholar
  27. 27).
    Przymusinski T.C., “Well-Founded Semantics Coincides with Three-Valued Stable Semantics,”Foundamenta Informaticae, 13, pp. 445–463, 1990.MATHMathSciNetGoogle Scholar
  28. 28).
    Ramakrisnhan, R., Srivastava, D., and Sudanshan, S., “CORAL — Control, Relations and Logic,” inProc. of 18th Int. Conference on Very Large Data Bases, 1992.Google Scholar
  29. 29).
    Saccà, D. and Zaniolo, C., “Stable Models and Non-Determinism in Logic Programs with Negation,” inProc. of the Ninth ACM Symposium on principles of Database Systems, pp. 205–217, 1990.Google Scholar
  30. 30).
    Saccà, D., “The Expressive Powers of Stable Models for Bound and Unbound DATALOG Queries,”Journal of Computer and System Science, 54, 3, pp 441–464, June 1997.MATHCrossRefGoogle Scholar
  31. 31).
    Schlipf, J.S., “The Expressive Powers of the Logic Programming Semantics,”Journal of Computer and System Science, 51, 1, pp. 64–86, 1995.MATHCrossRefMathSciNetGoogle Scholar
  32. 32).
    Ullman, J.D.,Principles of Databases and Knowledge Base Systems, Computer Science Press, 1988..Google Scholar
  33. 33).
    Van Gelder, A., “Negation as Failure Using Tight Derivations for General Logic Programs,”Journal of Logic Programming, 6, 1, pp. 109–133, 1989.MATHCrossRefMathSciNetGoogle Scholar
  34. 34).
    Van Gelder, A., Ross, K.A. and Schlipf, J.S., “The Well-Founded Semantics for General Logic Programs,”Journal of ACM, 38, 3, pp. 620–650, 1991.MATHGoogle Scholar
  35. 35).
    Vardi, M., “The Complexity of Relational Query Languages,” inProc. of the 14th ACM Symposium on. Theory of Computing, pp. 137–146, 1982.Google Scholar
  36. 36).
    You, J. and Yuan, L.Y., “A Three-Valued Semantics for Deductive Databases and Logic Programming,”Journal of Computer and System Science, 19, pp. 334–361, 1994.CrossRefMathSciNetGoogle Scholar

Copyright information

© Ohmsha, Ltd. and Springer 1998

Authors and Affiliations

  • Sergio Greco
    • 1
  1. 1.Dip. Elettronica Informatica e SistemisticaUniversità della CalabriaRendeItaly

Personalised recommendations