Programming environments have evolved from purely text based to using
graphical user interfaces, and now we see a move towards web based
interfaces, such as Jupyter. Web based interfaces allow for the
interactive documents that consist of text and programs, as well as
their output. The output can be rendered using web technology as, e.g.,
text, tables, charts or graphs. This approach is particularly suitable
for capturing data analysis workflows and creating interactive
educational material. This article describes SWISH, a web front-end for
Prolog that consists of a web server implemented in SWI-Prolog and a
server where multiple users can manipulate and run the same material,
and it can be adapted to support Prolog extensions. In this paper we
describe the architecture of SWISH, and describe two case studies of
extensions of Prolog, namely Probabilistic Logic Programming (PLP) and Logic
Production System (LPS), which have used SWISH to provide tutorial
See pages 15-22 for an introduction to LPS on SWISH.
The Logical Contracts Server extends the Swish implementation of LPS, with a view towards representing and executing smart legal contracts. It builds upon decades of research on the use of logic programming to represent legal documents. But it also exploits the use of reactive rules and causal laws in LPS to represent obligations and prohibitions.
LPS also builds upon the event calculus ontology of events, fluents and time, but using destructive state transitions, without frame axioms. As argued by van Lambalgen and Hamm, the event calculus provides a useful framework for formalising natural language expressions of tense and aspect. Logical Contracts aim to exploit this connection between the event calculus and natural language, to provide a simplified natural language representation of contracts.
The examples menu of the Logical Contracts Server contains some preliminary examples of Logical Contracts and their English formulation.
In modal deontic logics, the focus is on inferring logical consequences, for example inferring whether an obligation O mail, to mail a letter, logically implies O [mail or burn], an obligation to mail or burn the letter. Here I present an alternative approach in which obligations are sentences (such as mail) in first-order logic (FOL), and the focus is on satisfying those sentences by making them true in some best model of the world. To facilitate this task and to make it manageable, candidate models are defined by a logic program (LP) extended by means of candidate action assumptions (A). The resulting combination of FOL, LP and A is a variant of abductive logic programming (ALP).
LPS aims to fill the gap between logical and imperative computer languages. It combines goals of the logical form if antecedent then consequent with beliefs of the logic programming form conclusion if conditions.
Computation in LPS generates commands to make consequents of goals true whenever antecedents become true. It uses beliefs to decompose problems of determining whether a conclusion is true or of making a conclusion true to sub-problems of determining or making the conditions true.
This project, led by Fariba Sadri, to support the teaching of computing and logic in secondary school. The first stage (October 2016 – March 2017) has developed an open-source, web-based prototype of the computer language LPS (Logic-based Production System), together with motivating educational examples.
The online prototype is implemented in Prolog and running on SWI Prolog's SWISH. To try it, click here, go to the Examples menu, and click on LPS Examples
or on First steps with LPS.
For more information and more links, go to the LPS website.
Formalising deontic notions, such as obligation, prohibition and permission, is notoriously difficult. Among the many problems are both the problem of reasoning with conflicting obligations, and the related problem of reasoning with contrary-to-duty obligations, which arise when the violation of a primary obligation p is compensated by a secondary obligation q.
In this paper we propose a formalisation in which obligations are interpreted as goals in abductive logic programming (ALP), and satisfying a goal p is understood as generating a classical, non-modal model that makes p true, where some models may be better than others. To say that p is obligatory, is to require that p be true in all best models. To say that p is obligatory, but may be violated, resulting in a less than ideal situation q, means that the real goal is p or q (equivalently if not p then q), and that models in which p is true are better than models in which q is true.
We argue that the ALP approach to the representation of obligations has the advantage that it does not require the invention of a special-purpose logic, but is a general approach, which is suitable for many other applications, including abductive explanations, non-monotonic reasoning, combinatorial optimisation, and reactive systems of the production system variety.
In previous work, we proposed a logic-based framework in which computation is the execution of actions in an attempt to make reactive rules of the form if antecedent then consequent true in a canonical model of a logic program determined by an initial state, sequence of events, and the resulting sequence of subsequent states. In this model-theoretic semantics, reactive rules are the driving force, and logic programs play only a supporting role.
In the canonical model, states, actions and other events are represented with timestamps. But in the operational semantics, for the sake of efficiency, timestamps are omitted and only the current state is maintained. State transitions are performed reactively by executing actions to make the consequents of rules true whenever the antecedents become true. This operational semantics is sound, but incomplete. It cannot make reactive rules true by preventing their antecedents from becoming true, or by proactively making their consequents true before their antecedents become true.
In this paper, we characterize the notion of reactive model, and prove that the operational semantics can generate all and only such models. In order to focus on the main issues, we omit the logic programming component of the framework.
In this paper we propose a logic-based, framework inspired by artificial intelligence, but scaled down for practical database and programming applications. Computation in the framework is viewed as the task of generating a sequence of state transitions, with the purpose of making an agent's goals all true. States are represented by sets of atomic sentences (or facts), representing the values of program variables, tuples in a coordination language, facts in relational databases, or Herbrand models.
In the model-theoretic semantics, the entire sequence of states and events are combined into a single model-theoretic structure, by associating timestamps with facts and events. But in the operational semantics, facts are updated destructively, without timestamps. We show that the model generated by destructive updates is identical to the model generated by reasoning with facts containing timestamps. We also extend the model with intentional predicates and composite event predicates defined by logic programs containing conditions in first-order logic, which query the current state.
This history covers some of the highlights of the development of logic programming from the late 1960s into the 21st century. It focuses on a number of issues that continue to be important today:
the difference between solving a goal by theorem-proving and solving it by model generation,
the difference between solving a goal top-down and solving it bottom-up, and
the relationship between declarative and procedural representations.
This earlier draft of a book of the same title, published in July 2011 by Cambridge University Press, presents the
principles of Computational Logic, so that they can be applied in everyday life. I have written the main part of the book informally, both to reach a wider audience and to argue more convincingly that Computational Logic is useful for
human thinking. However, I have also included a number of additional, more formal chapters for the more advanced reader.
Here are some extracts from the reviews:
By Thomas A. Blackson, Arizona State University, on the back cover:
"Computational Logic and Human Thinking is a superb introduction both to AI from within a computational logic framework and to its application to human rationality and reasoning. Nothing else comes close. Kowalski writes with philosophical insight and just the right level of technical expertise. He puts the excitement back in AI. This sets Computational Logic and Human Thinking apart from the technically overwhelming, and all too often largely unintuitive and uninspiring, encyclopedic introductions that currently dominate the field.
By Donald Gillies, University College London, on the back cover:
"Artificial Intelligence (or AI) tries to program computers so that they can think intelligently like humans. In this book, one of the pioneers of AI suggests something new and original, namely to use the results of AI to improve human thinking ... Anyone who wants to reason better and more effectively in everyday life should study Robert Kowalski's book."
By Alan Bundy, Artificial Intelligence, June-July 2013:
"Computational Logic and Human Thinking might make an excellent basis for a course on AI for non-science students. It covers a wide range of AI techniques in an accessible form and within a uniform framework, with more technical details available as optional extensions. Moreover, Kowalski's enthusiasm for and dedication to his subject shines through on every page."
By George Luger, Computing in Science and Engineering, July/August 2012:
"In this serious and enjoyable book, Kowalski proposes a specific, utilitarian, and sufficient model, in the scientific sense, of human subject/world communications. And, as Aristotle suggested long ago, the sufficiency of this logic-based representational effort could offer insights that can lead to more coherent reasoning, writing, discussions, and arguments by human agents."
By Corrado Mencar, Computing Reviews, October, 2012:
"In sum, this book could be of greatest value to computer science students and professionals who want to improve their computational thinking and have come to see topical discipline to be applied to everyday problems and situations."
By Luis Moniz Pereira, Association of Logic Programming Newsletter, January 2012:
"The book is within clear grasp of a general higher-educated audience, because of the adept and informal naturalness with which it addresses, explains and exemplifies nevertheless non-trivial issues in knowledge representation and reasoning. It is also a treasure trove for teachers and researchers alike, as it admirably integrates the author's longstanding groundbreaking and fertile research efforts, and expounds with clarity and simplicity the unifying epistemological virtues of the Computational Logic paradigm - one that is supported by a vast community of researchers."
"A job well done." "An interesting book." "An excellent book and deserves a wide readership!"
"6 von 5 sternen"
By Lornz Demey, Tijdschrift voor Filosofie vol:75 issue:2 pages:395-397:
"Samenvattend kan gesteld worden dat Kowalski erin geslaagd is een boek te schrijven dat zowel de geïnteresseerde leek als de meer gespecialiseerde lezer zal (blijven) boeien."
According to Google translate: In summary we can say that Kowalski has managed to write a book that will facinate both the interested layman as well as the more specialized reader.
The book was originally published in 1979 and based on lecture notes written in 1974. The preface describes the goals of the book in the following terms:
This book investigates the application of logic to problem-solving and computer programming. It assumes no previous knowledge of these fields, and may be appropriate therefore as an introduction to
I worked with WHO and UNICEF from 2009 to 2013, helping to develop, implement and deploy a set of logical rules to assist in estimating global, country by country, infant immunization coverage. The problem is to reconcile inconsistencies when different sources of data conflict - for example when government reported data is inconsistent with survey data. The purpose of the logical rules is to make the reconciliation and estimation process more transparent and more consistent.
The rules have been implemented in XSB Prolog as a purely declarative logic program, and have been used to assist in making the annual estimates since 2010. In addition to helping to ensure transparency and consistency, the Prolog implementation has also proved useful in providing detailed documentation of the rationale for each of the estimates.
There are two articles describing our work. The first, published in the online journal PLOS-ONE, describes our work for a general audience with little or no computing background. The second, presented at JURISIN 2011, describes the work for a more academic audience and compares it with previous work on the logical formalisation of the British Nationality Act.
Early papers on theorem-proving, logic programming and knowledge representation:
Kowalski, R. and Hayes, P.J. Semantic Trees in Automatic Theorem-Proving. In Machine Intelligence 4, (eds. B. Meltzer and D. Michie), Edinburgh University Press, 1969, pp. 181-201. Reprinted in Anthology of Automated Theorem-Proving Papers, Vol. 2, Springer-Verlag, 1983, pp. 217-232.
Kowalski, R. Search Strategies for Theorem-proving. In Machine Intelligence 5, (eds. B. Meltzer and D. Michie), Edinburgh University Press, 1970, pp. 181-201.
Kowalski, R. Studies in the Completeness and Efficiency of Theorem-proving by Resolution. Ph.D. Thesis, University of Edinburgh, 1970.
Kowalski, R. And-or Graphs, Theorem-proving Graphs and Bi-directional Search. In Machine Intelligence 7, (eds. B. Meltzer and D. Michie), Edinburgh University Press, 1972, pp. 167-94.
Kowalski, R. and Kuehner, D.,
Resolution with Selection Function
In Artificial Intelligence, Vol. 2, 1971, pp. 227-60.
Reprinted in Anthology of Automated Theorem-Proving Papers, Vol. 2, Springer-Verlag, 1983, pp. 542-577.
Procedure Using Connection Graphs
In JACM Vol. 22, No. 4, 1975, pp. 572-595.
van Emden, M. and Kowalski, R. The Semantics of Predicate Logic as a Programming Language In JACM , Vol. 23, No. 4, 1976, pp. 733-742.
Deliyanni, A. and Kowalski, R.
Logic and Semantic Networks
In CACM, Vol. 22, No. 3, 1979, pp. 184-192.
Algorithm = Logic + Control
In CACM, Vol. 22, No. 7, 1979, pp. 424-436. Reprinted in Programming Languages: A Grand Tour, Third Edition, (ed. E. Horwitz), Computer Science Press, Maryland, 1986, pp. 480-492.
Kowalski, R. The Relationship between Logic Programming and Logic Specification In Phil. Trans. R. Soc. Lond. A, Vol 312, 1984, pp. 345-361.
Logic Programming in Artificial Intelligence and Software Engineering
In Future Generation Computing Systems, Vol. 1, No. 1, North Holland, July 1984, pp. 39-49.
Kowalski, R. The Limitations of Logic In Proceedings of ACM Computer Science Conference, 1986, pp 7-13. Revised version in Proceedings of SEAS, Heidelberg, 1986, pp. 1-13. Also in Knowledge Base Management Systems, (eds. C. Thanos and J. W. Schmidt), Springer-Verlag, pp. 477-489.
Kowalski, R., Sadri, F. and Soper, P. Integrity Checking in Deductive Databases In Proceedings of VLDB, Morgan Kaufmann, Los Altos, Ca., 1987, pp. 61-69.
Kowalski, R. The Early Years of Logic Programming In CACM, 1988, Vol. 31, No. 1, pp. 38-43.
Kowalski, R. Logic as a Computer Language for Children, In Proceedings of European Conference on Artificial Intelligence, Orsay, France, July 1982. Reprinted in New Horizons in Educational Computing, (ed. M. Yazdani), Ellis Horwood Ltd., Chichester, 1984, pp. 121-144. Reprinted in Progress in Artificial Intelligence, (eds. L. Steel and J. A. Campbell), Ellis Horwood Ltd., Chichester.
Kowalski, R. A Proposal for an Undergraduate Degree in Uses of Logic, In Proceedings of the Prague Unesco Symposium on Artificial Intelligence and Higher Education. (eds. V. Marik, O. Stepankova, and Z. Zdahal), Springer-Verlag, 1990, pp. 94-97.
Kowalski, R. An Undergraduate Degree in Practical Reasoning, Editorial, Journal of Logic and Computation, Vol. 3, No. 3, 1993, pp. 227-229.
Legal reasoning and argumentation
Sergot, M., Sadri, F., Kowalski,
R., Kriwaczek, F., Hammond, P., and Cory,T.
The British Nationality Act as a Logic Program
In CACM, Vol. 29, No. 5, 1986, pp. 370-386.
Treatment of Negation in Logic Programs for Representing Legislation
In Proceedings of Second International Conference on AI and Law, (ed. E. Rissland) Vancouver, Canada, ACM Press, 1989, pp. 11-15.
R. Kowalski, Legislation as Logic Programs
In: Logic Programming in Action (eds. G. Comyn , N. E. Fuchs, M. J. Ratcliffe), Springer Verlag, pages 203-230 (1992)
Kowalski, F. Toni,
and Reconciliation ,
In: International Symposium on Fifth Generation Computer Systems '94, Workshop on Legal Reasoning, Tokyo, pages 9-16 (1994)
Kowalski, F. Toni, Abstract
In: Artificial Intelligence and Law Journal 4(3-4), Special Issue on Logical Models of Argumentation, H. Prakken and G. Sartor, eds., Kluwer Academic Publishers, pages 275-296 (1996)
Kowalski, R. and Kim, J. S.
Metalogic Programming Approach to Multi-Agent Knowledge and Belief
In Artificial Intelligence and Mathematical Theory of Computation (ed. V. Lifschitz), Academic Press, 1991, pp. 231-246.
without Model Theory,
In: What is a logical system?, D. Gabbay ed., Oxford University Press (1995)
Kowalski, R. and Sergot, M.
Logic-based Calculus of Events
In New Generation Computing, Vol. 4, No.1, February 1986, pp. 67-95. Also in Knowledge Base Management-Systems, (eds. C. Thanos and J. W. Schmidt), Springer-Verlag, pp. 23-51. Also in The Language of Time: A Reader (eds. Inderjeet Mani, J. Pustejovsky, and R. Gaizauskas) Oxford University Press. 2005.
Updates in the Event Calculus
In Journal of Logic Programming, 1992, Vol. 12, No. 162, pp. 121-146.
R. Kowalski, F. Sadri, The situation calculus and event calculus compared , In: Proc. International Logic Programming Symposium, ILPS'94 (1994)
Sripada, S.M., Rosser, B.L., Bedford, J.M. and Kowalski, R.A. Temporal database technology for air traffic flow management. In: International Conference on Applications of Databases (pp. 28-41). Springer(1994)
F. Sadri, R. Kowalski, Variants of the event calculus , In: Proc. International Conference on Logic Programming, L. Sterling, ed., MIT Press (1995)
R. Kowalski, F. Sadri, Reconciling the Situation Calculus and Event Calculus , In: Journal of Logic Programming Vol. 31, pages 39-58, Special Issue on Reasoning about Action and Change (1997)
Abductive Logic Programming
K. Eshghi and R. Kowalski, Abduction Compared with Negation as Failure, Sixth International Conference on Logic Programming (1989)
Kakas, R. Kowalski, F. Toni, Abductive logic programming ,
In: Journal of Logic and Computation 2(6) pages 719-770 (1992)
R. Kowalski, F. Toni, G. Wetzel,
Towards a declarative and efficient glass-box CLP language ,
In: Proc. of Logic Programming Workshop WLP'94, N. Fuchs and G. Gottlob, eds.,
F. Toni, R. Kowalski, Reduction of abductive logic programs to normal logic programs , In: Proc. International Conference on Logic Programming, L. Sterling, ed., MIT Press, pages 367-381 (1995)
Wetzel, R. Kowalski, F. Toni,
Theorem-Proving Approach to CLP, In: Proc. of Logic Programming Workshop WLP'95, A. Krall
and U. Geske, eds.,
R. Kowalski, G. Wetzel, F. Toni, A Unifying Framework for ALP, CLP and SQO , Technical Report, Department of Computing, Imperial College, London (1996)
Fung, T.H. and Kowalski, R. The IFF Proof Procedure for Abductive Logic Programming. Journal of Logic Programming, 1997.
A. C. Kakas, R. Kowalski, F. Toni, The Role of Abduction in Logic Programming , In: Handbook of Logic in Artificial Intelligence and Logic Programming 5, pages 235-324, D.M. Gabbay, C.J. Hogger and J.A. Robinson eds., Oxford University Press (1998)
R.A. Kowalski, F. Toni, G. Wetzel, Executing Suspended Logic Programs , In: Fundamenta Informatica 34 (3) (1998)
From Abduction to Argumentation
A. Bondarenko, F. Toni, R. Kowalski, An Assumption-based Framework for Non-monotonic Reasoning , In: Proc. 2nd International Workshop on Logic Programming and Non-monotonic Reasoning, L.M. Pereira and A. Nerode, eds., pages 171-189 (1993)
F. Toni, R. Kowalski, An argumentation-theoretic approach to logic program transformation , In: Proc. LOPSTR'95, International Workshop on Logic Program Synthesis and Transformation, M. Proietti ed., LNCS 1048, Springer Verlag, pages 61-75 (1995)
P.M. Dung, R. Kowalski, F. Toni, Synthesis of proof procedures for default reasoning , In: Proc. LOPSTR'96, International Workshop on Logic Program Synthesis and Transformation, J. Gallagher ed., LNCS 1207, Springer Verlag, pages 313-324 (1996)
A. Bondarenko, P.M. Dung, R. Kowalski, F. Toni, An abstract, argumentation-theoretic approach to default reasoning, In: Artificial Intelligence 93(1-2) pages 63-101 (1997)
Dung, P. M., Kowalski, R., and Toni, F. Dialectic proof procedures for assumption-based, admissible argumentation , Journal of Artificial Intelligence 170(2), February 2006, pp. 114-159
Kowalski, R., Logic-based Open Systems, Department of Computing, Imperial College, 1985. In Representation and Reasoning. Jakob ph. Hoepelman (Hg.) Max Niemeyer Verlag, Tübingen 1988, pp. 125-134.
R. Kowalski, Using metalogic to reconcile reactive with rational agents , In: Meta-Logics and Logic Programming (K. Apt and F. Turini, eds.), MIT Press (1995)
R. Kowalski, F. Sadri, Towards a unified agent architecture that combines rationality with reactivity, In: Proc. International Workshop on Logic in Databases, San Miniato, Italy, Springer- Verlag, LNCS 1154 (1996)
Kowalski, F. Sadri, An Agent
Architecture that Unifies Rationality with Reactivity,
Department of Computing, Imperial College (1997)
Kowalski, F. Sadri,
Programming towards Multi-agent Systems,
In: Annals of Mathematics and Artificial Intelligence Volume 25, pages 391-419 (1999)
intelligence and the Natural World,
Cognitive Processing, Volume 2 (2001)
Launching the new era.
Communications of the ACM, 36(3), pp.49-100.
MIT Encyclopaedia of Cognitive Science (eds. R A Wilson and F C Keil) MIT Press (1999)
Programming and the Real World
Logic Programming Newsletter. January 2001
for Logic Programming
Computational Logic: Logic Programming and Beyond (eds. A C Kakas and F Sadri) Springer, 2002, 26-32.
Time to think like a Computer,
New Scientist 3 December 2011
Updated 10 April 2018