Skip to main content

SM-Based Semantics for Answer Set Programs Containing Conditional Literals and Arithmetic

  • Conference paper
  • First Online:
Practical Aspects of Declarative Languages (PADL 2025)

Abstract

Modern answer set programming solvers such as clingo support advanced language constructs that improve the expressivity and conciseness of logic programs. Conditional literals are one such construct. They form “subformulas” that behave as nested implications within the bodies of logic rules. Their inclusion brings the form of rules closer to the less restrictive syntax of first-order logic. These qualities make conditional literals useful tools for knowledge representation. In this paper, we propose a semantics for logic programs with conditional literals and arithmetic based on the \(\text {SM}\) operator. These semantics do not require grounding, unlike the established semantics for such programs that relies on a translation to infinitary propositional logic. The main result of this paper establishes the precise correspondence between the proposed and existing semantics.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://github.com/potassco/anthem.

References

  1. Abels, D., Jordi, J., Ostrowski, M., Schaub, T., Toletti, A., Wanko, P.: Train scheduling with hybrid answer set programming. Theory Pract. Logic Program. 21(3), 317–347 (2021). https://doi.org/10.1017/S1471068420000046

    Article  MathSciNet  MATH  Google Scholar 

  2. Balduccini, M., Gelfond, M.: Model-based reasoning for complex flight systems. In: Proceedings of Infotech@Aerospace (American Institute of Aeronautics and Astronautics) (2005)

    Google Scholar 

  3. Balduccini, M., Gelfond, M., Nogueira, M., Watson, R., Barry, M.: An a-prolog decision support system for the Space Shuttle. In: Working Notes of the AAAI Spring Symposium on Answer Set Programming (2001)

    Google Scholar 

  4. Bomanson, J., Janhunen, T., Niemelä, I.: Applying visible strong equivalence in answer-set program transformations. ACM Trans. Comput. Logic 21(4) (2020). https://doi.org/10.1145/3412854

  5. Cabalar, P., Fandinno, J., Lierler, Y.: Modular answer set programming as a formal specification language. Theory Pract. Logic Program. 20(5), 767–782 (2020)

    Article  MathSciNet  MATH  Google Scholar 

  6. Cabalar, P., Muñiz, B., Pérez, G., Suárez, F.: Explainable machine learning for liver transplantation (2021). https://arxiv.org/abs/2109.13893

  7. Fandinno, J., Hansen, Z., Lierler, Y.: Axiomatization of aggregates in answer set programming. In: Proceedings of the Thirty-Six National Conference on Artificial Intelligence (AAAI 2022). AAAI Press (2022)

    Google Scholar 

  8. Fandinno, J., Lifschitz, V., Lühne, P., Schaub, T.: Verifying tight logic programs with anthem and vampire. Theory Pract. Logic Program. 20(5), 735–750 (2020)

    Article  MathSciNet  MATH  Google Scholar 

  9. Fandinno, J., Hansen, Z., Lierler, Y.: Arguing correctness of asp programs with aggregates. In: Gottlob, G., Inclezan, D., Maratea, M. (eds.) LPNMR 2022. LNCS, vol. 13416, pp. 190–202. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-15707-3_15

    Chapter  MATH  Google Scholar 

  10. Fandinno, J., Hansen, Z., Lierler, Y.: Axiomatization of non-recursive aggregates in first-order answer set programming. J. Artif. Intell. Res. 80, 977–1031 (2024). https://doi.org/10.1613/jair.1.15786

    Article  MathSciNet  MATH  Google Scholar 

  11. Fandinno, J., Hansen, Z., Lierler, Y., Lifschitz, V., Temple, N.: External behavior of a logic program and verification of refactoring. Theory Pract. Logic Program. 23(4), 933–947 (2023). https://doi.org/10.1017/S1471068423000200

    Article  MathSciNet  MATH  Google Scholar 

  12. Fandinno, J., Lifschitz, V., Temple, N.: Locally tight programs. Theory Pract. Log. Program. 1–31 (2024). https://doi.org/10.1017/S147106842300039X

  13. Ferraris, P., Lee, J., Lifschitz, V.: Stable models and circumscription. Artif. Intell. 175(1), 236–263 (2011)

    Article  MathSciNet  MATH  Google Scholar 

  14. Gebser, M., Kaminski, R., Kaufmann, B., Ostrowski, M., Schaub, T., Thiele, S.: A user’s guide to gringo, clasp, clingo, and iclingo. http://potassco.org

  15. Gebser, M., Harrison, A., Kaminski, R., Lifschitz, V., Schaub, T.: Abstract gringo. Theory Pract. Logic Program. 15(4–5), 449–463 (2015). https://doi.org/10.1017/S1471068415000150

    Article  MathSciNet  MATH  Google Scholar 

  16. Gebser, M., et al.: Experimenting with robotic intra-logistics domains. Theory Pract. Logic Program. 18(3–4), 502–519 (2018). https://doi.org/10.1017/S1471068418000200

    Article  MathSciNet  MATH  Google Scholar 

  17. Hansen, Z., Lierler, Y.: Semantics for conditional literals via the SM operator. In: Gottlob, G., Inclezan, D., Maratea, M. (eds.) LPNMR 2022. LNCS, vol. 13416, pp. 259–272. Springer, Cham (2022). https://doi.org/10.1007/978-3-031-15707-3_20

    Chapter  MATH  Google Scholar 

  18. Harrison, A., Lifschitz, V., Pearce, D., Valverde, A.: Infinitary equilibrium logic and strongly equivalent logic programs. Artif. Intell. 246, 22–33 (2017). https://doi.org/10.1016/j.artint.2017.02.002

    Article  MathSciNet  MATH  Google Scholar 

  19. Janhunen, T., Oikarinen, E.: LPEQ and DLPEQ—translators for automated equivalence testing of logic programs. In: Lifschitz, V., Niemelä, I. (eds.) LPNMR 2004. LNCS (LNAI), vol. 2923, pp. 336–340. Springer, Heidelberg (2003). https://doi.org/10.1007/978-3-540-24609-1_30

    Chapter  MATH  Google Scholar 

  20. Kaminski, R., Romero, J., Schaub, T., Wanko, P.: How to build your own ASP-based system?! Theory Pract. Log. Program. 1–63 (2021). https://doi.org/10.1017/S1471068421000508

  21. Lifschitz, V., Lühne, P., Schaub, T.: Verifying strong equivalence of programs in the input language of gringo. In: Proceedings of the 15th International Conference on Logic Programming and Non-monotonic Reasoning (2019). http://www.cs.utexas.edu/users/ai-lab?verification

  22. Lifschitz, V.: Transforming gringo rules into formulas in a natural way. In: Faber, W., Friedrich, G., Gebser, M., Morak, M. (eds.) JELIA 2021. LNCS (LNAI), vol. 12678, pp. 421–434. Springer, Cham (2021). https://doi.org/10.1007/978-3-030-75775-5_28

    Chapter  MATH  Google Scholar 

  23. Lifschitz, V., Pearce, D., Valverde, A.: Strongly equivalent logic programs. ACM Trans. Comput. Log. 2(4), 526–541 (2001). https://doi.org/10.1145/383779.383783

    Article  MathSciNet  MATH  Google Scholar 

  24. Marek, V.W., Truszczyński, M.: Stable models and an alternative logic programming paradigm. In: Apt, K.R., Marek, V.W., Truszczynski, M., Warren, D.S. (eds.) The Logic Programming Paradigm. Artificial Intelligence, pp. 375–398. Springer, Heidelberg (1999)

    Chapter  MATH  Google Scholar 

  25. Niemelä, I.: Logic programs with stable model semantics as a constraint programming paradigm. Ann. Math. Artif. Intell. 25(3), 241–273 (1999). https://doi.org/10.1023/A:1018930122475

    Article  MathSciNet  MATH  Google Scholar 

  26. Oetsch, J., Seidl, M., Tompits, H., Woltran, S.: Testing relativised uniform equivalence under answer-set projection in the system ccT. In: Seipel, D., Hanus, M., Wolf, A. (eds.) INAP/WLP -2007. LNCS (LNAI), vol. 5437, pp. 241–246. Springer, Heidelberg (2009). https://doi.org/10.1007/978-3-642-00675-3_16

    Chapter  MATH  Google Scholar 

  27. Syrjänen, T.: Cardinality constraint programs. In: Alferes, J.J., Leite, J. (eds.) JELIA 2004. LNCS (LNAI), vol. 3229, pp. 187–199. Springer, Heidelberg (2004). https://doi.org/10.1007/978-3-540-30227-8_18

    Chapter  MATH  Google Scholar 

  28. Truszczynski, M.: Connecting first-order ASP and the logic FO(ID) through reducts. In: Erdem, E., Lee, J., Lierler, Y., Pearce, D. (eds.) Correct Reasoning. LNCS, vol. 7265, pp. 543–559. Springer, Heidelberg (2012). https://doi.org/10.1007/978-3-642-30743-0_37

    Chapter  MATH  Google Scholar 

  29. Wotawa, F., Kaufmann, D.: Model-based reasoning using answer set programming. Appl. Intell. 52(15), 16993–17011 (2022). https://doi.org/10.1007/s10489-022-03272-2

    Article  MATH  Google Scholar 

Download references

Acknowledgments

We are grateful to Jorge Fandinno and Vladimir Lifschitz for their valuable comments, and to our anonymous reviewers for their feedback.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Zachary Hansen .

Editor information

Editors and Affiliations

Ethics declarations

Disclosure of Interests

The authors have no competing interests.

Rights and permissions

Reprints and permissions

Copyright information

© 2025 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hansen, Z., Lierler, Y. (2025). SM-Based Semantics for Answer Set Programs Containing Conditional Literals and Arithmetic. In: Erdem, E., Vidal, G. (eds) Practical Aspects of Declarative Languages. PADL 2025. Lecture Notes in Computer Science, vol 15537. Springer, Cham. https://doi.org/10.1007/978-3-031-84924-4_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-84924-4_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-84923-7

  • Online ISBN: 978-3-031-84924-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics