skip to main content
research-article
Open access

Polynomial Time Convergence of the Iterative Evaluation of Datalogo Programs

Published: 07 November 2024 Publication History

Abstract

Datalogo is an extension of Datalog that allows for aggregation and recursion over an arbitrary commutative semiring. Like Datalog, Datalogo programs can be evaluated via the natural iterative algorithm until a fixed point is reached. However unlike Datalog, the natural iterative evaluation of some Datalogo programs over some semirings may not converge. It is known that the commutative semirings for which the iterative evaluation of Datalogo programs is guaranteed to converge are exactly those semirings that are stable. Previously, the best known upper bound on the number of iterations until convergence over p-stable semirings is ∑i=1 ^n (p+2)i = Θ(pn) steps, where n is (essentially) the output size. We establish that, in fact, the natural iterative evaluation of a Datalogo program over a p-stable semiring converges within a polynomial number of iterations. In particular our upper bound is O(σ p n2( n2 lg Λ + lg σ)) where σ is the number of elements in the semiring present in either the input databases or the Datalogo program, and λ is the maximum number of terms in any product in the Datalogo program.

References

[1]
Serge Abiteboul, Richard Hull, and Victor Vianu. 1995. Foundations of Databases. Addison-Wesley. http://webdam.inria.fr/Alice/
[2]
Mahmoud Abo Khamis, Hung Q. Ngo, and Atri Rudra. 2016. FAQ: Questions Asked Frequently. In Proceedings of the 35th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2016, San Francisco, CA, USA, June 26 - July 01, 2016, Tova Milo and Wang-Chiew Tan (Eds.). ACM, 13--28. https://doi.org/10.1145/2902251.2902280
[3]
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to algorithms third ed.). MIT Press, Cambridge, MA. xx1292 pages.
[4]
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. 2009. Introduction to Algorithms, 3rd Edition. MIT Press. http://mitpress.mit.edu/books/introduction-algorithms
[5]
Javier Esparza, Stefan Kiefer, and Michael Luttenberger. 2010. Newtonian program analysis. J. ACM, Vol. 57, 6 (2010), 33:1--33:47. https://doi.org/10.1145/1857914.1857917
[6]
Robert W. Floyd. 1962. Algorithm 97: Shortest path. Commun. ACM, Vol. 5, 6 (1962), 345. https://doi.org/10.1145/367766.368168
[7]
Michel Gondran and Michel Minoux. 2008. Graphs, dioids and semirings. Operations Research/Computer Science Interfaces Series, Vol. 41. Springer, New York. xx383 pages. New models and algorithms.
[8]
Todd J. Green, Gregory Karvounarakis, and Val Tannen. 2007. Provenance semirings. In Proceedings of the Twenty-Sixth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems, June 11--13, 2007, Beijing, China, Leonid Libkin (Ed.). ACM, 31--40. https://doi.org/10.1145/1265530.1265535
[9]
Mark W. Hopkins and Dexter Kozen. 1999. Parikh's Theorem in Commutative Kleene Algebra. In 14th Annual IEEE Symposium on Logic in Computer Science, Trento, Italy, July 2--5, 1999. IEEE Computer Society, 394--401. https://doi.org/10.1109/LICS.1999.782634
[10]
Sungjin Im, Benjamin Moseley, Hung Q. Ngo, and Kirk Pruhs. 2024. On the Convergence Rate of Linear Datalog ^(circ) over Stable Semirings. In 27th International Conference on Database Theory, ICDT 2024, March 25--28, 2024, Paestum, Italy (LIPIcs, Vol. 290), Graham Cormode and Michael Shekelyan (Eds.). Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 11:1--11:20. https://doi.org/10.4230/LIPICS.ICDT.2024.11
[11]
Mahmoud Abo Khamis, Hung Q. Ngo, Reinhard Pichler, Dan Suciu, and Yisu Remy Wang. 2022. Convergence of Datalog over (Pre-) Semirings. In PODS '22: International Conference on Management of Data, Philadelphia, PA, USA, June 12 - 17, 2022, Leonid Libkin and Pablo Barceló (Eds.). ACM, 105--117. https://doi.org/10.1145/3517804.3524140
[12]
Dexter C. Kozen. 1997. Automata and Computability. Springer-Verlag, Berlin, Heidelberg.
[13]
Werner Kuich. 1997. Semirings and formal power series: their relevance to formal languages and automata. In Handbook of formal languages, Vol. 1. Springer, Berlin, 609--677.
[14]
Daniel J. Lehmann. 1977. Algebraic Structures for Transitive Closure. Theor. Comput. Sci., Vol. 4, 1 (1977), 59--76. https://doi.org/10.1016/0304--3975(77)90056--1
[15]
Harry R. Lewis and Christos H. Papadimitriou. 1998. Elements of the theory of computation, 2nd Edition. Prentice Hall.
[16]
Rohit J. Parikh. 1966. On context-free languages. J. Assoc. Comput. Mach., Vol. 13 (1966), 570--581. https://doi.org/10.1145/321356.321364
[17]
D. L. Pilling. 1973. Commutative regular equations and Parikh's theorem. J. London Math. Soc. (2), Vol. 6 (1973), 663--666. https://doi.org/10.1112/jlms/s2--6.4.663
[18]
Günter Rote. 1985. A systolic array algorithm for the algebraic path problem (shortest paths; Matrix inversion). Computing, Vol. 34, 3 (1985), 191--219. https://doi.org/10.1007/BF02253318
[19]
Günter Rote. 1990. Path problems in graphs. In Computational graph theory. Comput. Suppl., Vol. 7. Springer, Vienna, 155--189. https://doi.org/10.1007/978--3--7091--9076-0_9
[20]
Richard P. Stanley. 2012. Enumerative combinatorics. Volume 1 second ed.). Cambridge Studies in Advanced Mathematics, Vol. 49. Cambridge University Press, Cambridge. xiv626 pages.
[21]
Robert Endre Tarjan. 1981. A Unified Approach to Path Problems. J. ACM, Vol. 28, 3 (1981), 577--593. https://doi.org/10.1145/322261.322272
[22]
Stephen Warshall. 1962. A Theorem on Boolean Matrices. J. ACM, Vol. 9, 1 (1962), 11--12. https://doi.org/10.1145/321105.321107

Index Terms

  1. Polynomial Time Convergence of the Iterative Evaluation of Datalogo Programs

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image Proceedings of the ACM on Management of Data
    Proceedings of the ACM on Management of Data  Volume 2, Issue 5
    PODS
    November 2024
    363 pages
    EISSN:2836-6573
    DOI:10.1145/3703846
    Issue’s Table of Contents
    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 07 November 2024
    Published in PACMMOD Volume 2, Issue 5

    Permissions

    Request permissions for this article.

    Author Tags

    1. convergence time
    2. datalog
    3. semiring

    Qualifiers

    • Research-article

    Funding Sources

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 111
      Total Downloads
    • Downloads (Last 12 months)111
    • Downloads (Last 6 weeks)40
    Reflects downloads up to 25 Jan 2025

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Login options

    Full Access

    Figures

    Tables

    Media

    Share

    Share

    Share this Publication link

    Share on social media