Skip to main content
Log in

Weight constraint programs with evaluable functions

  • Published:
Annals of Mathematics and Artificial Intelligence Aims and scope Submit manuscript

Abstract

In the current practice of Answer Set Programming (ASP), evaluable functions are represented as special kinds of relations. This often makes the resulting program unnecessarily large when instantiated over a large domain. The extra constraints needed to enforce the relation as a function also make the logic program less transparent. In this paper, we consider adding evaluable functions to answer set logic programs. The class of logic programs that we consider here is that of weight constraint programs, which are widely used in ASP. We propose an answer set semantics to these extended weight constraint programs and define loop completion to characterize the semantics. Computationally, we provide a translation from loop completions of these programs to instances of the Constraint Satisfaction Problem (CSP) and use the off-the-shelf CSP solvers to compute the answer sets of these programs. A main advantage of this approach is that global constraints implemented in such CSP solvers become available to ASP. The approach also provides a new encoding for CSP problems in the style of weight constraint programs. We have implemented a prototype system based on these results, and our experiments show that this prototype system competes well with the state-of-the-art ASP solvers. In addition, we illustrate the utilities of global constraints in the ASP context.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Baral, C.: Knowledge Representation, Reasoning and Declarative Problem Solving. Cambridge University Press, New York (2003)

    Book  MATH  Google Scholar 

  2. Baselice, S., Bonatti, P.A., Criscuolo, G.: On finitely recursive programs. In: Proceedings of the Twenty Third International Conference on Logic Programming, pp. 89–103, Porto, Portugal. Springer, New York (2007)

  3. Bessiere, C., Katsirelos, G., Narodytska, N., Quimper, C.-G., Walsh, T.: Decompositions of all different, global cardinality and related constraints. In: Proceedings of the 21st International Joint Conference on Artificial Intelligence, pp. 419–424. Pasadena, California (2009)

    Google Scholar 

  4. Bonatti, P.A.: Reasoning with infinite stable models. Artif. Intell. 156(1), 75–111 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  5. Bordeaux, L., Hamadi, Y., Zhang, L.: Propositional satisfiability and constraint programming: a comparative survey. ACM Comput. Surv. 38(4), 12:1–12:54 (2006)

    Article  Google Scholar 

  6. Cabalar, P.: A functional action language front-end. In: The Third International Workshop on Answer Set Programming: Advances in Theory and Implementation. http://www.dc.fi.udc.es/~cabalar/asp05_C.pdf (2005)

  7. Cabalar, P., Lorenzo, D.: Logic programs with functions and default values. In: Proceedings of the Ninth European Conference on Logics in Artificial Intelligence, pp. 294–306, Lisbon, Portugal. Springer, New York (2004)

  8. Cadoli, M., Schaerf, M.: A survey of complexity results for nonmonotonic logics. Log. Program. 17(2/3&4), 127–160 (1993)

    Article  MathSciNet  MATH  Google Scholar 

  9. Calimeri, F., Cozza, S., Ianni, G., Leone, N.: Computable functions in ASP: theory and implementation. In: Logic Programming, 24th International Conference, Udine, Italy, vol. 5366 of Lecture Notes in Computer Science, pp. 407–424. Springer, New York (2008)

    Google Scholar 

  10. Chen, Y., Lin, F., Wang, Y., Zhang, M.: First-order loop formulas for normal logic programs. In: Proceedings of the 10th International Conference on Principles of Knowledge Representation and Reasoning (KR 2006), Lake District of the United Kingdom, pp. 298–307. AAAI Press, Menlo Park (2006)

    Google Scholar 

  11. Dovier, A., Formisano, A., Pontelli, E.: An empirical study of constraint logic programming and answer set programming solutions of combinatorial problems. J. Exp. Theoret. Artif. Intell. 21(2), 79–121 (2009)

    Article  MATH  Google Scholar 

  12. Drescher, C., Walsh, T.: A translational approach to constraint answer set solving. Theory Pract. Log. Program. 10(4–6), 465–480 (2010)

    Article  MathSciNet  MATH  Google Scholar 

  13. Eiter, T., Faber, W., Mushthofa, M.: Space efficient evaluation of asp programs with bounded predicate arities. In: Proceedings of the Twenty-Fourth AAAI Conference on Artificial Intelligence, Atlanta, Georgia, USA, pp. 303–308. AAAI Press, Menlo Park (2010)

    Google Scholar 

  14. Eiter, T., Simkus, M.: FDNC: decidable nonmonotonic disjunctive logic programs with function symbols. ACM Trans. Comput. Log. 11(2), 14:1–14:50 (2010)

    Article  MathSciNet  Google Scholar 

  15. Erdem, E., Lin, F., Schaub, T. (eds.): Logic Programming and Nonmonotonic Reasoning, 10th International Conference, LPNMR 2009, Potsdam, Germany, 14–18 September 2009. Proceedings, vol. 5753 of Lecture Notes in Computer Science. Springer, New York (2009)

    Google Scholar 

  16. Ferraris, P., Lee, J., Lifschitz, V.: A new perspective on stable models. In: Proceedings of the 20th International Joint Conference on Artificial Intelligence, pp. 372–379. Hyderabad, India (2007)

  17. Ferraris, P., Lifschitz, V.: Weight constraints as nested expressions. Theory Pract. Log. Program. 5(1–2), 45–74 (2005)

    Article  MathSciNet  MATH  Google Scholar 

  18. Gebser, M., Kaufmann, B., Neumann, A., Schaub, T.: Conflict-driven answer set enumeration. In: Logic Programming and Nonmonotonic Reasoning, 9th International Conference, Tempe, AZ, USA, LPNMR 2007, vol. 4483 of Lecture Notes in Computer Science, pp. 136–148. Springer, New York (2007)

    Google Scholar 

  19. Gebser, M., Ostrowski, M., Schaub, T.: Constraint answer set solving. In: Logic Programming, 25th International Conference, ICLP 2009, Pasadena, CA, USA, vol. 5649 of Lecture Notes in Computer Science, pp. 235–249. Springer, New York (2009)

    Google Scholar 

  20. Gelfond, M., Leone, N.: Logic programming and knowledge representation—the a-prolog perspective. Artif. Intell. 138(1–2), 3–38 (2002)

    Article  MathSciNet  MATH  Google Scholar 

  21. Järvisalo, M., Oikarinen, E., Janhunen, T., Niemelä, I.: A module-based framework for multi-language constraint modeling. In: Logic Programming and Nonmonotonic Reasoning, 10th International Conference, vol. 5753 of Lecture Notes in Computer Science, pp. 155–168. Springer, New York (2009)

    Chapter  Google Scholar 

  22. Lee, J.: A model-theoretic counterpart of loop formulas. In: Proceedings of the Nineteenth International Joint Conference on Artificial Intelligence, Edinburgh, Scotland, UK, pp. 503–508. Professional Book Center, London (2005)

    Google Scholar 

  23. Lee, J., Lifschitz, V.: Loop formulas for disjunctive logic programs. In: Proceedings of the Nineteenth International Conference on Logic Programming, Mumbai, India, vol. 2916 of Lecture Notes in Computer Science, pp. 451–465. Springer, New York (2003)

    Google Scholar 

  24. Lifschitz, V., Razborov, A.A.: Why are there so many loop formulas? ACM Trans. Comput. Log. 7(2), 261–268 (2006)

    Article  MathSciNet  Google Scholar 

  25. Lifschitz, V., Turner, H.: Splitting a logic program. In: Proceedings of the Eleventh International Conference on Logic Programming, Santa Margherita Ligure, Italy, pp. 23–37. MIT Press, Cambridge (1994)

    Google Scholar 

  26. Lin, F., Wang, Y.: Answer set programming with functions. In: Proceedings of the 11th International Conference on Principles of Knowledge Representation and Reasoning, Sydney, Australia, pp. 454–464. AAAI Press, Menlo Park (2008)

    Google Scholar 

  27. Lin, F., Zhao, Y.: ASSAT: computing answer sets of a logic program by SAT solvers. Artif. Intell. 157(1–2), 115–137 (2004)

    Article  MathSciNet  MATH  Google Scholar 

  28. Liu, G., You, J.-H.: Level mapping induced loop formulas for weight constraint and aggregate logic programs. Fundam. Inform. 101(3), 237–255 (2010)

    MathSciNet  MATH  Google Scholar 

  29. Liu, L., Truszczynski, M.: Properties and applications of programs with monotone and convex constraints. J. Artif. Intell. Res. 27, 299–334 (2006)

    MathSciNet  MATH  Google Scholar 

  30. Lloyd, J.W.: Foundations of Logic Programming, 2nd edn. Springer, New York (1987)

    MATH  Google Scholar 

  31. Wiktor Marek, V., Truszczynski, 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: A 25-Year Perspective, pp. 375–398. Springer, Berlin (1999)

    Google Scholar 

  32. Marek, V., Niemelä, I., Truszczyński, M.: Logic programs with monotone abstract constraint atoms. Theory Pract. Log. Program. 8(2), 167–199 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  33. Mellarkod, V.S., Gelfond, M., Zhang, Y.: Integrating answer set programming and constraint logic programming. Ann. Math. Artif. Intell. 53(1–4), 251–287 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  34. Niemelä, I.: Logic programs with stable model semantics as a constraint programming paradigm. Ann. Math. Artif. Intell. 25(3–4), 241–273 (1999)

    Article  MATH  Google Scholar 

  35. Niemelä, I., Simons, P.: Extending the Smodels System with Cardinality and Weight Constraints, Chapter 21, pp. 491–521. Kluwer, Dordrecht (2000)

    Google Scholar 

  36. Oikarinen, E., Janhunen, T.: Achieving compositionality of the stable model semantics for smodels programs. Theory Pract. Log. Program. (TPLP) 8(5–6), 717–761 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  37. Papadimitriou, C.H.: Computatioinal Complexity. Addison Wesley, Reading (1994)

    Google Scholar 

  38. Pearce, D., Valverde, A.: Towards a first order equilibrium logic for nonmonotonic reasoning. In: Logics in Artificial Intelligence, 9th European Conference, Lisbon, Portugal, vol. 3229 of Lecture Notes in Computer Science, pp. 147–160. Springer, New York (2004)

    Google Scholar 

  39. Rina, D.: Constraint Processing. Morgan Kaufmann, San Mateo (2003)

    Google Scholar 

  40. Simons, P., Niemelä, I., Soininen, T.: Extending and implementing the stable model semantics. Artif. Intell. 138(1–2), 181–234 (2002)

    Article  MATH  Google Scholar 

  41. Syrjänen, T.: Omega-restricted logic programs. In: Proceedings of the Sixth International Conference on Logic Programming and Nonmonotonic Reasoning, Vienna, Austria, pp. 267–279. Springer, New York (2001)

    Google Scholar 

  42. Tarjan, R.E.: Depth-first search and linear graph algorithms. SIAM J. Comput. 1(2), 146–160 (1972)

    Article  MathSciNet  MATH  Google Scholar 

  43. Wang, Y., You, J.-H., Yuan, L.-Y., Zhang, M.: Weight constraint programs with functions. In: Logic Programming and Nonmonotonic Reasoning, 10th International Conference, LPNMR 2009, Potsdam, Germany, vol. 5753 of Lecture Notes in Computer Science, pp. 329–341. Springer, New York (2009)

    Google Scholar 

  44. You, J.-H., Liu, G.: Loop formulas for logic programs with arbitrary constraint atoms. In: Proceedings of the Twenty-Third AAAI Conference on Artificial Intelligence (AAAI 2008), Chicago, Illinois, USA, pp. 584–589. AAAI Press, Menlo Park (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Yisong Wang.

Additional information

This is an extension of a preliminary version that appeared in the Proceedings of LPNMR’09 [43] drawing some results from [26].

Rights and permissions

Reprints and permissions

About this article

Cite this article

Wang, Y., You, JH., Lin, F. et al. Weight constraint programs with evaluable functions. Ann Math Artif Intell 60, 341–380 (2010). https://doi.org/10.1007/s10472-011-9237-y

Download citation

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s10472-011-9237-y

Keywords

Mathematics Subject Classifications (2010)

Navigation