Hostname: page-component-76fb5796d-r6qrq Total loading time: 0 Render date: 2024-04-28T19:02:11.770Z Has data issue: false hasContentIssue false

Integrating Logic Rules with Everything Else, Seamlessly

Published online by Cambridge University Press:  06 July 2023

YANHONG A. LIU
Affiliation:
Stony Brook University, Stony Brook, NY 11794, USA (e-mails: liu@cs.stonybrook.edu, stoller@cs.stonybrook.edu, yittong@cs.stonybrook.edu, bolin@cs.stonybrook.edu)
SCOTT D. STOLLER
Affiliation:
Stony Brook University, Stony Brook, NY 11794, USA (e-mails: liu@cs.stonybrook.edu, stoller@cs.stonybrook.edu, yittong@cs.stonybrook.edu, bolin@cs.stonybrook.edu)
YI TONG
Affiliation:
Stony Brook University, Stony Brook, NY 11794, USA (e-mails: liu@cs.stonybrook.edu, stoller@cs.stonybrook.edu, yittong@cs.stonybrook.edu, bolin@cs.stonybrook.edu)
BO LIN
Affiliation:
Stony Brook University, Stony Brook, NY 11794, USA (e-mails: liu@cs.stonybrook.edu, stoller@cs.stonybrook.edu, yittong@cs.stonybrook.edu, bolin@cs.stonybrook.edu)

Abstract

This paper presents a language, Alda, that supports all of logic rules, sets, functions, updates, and objects as seamlessly integrated built-ins. The key idea is to support predicates in rules as set-valued variables that can be used and updated in any scope, and support queries using rules as either explicit or implicit automatic calls to an inference function. We have defined a formal semantics of the language, implemented a prototype compiler that builds on an object-oriented language that supports concurrent and distributed programming and on an efficient logic rule system, and successfully used the language and implementation on benchmarks and problems from a wide variety of application domains. We describe the compilation method and results of experimental evaluation.

