Writing Declarative Specifications for Clauses

  • Martin Gebser
  • Tomi Janhunen
  • Roland Kaminski
  • Torsten Schaub
  • Shahab Tasharrofi
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 10021)


Modern satisfiability (SAT) solvers provide an efficient implementation of classical propositional logic. Their input language, however, is based on the conjunctive normal form (CNF) of propositional formulas. To use SAT solver technology in practice, a user must create the input clauses in one way or another. A typical approach is to write a procedural program that generates formulas on the basis of some input data relevant for the problem domain and translates them into CNF. In this paper, we propose a declarative approach where the intended clauses are specified in terms of rules in analogy to answer set programming (ASP). This allows the user to write first-order specifications for intended clauses in a schematic way by exploiting term variables. We develop a formal framework required to define the semantics of such specifications. Moreover, we provide an implementation harnessing state-of-the-art ASP grounders to accomplish the grounding step of clauses. As a result, we obtain a general-purpose clause-level grounding approach for SAT solvers. Finally, we illustrate the capabilities of our specification methodology in terms of combinatorial and application problems.


Conjunctive Normal Form Satisfiability Modulo Theory Classical Propositional Logic Unit Clause Haplotype Inference 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.



This work was funded by the Academy of Finland (251170), DFG (SCHA 550/9), as well as DAAD and the Academy of Finland (57071677 and 279121). We are grateful to João Marques-Silva and Inês Lynce for kindly providing us with the benchmark instances used in Sect. 4.


  1. 1.
    Biere, A., Heule, M., van Maaren, H., Walsh, T.: Handbook of Satisfiability. IOS Press, Amsterdam (2009)MATHGoogle Scholar
  2. 2.
    Aavani, A., Wu, X.N., Tasharrofi, S., Ternovska, E., Mitchell, D.: Enfragmo: a system for modelling and solving search problems with logic. In: Bjørner, N., Voronkov, A. (eds.) LPAR 2012. LNCS, vol. 7180, pp. 15–22. Springer, Heidelberg (2012). doi: 10.1007/978-3-642-28717-6_4 CrossRefGoogle Scholar
  3. 3.
    Navarro, J.A., Voronkov, A.: Proof systems for effectively propositional logic. In: Armando, A., Baumgartner, P., Dowek, G. (eds.) IJCAR 2008. LNCS (LNAI), vol. 5195, pp. 426–440. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-71070-7_36 CrossRefGoogle Scholar
  4. 4.
    Helmert, M.: Concise finite-domain representations for PDDL planning tasks. Artif. Intell. 173(5–6), 503–535 (2009)MathSciNetCrossRefMATHGoogle Scholar
  5. 5.
    Schulz, S.: A comparison of different techniques for grounding near-propositional CNF formulae. In: Proceedings of FLAIRS 2002, pp. 72–76. AAAI Press (2002)Google Scholar
  6. 6.
    Wittocx, J., Mariën, M., Denecker, M.: Grounding FO and FO(ID) with bounds. J. Artif. Intell. Res. 38, 223–269 (2010)MathSciNetMATHGoogle Scholar
  7. 7.
    Brewka, G., Eiter, T., Truszczyński, M.: Answer set programming at a glance. Commun. ACM 54, 92–103 (2011)CrossRefGoogle Scholar
  8. 8.
    Asín, R., Nieuwenhuis, R., Oliveras, A., Rodríguez-Carbonell, E.: Cardinality networks: a theoretical and empirical study. Constraints 16(2), 195–221 (2011)MathSciNetCrossRefMATHGoogle Scholar
  9. 9.
    Audemard, G., Katsirelos, G., Simon, L.: A restriction of extended resolution for clause learning SAT solvers. In: Proceedings of AAAI 2010, pp. 15–20. AAAI Press (2010)Google Scholar
  10. 10.
    Huang, J.: Universal booleanization of constraint models. In: Stuckey, P.J. (ed.) CP 2008. LNCS, vol. 5202, pp. 144–158. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-85958-1_10 CrossRefGoogle Scholar
  11. 11.
    Gebser, M., Kaminski, R., Ostrowski, M., Schaub, T., Thiele, S.: On the input language of ASP grounder gringo. In: Erdem, E., Lin, F., Schaub, T. (eds.) LPNMR 2009. LNCS (LNAI), vol. 5753, pp. 502–508. Springer, Heidelberg (2009). doi: 10.1007/978-3-642-04238-6_49 CrossRefGoogle Scholar
  12. 12.
    Leone, N., Pfeifer, G., Faber, W., Eiter, T., Gottlob, G., Perri, S., Scarcello, F.: The DLV system for knowledge representation and reasoning. ACM Trans. Comput. Logic 7(3), 499–562 (2006)MathSciNetCrossRefGoogle Scholar
  13. 13.
    Schlipf, J.: The expressive powers of the logic programming semantics. J. Comput. Syst. Sci. 51, 64–86 (1995)MathSciNetCrossRefMATHGoogle Scholar
  14. 14.
    McCarthy, J.: Elaboration tolerance (2003). http://www-formal.stanford.edu/jmc/elaboration.ps
  15. 15.
    Gebser, M., Kaminski, R., König, A., Schaub, T.: Advances in gringo series 3. In: Delgrande, J.P., Faber, W. (eds.) LPNMR 2011. LNCS (LNAI), vol. 6645, pp. 345–351. Springer, Heidelberg (2011). doi: 10.1007/978-3-642-20895-9_39 CrossRefGoogle Scholar
  16. 16.
    Van Gelder, A., Ross, K., Schlipf, J.: The well-founded semantics for general logic programs. J. ACM 38(3), 620–650 (1991)MathSciNetMATHGoogle Scholar
  17. 17.
    Ullman, J.: Principles of Database and Knowledge-Base Systems. CS Press, New York (1988)Google Scholar
  18. 18.
    Gelfond, M., Lifschitz, V.: Classical negation in logic programs and disjunctive databases. New Gener. Comput. 9(3–4), 365–386 (1991)CrossRefMATHGoogle Scholar
  19. 19.
    Simons, P., Niemelä, I., Soininen, T.: Extending and implementing the stable model semantics. Artif. Intell. 138(1–2), 181–234 (2002)MathSciNetCrossRefMATHGoogle Scholar
  20. 20.
    Gebser, M., Janhunen, T., Rintanen, J.: Answer set programming as SAT modulo acyclicity. In: Proceedings of ECAI 2014, pp. 351–356. IOS Press (2014)Google Scholar
  21. 21.
    Gebser, M., Janhunen, T., Rintanen, J.: SAT modulo graphs: acyclicity. In: Fermé, E., Leite, J. (eds.) JELIA 2014. LNCS (LNAI), vol. 8761, pp. 137–151. Springer, Heidelberg (2014). doi: 10.1007/978-3-319-11558-0_10 Google Scholar
  22. 22.
    Graça, A., Marques-Silva, J., Lynce, I., Oliveira, A.L.: Efficient haplotype inference with combined CP and OR techniques. In: Perron, L., Trick, M.A. (eds.) CPAIOR 2008. LNCS, vol. 5015, pp. 308–312. Springer, Heidelberg (2008). doi: 10.1007/978-3-540-68155-7_28 CrossRefGoogle Scholar
  23. 23.
    Graça, A., Marques-Silva, J., Lynce, I., Oliveira, A.L.: Efficient haplotype inference with pseudo-Boolean optimization. In: Anai, H., Horimoto, K., Kutsia, T. (eds.) AB 2007. LNCS, vol. 4545, pp. 125–139. Springer, Heidelberg (2007). doi: 10.1007/978-3-540-73433-8_10 CrossRefGoogle Scholar
  24. 24.
    Eén, N., Sörensson, N.: Translating pseudo-Boolean constraints into SAT. J. Satisfiability Boolean Model. Comput. 2, 1–26 (2006)MATHGoogle Scholar
  25. 25.
    Andres, B., Kaufmann, B., Matheis, O., Schaub, T.: Unsatisfiability-based optimization in clasp. In: Technical Communications of ICLP 2012, pp. 212–221. LIPIcs (2012)Google Scholar
  26. 26.
    East, D., Iakhiaev, M., Mikitiuk, A., Truszczyński, M.: Tools for modeling and solving search problems. AI Commun. 19(4), 301–312 (2006)MathSciNetMATHGoogle Scholar
  27. 27.
    Blockeel, H., Bogaerts, B., Bruynooghe, M., De Cat, B., De Pooter, S., Denecker, M., Labarre, A., Ramon, J., Verwer, S.: Modeling machine learning and data mining problems with FO(.). In: Technical Communications of ICLP 2012, pp. 14–25. LIPIcs (2012)Google Scholar
  28. 28.
    Jansen, J., Dasseville, I., Devriendt, J., Janssens, G.: Experimental evaluation of a state-of-the-art grounder. In: Proceedings of PPDP 2014, pp. 249–258. ACM Press (2014)Google Scholar
  29. 29.
    Jansen, J., Jorissen, A., Janssens, G.: Compiling input* FO(.) inductive definitions into tabled prolog rules for IDP3. Theor. Pract. Logic Program. 13(4–5), 691–704 (2013)MathSciNetCrossRefMATHGoogle Scholar
  30. 30.
    Cadoli, M., Schaerf, A.: Compiling problem specifications into SAT. Artif. Intell. 162(1–2), 89–120 (2005)MathSciNetCrossRefMATHGoogle Scholar
  31. 31.
    Stuckey, P., Feydy, T., Schutt, A., Tack, G., Fischer, J.: The MiniZinc challenge 2008–2013. AI Mag. 35(2), 55–60 (2014)Google Scholar
  32. 32.
    Gebser, M., Janhunen, T., Kaminski, R., Schaub, T., Tasharrofi, S.: Writing declarative specifications for clauses. In: Proceedings of GTTV (2015)Google Scholar
  33. 33.
    Janhunen, T., Tasharrofi, S., Ternovska, E.: SAT-to-SAT: declarative extension of SAT solvers with new propagators. In: Proceedings of AAAI 2016, pp. 978–984. AAAI Press (2016)Google Scholar
  34. 34.
    Bogaerts, B., Janhunen, T., Tasharrofi, S.: Solving QBF instances with nested SAT solvers. In: Proceedings of AAAI-16 Workshop on Beyond NP, pp. 307–313. AAAI Press (2016). http://www.aaai.org/ocs/index.php/WS/AAAIW16/paper/view/12603/12381
  35. 35.
    Bogaerts, B., Janhunen, T., Tasharrofi, S.: Declarative solver development: case studies. In: Proceedings of KR 2016, pp. 74–83. AAAI Press (2016)Google Scholar
  36. 36.
    Bogaerts, B., Janhunen, T., Tasharrofi, S.: Stable-unstable semantics: beyond NP with normal logic programs. Theory and Practice of Logic Programming (2016, to appear)Google Scholar
  37. 37.
    Janhunen, T.: Some (in)translatability results for normal logic programs and propositional theories. J. Appl. Non-Class. Logics 16(1–2), 35–86 (2006)MathSciNetCrossRefMATHGoogle Scholar

Copyright information

© Springer International Publishing AG 2016

Authors and Affiliations

  • Martin Gebser
    • 2
  • Tomi Janhunen
    • 1
  • Roland Kaminski
    • 2
  • Torsten Schaub
    • 2
    • 3
  • Shahab Tasharrofi
    • 1
  1. 1.Helsinki Institute for Information Technology HIITAalto UniversityEspooFinland
  2. 2.Institute for Informatics and Computational ScienceUniversity of PotsdamPotsdamGermany
  3. 3.INRIA Rennes, Bretagne Atlantique Research CentreRennesFrance

Personalised recommendations