## Abstract

The discussion of answer set programming in this book is incomplete in three ways. First, it says almost nothing about the algorithms that answer set solvers use to find stable models, about what happens “under the hood.” Section 3.4 is, in fact, the only place where the operation of answer set solvers is discussed in any detail. The algorithms implemented in Smodels are described in Chaps. 3 and 4 of the doctoral dissertation of one of its designers (Simons, Extending and implementing the stable model semantics. Ph.D. Thesis, Helsinki University of Technology, 2000). You can learn about the operation of clingo from Chaps. 4 and 6 of the book (Gebser et al. Answer set solving in practice. Synthesis lectures on artificial intelligence and machine learning. Morgan and Claypool Publishers, 2012) written by members of the Potassco team.

The discussion of answer set programming in this book is incomplete in three ways. First, it says almost nothing about the algorithms that answer set solvers use to find stable models, about what happens “under the hood.” Section 3.4 is, in fact, the only place where the operation of answer set solvers is discussed in any detail. The algorithms implemented in Smodels are described in Chaps. 3 and 4 of the doctoral dissertation of one of its designers [112]. You can learn about the operation of clingo from Chaps. 4 and 6 of the book [45] written by members of the Potassco team.

Second, there are several useful answer set programming constructs that we did not have a chance to mention. Some of them are available in the language of clingo—conditional literals, external functions, and multi-shot solving. They are described in the Potassco User Guide, which can be downloaded from the website of the Potassco project, https://potassco.org. One other interesting construct, intensional functions, is motivated by the fact that ASP definitions of functions are somewhat cumbersome. Compare, for instance, the definition of the predicate fac/2 in lines 5 and 6 of Listing 2.6 (page 19) with the definition of factorial in Haskell (page 2). Incorporating intensional functions is an attempt to overcome this defect by merging ASP with functional programming [6, 11, 17]. We did not talk about the use of external information sources [29], about rules with ordered disjunction [14], ASP with sorts [4], ASP with consistency-restoring rules [5, 7], constraint ASP [8, 9, 47, 67], ASP with preferences [15], and probabilistic ASP [21].

Third, most examples of programs here are “toy examples” chosen for the purpose of illustrating the possibilities of the language. Serious applications of answer set programming are discussed in recent surveys [31, 36], and studying them will help the reader appreciate the value of the programming paradigm described in this book.

## References

- 4.Evgenii Balai, Michael Gelfond, and Yuanlin Zhang. Towards Answer Set Programming with sorts. In
*Proceedings of the Twelfth International Conference on Logic Programming and Nonmonotonic Reasoning*, pages 135–147, 2013.Google Scholar - 5.Marcello Balduccini. CR-models: an inference engine for CR-Prolog. In
*Proceedings of the Eighteenth International Conference on Logic Programming and Nonmonotonic Reasoning*, pages 18–30, 2005.Google Scholar - 6.Marcello Balduccini. ASP with non-Herbrand partial functions: a language and system for practical use.
*Theory and Practice of Logic Programming*, 13:547–561, 2013.MathSciNetCrossRefGoogle Scholar - 7.Marcello Balduccini and Michael Gelfond. Logic programs with consistency-restoring rules. In
*Working Notes of the AAAI Spring Symposium on Logical Formalizations of Commonsense Reasoning*, 2003.Google Scholar - 8.Marcello Balduccini and Yuliya Lierler. Constraint answer set solver EZCSP and why integration schemas matter.
*Theory and Practice of Logic Programming*, 17:462–515, 2017.MathSciNetCrossRefGoogle Scholar - 9.Mutsunori Banbara, Benjamin Kaufmann, Max Ostrowski, and Torsten Schaub. Clingcon: The next generation.
*Theory and Practice of Logic Programming*, 17:408–461, 2017.MathSciNetCrossRefGoogle Scholar - 11.Michael Bartholomew and Joohyung Lee. Stable models of formulas with intensional functions. In
*Proceedings of International Conference on Principles of Knowledge Representation and Reasoning*, pages 2–12, 2012.Google Scholar - 14.Gerhard Brewka. Logic programming with ordered disjunction. In
*Proceedings of the Eighteenth National Conference on Artificial Intelligence*, pages 100–105, 2003.Google Scholar - 15.Gerhard Brewka, James Delgrande, Javier Romero, and Torsten Schaub. asprin: Customizing answer set preferences without a headache. In
*Proceedings of the Twenty-Ninth AAAI Conference on Artificial Intelligence*, pages 1467–1474, 2015.Google Scholar - 17.Pedro Cabalar. Functional Answer Set Programming.
*Theory and Practice of Logic Programming*, 11:203–234, 2011.MathSciNetCrossRefGoogle Scholar - 21.Baral Chitta, Michael Gelfond, and Nelson Rushton. Probabilistic reasoning with answer sets.
*Theory and Practice of Logic Programming*, 9:57–144, 2009.MathSciNetCrossRefGoogle Scholar - 29.Thomas Eiter, Michael Fink, Giovambattista Ianni, Thomas Krennwallner, Christoph Redl, and Peter Schüller. A model building framework for Answer Set Programming with external computations.
*Theory and Practice of Logic Programming*, 16(4):418–464, 2016.MathSciNetCrossRefGoogle Scholar - 31.Esra Erdem, Michael Gelfond, and Nicola Leone. Applications of Answer Set Programming.
*AI Magazine*, 37:53–68, 2016.CrossRefGoogle Scholar - 36.Andreas Falkner, Gerhard Friedrich, Konstantin Schekotihin, Richard Taupe, and Erich Teppan. Industrial applications of Answer Set Programming.
*Künstliche Intelligenz*, 32:165–176, 2018.CrossRefGoogle Scholar - 45.Martin Gebser, Roland Kaminski, Benjamin Kaufmann, and Torsten Schaub.
*Answer Set Solving in Practice*. Synthesis Lectures on Artificial Intelligence and Machine Learning. Morgan and Claypool Publishers, 2012.CrossRefGoogle Scholar - 47.Martin Gebser, Max Ostrowski, and Torsten Schaub. Constraint answer set solving. In
*Proceedings of 25th International Conference on Logic Programming (ICLP)*, pages 235–249. Springer, 2009.Google Scholar - 67.Tomi Janhunen, Roland Kaminski, Max Ostrowski, Sebastian Schellhorn, Philipp Wanko, and Torsten Schaub. Clingo goes linear constraints over reals and integers.
*Theory and Practice of Logic Programming*, 17:872–888, 2017.MathSciNetCrossRefGoogle Scholar - 112.Patrik Simons.
*Extending and Implementing the Stable Model Semantics*. PhD thesis, Helsinki University of Technology, 2000.Google Scholar