Abstract
Logic programs and imperative programs employ different notions of computing. Logic programs compute by proving that a goal is a logical consequence of the program, or by showing that the goal is true in a model defined by the program. Imperative programs compute by starting from an initial state, executing actions to transition from one state to the next, and terminating (if at all) in a final state when the goal is solved.
In this paper, we present the language LPS (Logic Production Systems), which combines the logic programming and imperative programming notions of computing. Programs in LPS compute by using beliefs, represented by logic programs, to model the changing world, and by executing actions, to change the world, to satisfy goals, represented by reactive rules and constraints.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Alferes, J.J., Brogi, A., Leite, J.A., Pereira, L.M.: Evolving logic programs. In: Flesca, S., Greco, S., Ianni, G., Leone, N. (eds.) JELIA 2002. LNCS (LNAI), vol. 2424, pp. 50–62. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45757-7_5
Barringer, H., Fisher, M., Gabbay, D., Owens, R., Reynolds, M.: The imperative future: principles of executable temporal logic. John Wiley & Sons, Inc. (1996)
Boella, G., der Torre, L.V.: Regulative and constitutive norms in the design of normative multiagent systems. In International Workshop on Computational Logic in Multi-Agent Systems, pp. 303–319, Springer (2005)
Bonner, A., Kifer, M.: Transaction logic programming. In: Warren D.S. (ed.) Logic Programming: Proc. of the 10th International Conf., pp. 257–279 (1993)
Carro, M., Hermenegildo, M.: Concurrency in Prolog Using Threads and a Shared Database. 1999 International Conference on Logic Programming, pp. 320–334, MIT Press, Cambridge (1999)
Flesca, S., Greco, S., Ianni, G., Leone, N. (eds.): JELIA 2002. LNCS (LNAI), vol. 2424. Springer, Heidelberg (2002). https://doi.org/10.1007/3-540-45757-7
Davila, J.: Rock-Paper-Scissors (2017). https://demo.logicalcontracts.com/p/rps-gets.pl
Denecker, M., Vennekens, J.: Building a knowledge base system for an integration of logic programming and classical logic. In: Garcia de la Banda, M., Pontelli, E. (eds.) ICLP 2008. LNCS, vol. 5366, pp. 71–76. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-89982-2_12
Schrijvers, T., Frühwirth, T. (eds.): Constraint Handling Rules. LNCS (LNAI), vol. 5388. Springer, Heidelberg (2008). https://doi.org/10.1007/978-3-540-92243-8
Genesereth, M.: Dynamic Logic Programming. In: Warren, D., Dahl, V., Eiter, T., Hermenegildo, M., Kowalski, R. and Rossi, F. (eds.) Prolog - The Next 50 Years. LNCS, vol. 13900. Springer (2023)
Harel, D.: Statecharts: A Visual Formalism for Complex Systems. Sci. Comput. Programming 8, 231–274 (1987)
Kakas, A., Kowalski, R., Toni, F. : The Role of Logic Programming in Abduction. In: Gabbay, D., Hogger, C.J., Robinson, J.A. (eds.) Handbook of Logic in Artificial Intelligence and Programming 5, pp. 235–324. Oxford University Press (1998)
Kowalski, R.: Computational logic and human thinking: how to be artificially intelligent. Cambridge University Press (2011)
Kowalski, R., Dávila, J., Sartor, G., Calejo, M.: Logical english for law and education. In: Warren, D., Dahl, V., Eiter, T., Hermenegildo, M., Kowalski, R., Rossi, F. (eds.) Prolog - The Next 50 Years. LNCS, vol. 13900. Springer (2023)
Kowalski, R., Sadri, F.: Logic Programming towards multi-agent systems. Ann. Math. Artif. Intell. 25, 391–419 (1999)
Kowalski, R., Sadri, F.: Integrating logic programming and production systems in abductive logic programming agents. In: Polleres, A., Swift, T. (eds.) RR 2009. LNCS, vol. 5837, pp. 1–23. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-05082-4_1
Kowalski, R., Sadri, F.: An agent language with destructive assignment and model-theoretic semantics. In: Dix, J., Leite, J., Governatori, G., Jamroga, W. (eds.) CLIMA 2010. LNCS (LNAI), vol. 6245, pp. 200–218. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-14977-1_16
Kowalski, R., Sadri, F.: Abductive logic programming agents with destructive databases. Ann. Math. Artif. Intell. 62(1), 129–158 (2011)
Kowalski, R., Sadri, F.: A Logic-based framework for reactive systems. In: Bikakis, A., Giurca, A. (eds.) RuleML 2012. LNCS, vol. 7438, pp. 1–15. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-32689-9_1
Kowalski, R., Sadri, F.: A logical characterization of a reactive system language. In: Bikakis, A., Fodor, P., Roman, D. (eds.) RuleML 2014. LNCS, vol. 8620, pp. 22–36. Springer, Cham (2014). https://doi.org/10.1007/978-3-319-09870-8_2
Kowalski, R., Sadri, F.: Model-theoretic and operational semantics for Reactive Computing. N. Gener. Comput. 33(1), 33–67 (2015)
Kowalski, R., Sadri, F.: Programming in logic without logic programming. Theory Pract. Logic Program. 16(3), 269–295 (2016)
Kowalski, R., Sergot, M.: A Logic-based Calculus of Events. In: New Generation Computing, Vol. 4, No.1, 67--95 (1986). Also in: Inderjeet Mani, J. Pustejovsky, and R. Gaizauskas (eds.) The Language of Time: A Reader, Oxford University Press (2005)
Lifschitz, V. Answer set programming. Springer (2019)
McCarthy, J., Hayes, P.J.: Some philosophical problems from the standpoint of artificial intelligence. In: Readings in artificial intelligence, pp. 431–450. Morgan Kaufmann (1981)
Meister, M., Djelloul, K., Robin, J.: Unified semantics for Constraint Handling Rules in transaction logic. In International Conference on Logic Programming and Nonmonotonic Reasoning, pp. 201–213. Springer (2007)
Newell, A., Simon, H.A.: Human problem solving vol. 104, No. 9. Prentice-Hall, Englewood Cliffs, NJ (1972)
Nicolas, J.M., Gallaire, H.: Database: Theory vs. Interpretation. In: Gallaire, H., Minker, J. (eds.) Logic and Databases, Plenum, New York (1978)
OMG. (Object Management Group): Semantics of Business Vocabulary and Rules (SBVR), OMG Standard, v. 1.0. (2008)
Rao, P., Sagonas, K., Swift, T., Warren, D.S., Freire, J.: XSB: a system for efficiently computing well-founded semantics. In: Dix, J., Furbach, U., Nerode, A. (eds.) LPNMR 1997. LNCS, vol. 1265, pp. 430–440. Springer, Heidelberg (1997). https://doi.org/10.1007/3-540-63255-7_33
Russell, S.J., Norvig, P.: Artificial intelligence: a modern approach, 2nd edn. Prentice Hall, Upper Saddle River, NJ (2003)
Sadri F., Kowalski R.: A Theorem-Proving Approach to Database Integrity. In: Minker, J. (ed.) Foundations of Deductive Databases and Logic Programming, Morgan Kaufmann, pp. 313–362 (1988)
Stenning, K., van Lambalgen M.: Human Reasoning and Cognitive Science. MIT Press (2012)
Thagard, P.: Mind: Introduction to Cognitive Science. Second Edition. MIT Press (2005)
Warren, D. S., Denecker, M.: A better semantics for prolog. In: Warren, D., Dahl, V., Eiter, T., Hermenegildo, M., Kowalski, R. and Rossi, F. (eds.) Prolog - The Next 50 Years. LNCS, vol. 13900. Springer, Heidelberg (2023)
Wason, P.C.: Reasoning about a rule. Q. J. Exp. Psychol. 20(3), 273–281 (1968)
Widom, J., Ceri, S. (eds.) Active database systems: Triggers and rules for advanced database processing. Morgan Kaufmann (1995)
Wielemaker, J., Riguzzi, F., Kowalski, R.A., Lager, T., Sadri, F., Calejo, M.: Using SWISH to realise interactive web-based tutorials for logic-based languages. Theory Pract. Logic Program. 19(2), 229–261 (2019)
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG
About this chapter
Cite this chapter
Kowalski, R., Sadri, F., Calejo, M., Dávila, J. (2023). Combining Logic Programming and Imperative Programming in LPS. In: Warren, D.S., Dahl, V., Eiter, T., Hermenegildo, M.V., Kowalski, R., Rossi, F. (eds) Prolog: The Next 50 Years. Lecture Notes in Computer Science(), vol 13900. Springer, Cham. https://doi.org/10.1007/978-3-031-35254-6_17
Download citation
DOI: https://doi.org/10.1007/978-3-031-35254-6_17
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-031-35253-9
Online ISBN: 978-3-031-35254-6
eBook Packages: Computer ScienceComputer Science (R0)