Type
Original Article
Copyright
© The Author(s), 2023. Published by Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Abiteboul, S., Hull, R. and Vianu, V. 1995. Foundations of Databases: The Logical Level. Addison-Wesley.Google Scholar
Anderson, J., Gaare, M., Holguín, J., Bailey, N. and Pratley, T. 2016. The Datomic database. In Professional Clojure. Wiley Online Library, Chapter 6, 169–215.Google Scholar
ANSI INCITS. 2004. Role-Based Access Control. ANSI INCITS 359-2004, American National Standards Institute, International Committee for Information Technology Standards.Google Scholar
Aref, M., ten Cate, B., Green, T. J., Kimelfeld, B., Olteanu, D., Pasalic, E., Veldhuizen, T. L. and Washburn, G. 2015. Design and implementation of the LogicBlox system. In Proceedings of the 2015 ACM SIGMOD International Conference on Management of Data. 1371–1382. https://doi.org/10.1145/2723372.2742796.CrossRefGoogle Scholar
Banbara, M., Kaufmann, B., Ostrowski, M. and Schaub, T. 2017. Clingcon: The next generation. Theory and Practice of Logic Programming 17, 4, 408461.10.1017/S1471068417000138CrossRefGoogle Scholar
Borraz-Sánchez, C., Klabjan, D., Pasalic, E. and Aref, M. 2018. SolverBlox: Algebraic modeling in Datalog. In Declarative Logic Programming: Theory, Systems, and Applications, Kifer, M. and Liu, Y. A., Eds. ACM and Morgan & Claypool, Chapter 6, 331–356. https://doi.org/10.1145/3191315.3191322.CrossRefGoogle Scholar
Bruynooghe, M., Blockeel, H., Bogaerts, B., De Cat, B., De Pooter, S., Jansen, J., Labarre, A., Ramon, J., Denecker, M. and Verwer, S. 2014. Predicate logic as a modeling language: Modeling and solving some machine learning and data mining problems with IDP3. Theory and Practice of Logic Programming 15, 6, 783817. https://doi.org/10.1017/S147106841400009X.CrossRefGoogle Scholar
Byrd, W. E. 2009. Relational programming in miniKanren: Techniques, applications, and implementations. Ph.D. thesis, Indiana University.Google Scholar
Cacace, F., Ceri, S., Crespi-Reghizzi, S., Tanca, L. and Zicari, R. 1990. Integrating object-oriented data modelling with a rule-based programming paradigm. In Proceedings of the 1990 ACM SIGMOD International Conference on Management of Data, 225–236.Google Scholar
Calejo, M. 2004. InterProlog: Towards a declarative embedding of logic programming in Java. In Proceedings of the 9th European Conference on Logics in Artificial Intelligence. LNCS, vol. 3229. Springer, 714717.Google Scholar
Caseau, Y., Josset, F.-X. and Laburthe, F. 2002. Claire: Combining sets, search and rules to better express algorithms. Theory and Practice of Logic Programming 2, 6, 769805.10.1017/S1471068401001363CrossRefGoogle Scholar
De Roover, C., Noguera, C., Kellens, A. and Jonckers, V. 2011. The SOUL tool suite for querying programs in symbiosis with Eclipse. In Proceedings of the 9th International Conference on Principles and Practice of Programming in Java, 71–80.Google Scholar
Ferraiolo, D. F., Sandhu, R., Gavrila, S., Kuhn, D. R. and Chandramouli, R. 2001. Proposed NIST standard for role-based access control. ACM Transactions on Information and Systems Security 4, 3, 224274.CrossRefGoogle Scholar
Fitting, M. 2002. Fixpoint semantics for logic programming: A survey. Theoretical Computer Science 278, 1, 2551.10.1016/S0304-3975(00)00330-3CrossRefGoogle Scholar
Gebser, M., Kaminski, R., Kaufmann, B. and Schaub, T. 2019. Multi-shot ASP solving with clingo. Theory and Practice of Logic Programming 19, 1, 2782. https://doi.org/10.1017/S1471068418000054.CrossRefGoogle Scholar
Geiger, K. 1995. Inside ODBC. Microsoft Press.Google Scholar
Hanus, M. 2013. Functional logic programming: From theory to Curry. In Programming Logics. Springer, 123–168.Google Scholar
Harkes, D. C., Groenewegen, D. M. and Visser, E. 2016. IceDust: Incremental and eventual computation of derived values in persistent object graphs. In 30th European Conference on Object-Oriented Programming. LIPIcs, vol. 56. Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, 11:1–11:26.Google Scholar
Jaeger, T. and Tidswell, J. 2000. Rebuttal to the NIST RBAC model proposal. In Proceedings of the 5th ACM Workshop on Role Based Access Control. 66.10.1145/344287.344302CrossRefGoogle Scholar
Jordan, H., Scholz, B. and Subotić, P. 2016. Soufflé: On synthesis of program analyzers. In Proceedings of the International Conference on Computer Aided Verification. Springer, 422–430.Google Scholar
Kifer, M. and Liu, Y. A., Eds. 2018. Declarative Logic Programming: Theory, Systems, and Applications. ACM and Morgan & Claypool.10.1145/3191315CrossRefGoogle Scholar
Kifer, M., Yang, G., Wan, H. and Zhao, C. 2020. Ergo Lite (a.k.a. Flora-2): User’s Manual Version 2.1. Stony Brook University. http://flora.sourceforge.net/. Accessed May 25, 2023.Google Scholar
Körner, P., Leuschel, M., Barbosa, J. A., Costa, V. S., Dahl, V., Hermenegildo, M. V., Morales, J. F., Wielemaker, J., Diaz, D., Abreu, S. and Ciatto, G. 2022. Fifty years of Prolog and beyond. Theory and Practice of Logic Programming 22, 6, 776858.CrossRefGoogle Scholar
Lamport, L. 1994. The temporal logic of actions. ACM Transactions on Programming Languages and Systems 16, 3, 872923.10.1145/177492.177726CrossRefGoogle Scholar
Li, N., Byun, J.-W. and Bertino, E. 2007. A critique of the ANSI standard on role-based access control. IEEE Security and Privacy 5, 6, 4149.10.1109/MSP.2007.158CrossRefGoogle Scholar
Liang, S., Fodor, P., Wan, H. and Kifer, M. 2009. OpenRuleBench: An analysis of the performance of rule engines. In Proceedings of the 18th International Conference on World Wide Web. ACM Press, 601610.Google Scholar
Lin, B. and Liu, Y. A. 2014 (Latest update January 30, 2022). DistAlgo: A language for distributed algorithms. http://github.com/DistAlgo. Accessed May 25, 2023.Google Scholar
LINQ 2023. Language Integrated Query (LINQ). https://docs.microsoft.com/dotnet/csharp/linq. Accessed May 25, 2023.Google Scholar
Liu, Y. A. 2018. Logic programming applications: What are the abstractions and implementations? In Declarative Logic Programming: Theory, Systems, and Applications, Kifer, M. and Liu, Y. A., Eds. ACM and Morgan & Claypool, Chapter 10, 519–557. Also https://arxiv.org/abs/1802.07284.Google Scholar
Liu, Y. A. and Stoller, S. D. 2007. Role-based access control: A corrected and simplified specification. In Department of Defense Sponsored Information Security Research: New Methods for Protecting Against Cyber Threats. Wiley, 425–439.Google Scholar
Liu, Y. A. and Stoller, S. D. 2009. From Datalog rules to efficient programs with time and space guarantees. ACM Transactions on Programming Languages and Systems 31, 6, 138. https://doi.org/10.1145/1552309.1552311.CrossRefGoogle Scholar
Liu, Y. A. and Stoller, S. D. 2020. Founded semantics and constraint semantics of logic rules. Journal of Logic and Computation 30, 8 (Dec.), 16091638. Also http://arxiv.org/abs/1606.06269.10.1093/logcom/exaa056CrossRefGoogle Scholar
Liu, Y. A. and Stoller, S. D. 2021. Knowledge of uncertain worlds: Programming with logical constraints. Journal of Logic and Computation 31, 1 (Jan.), 193212. Also https://arxiv.org/abs/1910.10346.CrossRefGoogle Scholar
Liu, Y. A. and Stoller, S. D. 2022. Recursive rules with aggregation: A simple unified semantics. Journal of Logic and Computation 32, 8 (Dec.), 16591693. Also http://arxiv.org/abs/2007.13053.10.1093/logcom/exac072CrossRefGoogle Scholar
Liu, Y. A., Stoller, S. D. and Lin, B. 2017. From clarity to efficiency for distributed algorithms. ACM Transactions on Programming Languages and Systems 39, 3 (May), 12:112:41. Also http://arxiv.org/abs/1412.8461.10.1145/2994595CrossRefGoogle Scholar
Liu, Y. A., Stoller, S. D., Lin, B. and Gorbovitski, M. 2012. From clarity to efficiency for distributed algorithms. In Proceedings of the 27th ACM SIGPLAN Conference on Object-Oriented Programming, Systems, Languages and Applications, 395–410.Google Scholar
Liu, Y. A., Stoller, S. D., Tong, Y. and Lin, B. 2023. Integrating logic rules with everything else, seamlessly. Computing Research Repository arXiv:2305.19202 [cs.PL]. CrossRefGoogle Scholar
Liu, Y. A., Stoller, S. D., Tong, Y., Lin, B. and Tekle, K. T. 2022. Programming with rules and everything else, seamlessly. Computing Research Repository arXiv:2205.15204 [cs.PL]. http://arxiv.org/abs/2205.15204.Google Scholar
Liu, Y. A., Stoller, S. D., Tong, Y. and Tekle, K. T. 2023. Benchmarking for integrating logic rules with everything else. In Proceedings of the 39th International Conference on Logic Programming (Technical Communications). Open Publishing Association.10.4204/EPTCS.385.3CrossRefGoogle Scholar
Madsen, M. and Lhoták, O. 2020. Fixpoints for the masses: Programming with first-class Datalog constraints. Proceedings of the ACM on Programming Languages 4, OOPSLA, 1–28.Google Scholar
Madsen, M., Yee, M.-H. and Lhoták, O. 2016. From Datalog to Flix: A declarative language for fixed points on lattices. ACM SIGPLAN Notices 51, 6, 194208.10.1145/2980983.2908096CrossRefGoogle Scholar
Maier, D., Tekle, K. T., Kifer, M. and Warren, D. S. 2018. Datalog: Concepts, history and outlook. In Declarative Logic Programming: Theory, Systems, and Applications, Kifer, M. and Liu, Y. A., Eds. ACM and Morgan & Claypool, Chapter 1, 3–120.Google Scholar
Meijer, E., Beckman, B. and Bierman, G. 2006. LINQ: reconciling object, relations and XML in the .NET framework. In Proceedings of the 2006 ACM SIGMOD International Conference on Management of Data. 706–706.Google Scholar
Miller, D. and Nadathur, G. 2012. Programming with Higher-Order Logic. Cambridge University Press.10.1017/CBO9781139021326CrossRefGoogle Scholar
Redl, C. 2016. The DLVHEX system for knowledge representation: Recent advances (system description). Theory and Practice of Logic Programming 16, 5–6, 866883.CrossRefGoogle Scholar
Reese, G. 2000. Database Programming with JDBC and JAVA. O’Reilly Media, Inc.Google Scholar
Rothamel, T. and Liu, Y. A. 2007. Efficient implementation of tuple pattern based retrieval. In Proceedings of the ACM SIGPLAN 2007 Workshop on Partial Evaluation and Program Manipulation, 81–90. https://doi.org/10.1145/1244381.1244394.CrossRefGoogle Scholar
Roy, P. V. and Haridi, S. 2004. Concepts, Techniques, and Models of Computer Programming. MIT Press.Google Scholar
Ryzhyk, L. and Budiu, M. 2019. Differential datalog. In Datalog 2.0, 3rd International Workshop on the Resurgence of Datalog in Academia and Industry, 56–67.Google Scholar
Sagonas, K., Swift, T. and Warren, D. S. 1994. XSB as an efficient deductive database engine. In Proceedings of the 1994 ACM SIGMOD International Conference on Management of Data. ACM Press, 442453.Google Scholar
Sandhu, R., Ferraiolo, D. and Kuhn, R. 2000. The NIST model for role-based access control: Towards a unified standard. In Proceedings of the 5th ACM Workshop on Role-Based Access Control, 47–63.Google Scholar
Somogyi, Z., Henderson, F. J. and Conway, T. C. 1995. Mercury, an efficient purely declarative logic programming language. Australian Computer Science Communications 17, 499512.Google Scholar
Sterling, L. and Shapiro, E. 1994. The Art of Prolog, 2nd ed. MIT Press.Google Scholar
Swift, T., Warren, D. S., Sagonas, K., Freire, J., Rao, P., Cui, B., Johnson, E., de Castro, L., Marques, R. F., Saha, D., Dawson, S. and Kifer, M. 2022. The XSB System Version 5.0,x. http://xsb.sourceforge.net. Latest release May 12, 2022.Google Scholar
Tekle, K. T. and Liu, Y. A. 2010. Precise complexity analysis for efficient Datalog queries. In Proceedings of the 12th International ACM SIGPLAN Symposium on Principles and Practice of Declarative Programming, 35–44. https://doi.org/10.1145/1836089.1836094.CrossRefGoogle Scholar
Tekle, K. T. and Liu, Y. A. 2011. More efficient Datalog queries: Subsumptive tabling beats magic sets. In Proceedings of the 2011 ACM SIGMOD International Conference on Management of Data, 661–672. http://doi.acm.org/10.1145/1989323.1989393.Google Scholar
Tong, Y., Lin, B., Liu, Y. A. and Stoller, S. D. 2023. ALDA. http://github.com/DistAlgo/alda. Accessed May 25, 2023.Google Scholar
Vennekens, J. 2017. Lowering the learning curve for declarative programming: A Python API for the IDP system. In Proceedings of 19th International Symposium on Practical Aspects of Declarative Languages. Springer, 86102.Google Scholar
Warren, D. S. and Liu, Y. A. 2017. AppLP: A dialogue on applications of logic programming. Computing Research Repository arXiv:1704.02375 [cs.PL]. Google Scholar
Yang, G. and Kifer, M. 2000. FLORA: Implementing an efficient DOOD system using a tabling logic engine. In Proceedings of the 1st International Conference on Computational Logic. Springer, 1078–1093. https://doi.org/10.1007/3-540-44957-4_72.CrossRefGoogle Scholar
Zhou, N.-F. 2016. Programming in Picat. In Proceedings of the 10th International Symposium on Rule Technologies: Research, Tools, and Applications. Springer, 318.Google Scholar