1 Introduction
Answer set programming (ASP) is a declarative programming paradigm for solving difficult combinatorial search problems [6]. Constraint answer set programming (CASP) is a recent development, which integrates ASP with constraint processing. Often, this integration allows one to tackle a challenge posed by the grounding bottleneck. Originally, systems that process CASP programs rely on combining algorithms/solvers employed in ASP and constraint processing [11, 1]. Lee and Meng; Susman and Lierler; Lierler and Susman [14, 22, 16] proposed an alternative approach that utilizes satisfiability modulo theory (SMT) solvers [4] in design of CASP systems.
System ezsmt [22] is a representative of an SMTbased approach for tackling CASP programs. Based on experimental evidence, ezsmt often outperforms its peers. Yet, it has several limitations. For instance, it is unable to process a large class of logic programs called nontight [8]. This restriction does not allow users, for example, to express transitive closure succinctly. System ezsmt is also unable to handle optimization statements or enumerate multiple solutions to a problem. We extend ezsmt so that the described limitations are eliminated. We call the new system ezsmt+.
2 Work So far
2.1 Theoretical Foundations
To process nontight programs, we utilize the extension of theory originally developed by Niemela [19], where the author characterizes solutions of nontight “normal” programs in terms of level rankings. Lierler and Susman generalized these concepts to programs including such commonly used ASP features as choice rules and denials [16]. Lierler and Susman also develop a mapping from a logic program to an SMT logic called smt(il) such that the models of a constructed smt(il) theory are in onetoone correspondence with answer sets of the program [16]. The developed mappings generalize the ones presented by Niemela [19]. Thus, any SMT solver capable of processing smt(il) expressions can be used to find answer sets of logic programs. Such generalizations allow our system to tackle nontight programs.
2.2 SMTbased Answer Set solver cmodels(diff)
In this work, we restricts our input to pure answer set programs, which can be either tight or nontight. The cmodels(diff) system follows the tradition of answer set solvers such as assat [17] and cmodels [15]. In place of designing specialized search procedures targeting logic programs, these tools compute a program’s completion and utilize Satisfiability solvers [12] – systems for finding satisfying assignments for propositional formulas – for search. Since not all models of a program’s completion are answer sets of a program, both assat and cmodels implement specialized procedures (based on loop formulas [17]) to weed out such models. SMT solvers [4] extend Satisfiability solvers. They process formulas that go beyond propositional logic and may contain, for example, integer linear expressions. The cmodels(diff) system utilizes this fact and translates a logic program into an SMT formula so that any model of this formula corresponds to an answer set of the program. It then uses SMT solvers for search. Unlike cmodels or assat, the cmodels(diff) system does not need an additional step to weed out unwanted models. Also, it utilizes smtlib– a standard input language of SMT solvers [3] – to interface with these systems. This makes its architecture open towards new developments in the realm of SMT solving. There is practically no effort involved in incorporating a new SMT system into the cmodels(diff) implementation.
The theoretical foundation of the cmodels(diff) system lies on the generalizations of Niemela’s ideas described in section 2.1. In this sense, the cmodels(diff) system is a close relative of an earlier answer set solver lp2diff developed by Janhunen et al. [13]. Yet, lp2diff only accepts programs of a very restricted form. For example, neither choice rules nor aggregate expressions are allowed. Solver cmodels(diff) permits such important modeling constructs in its input. Also, unlike lp2diff, the cmodels(diff) system is able to generate multiple solutions.
Figure 2.2 illustrates the pipeline architecture of cmodels(diff) ^{1}^{1}1cmodels(diff) is posted at https://www.unomaha.edu/collegeofinformationscienceandtechnology/naturallanguageprocessingandknowledgerepresentationlab/software/cmodelsdiff.php . It is an extension of the cmodels [15] system. The cmodels(diff) system takes an arbitrary (tight or nontight) logic program in the language supported by cmodels as an input. These logic programs may contain such features as choice rules and aggregate expressions. The rules with these features are translated away by cmodels’ original algorithms [15]. Our main contribution is block 2, where the cmodels(diff) system adds the corresponding level ranking formula if the program is not tight. After that, the transformer taken from ezsmt v1.1 is called to convert output from block 2 into smtlib syntax. Finally, any SMT solvers supporting smtlib, such as cvc4 [5], z3 [23] and yices [7], can be called to compute solutions (that correspond to answer sets).
The cmodels(diff) system allows us to compute multiple answer sets. Currently, SMT solvers typically find only a single model. We design a process to enumerate all models. After computing an answer set of a program, the cmodels(diff) system invokes an SMT solver again by adding formulas encoding the fact that a newly computed model should be different from . This process is repeated until the prespecified number of solutions is enumerated or it has been established that no more solutions exist.
2.3 SMTbased Constraint Answer Set solver ezsmt+
We utilize the cmodels(diff) system to build the extension ezsmt+ ^{2}^{2}2ezsmt+ is available at https://www.unomaha.edu/collegeofinformationscienceandtechnology/naturallanguageprocessingandknowledgerepresentationlab/software/ezsmt.php . Figure 2 illustrates its architecture. The ezsmt+ system accepts an arbitrary (tight or nontight) CASP program as input, and utilizes existing ASP tools for grounding and computing completion [8]. Our main contribution is block 2, which produces corresponding formulas for a nontight program. These formulas are a combination of the program’s completion and level ranking formulas. We find a way to set minimal upper bounds for level rankings in order to reduce search space. Then, the original ezsmt transformer is used to translate them into a text file written in smtlib, and an SMT solver is called to find models of these formulas. The procedure used by ezsmt+ to compute multiple solutions is identical to that of cmodels(diff).
Experiments
We benchmark ezsmt+ with eight problems. ezsmt+ is compared to stateoftheart CASP solvers clingcon [20] and ezcsp [2]. The experimental results are presented in the paper [21]. They show that ezsmt+ is a viable tool for finding answer sets of CASP programs, and can solve some difficult instances where its peers time out. Utilizing different SMT solvers may improve the performance of ezsmt+ in the future.
Significance
The ezsmt+ system removes the inability to process nontight input and enumerate multiple answer sets. It provides new capabilities towards utilizing declarative answer set programming paradigm for problems containing a wide variety of constraints including linear constraints over real numbers, mixed integer and real numbers, as well as nonlinear constraints. We believe that, by making clear the translation of arbitrary CASP logic programs to SMT, our work will boost the crossfertilization between the two areas.
3 Future Work
In the future, we will extend ezsmt+ to allow processing of optimization statements. Using partial weighted maxSMT problems [9] is one potential approach. Yet, it requires theoretical work on connecting semantics of ASP and SMT constructs for optimizations.
The technique implemented by our systems for enumerating multiple answer sets of a program is basic. In the future we would like to adopt a nontrivial methods for model enumeration discussed in [10] to our settings.
The contributions of our work also open a door to the development of a novel constraintbased method in processing logic programs by producing intermediate output in minizinc [18] in place of smtlib.
References
 [1] Balduccini, M., Lierler, Y.: Constraint answer set solver ezcsp and why integration schemas matter. Theory and Practice of Logic Programming 17(4), 462–515 (2017). https://doi.org/10.1017/S1471068417000102
 [2] Balduccini, M., Lierler, Y.: Ezcsp. http://www.mbal.tk/ezcsp/index.html (2017), [Accessed: 2018]
 [3] Barrett, C., Fontaine, P., Tinelli, C.: The SMTLIB Standard: Version 2.5. Tech. rep., The University of Iowa (2015)
 [4] Barrett, C., Tinelli, C.: Satisfiability modulo theories. In: Clarke, E., Henzinger, T., Veith, H. (eds.) Handbook of Model Checking. Springer (2014)
 [5] Barrett, C., Tinelli, C., et al.: Cvc4. http://cvc4.cs.nyu.edu (2014), [Accessed: 2018]
 [6] Brewka, G., Eiter, T., Truszczyński, M.: Answer set programming at a glance. Communications of the ACM 54(12), 92–103 (2011)
 [7] Dutertre, B.: yices. http://yices.csl.sri.com/ (2017), [Accessed: 2018]
 [8] Fages, F.: Consistency of Clark’s completion and existence of stable models. Journal of Methods of Logic in Computer Science 1, 51–60 (1994)
 [9] Fu, Z., Malik, S.: On solving the partial maxsat problem. In: SAT (2006)
 [10] Gebser, M., Kaufmann, B., Neumann, A., Schaub, T.: Conflictdriven answer set enumeration. In: Proceedings of the 9th International Conference on Logic Programming and Nonmonotonic Reasoning. pp. 136–148. LPNMR’07, SpringerVerlag, Berlin, Heidelberg (2007), http://dl.acm.org/citation.cfm?id=1758481.1758496
 [11] Gebser, M., Ostrowski, M., Schaub, T.: Constraint answer set solving. In: Proceedings of 25th International Conference on Logic Programming. pp. 235–249. Springer (2009)
 [12] Gomes, C.P., Kautz, H., Sabharwal, A., Selman, B.: Satisfiability solvers. In: van Harmelen, F., Lifschitz, V., Porter, B. (eds.) Handbook of Knowledge Representation, pp. 89–134. Elsevier (2008)
 [13] Janhunen, T., Niemelä, I., Sevalnev, M.: Computing stable models via reductions to difference logic. In: Logic Programming and Nonmonotonic Reasoning. pp. 142–154. Springer Berlin Heidelberg (2009)

[14]
Lee, J., Meng, Y.: Answer set programming modulo theories and reasoning about continuous changes. In: Proceedings of the 23rd International Joint Conference on Artificial Intelligence (IJCAI13), Beijing, China, August 39, 2013 (2013)
 [15] Lierler, Y.: SATbased Answer Set Programming. Ph.D. thesis, University of Texas at Austin (2010)
 [16] Lierler, Y., Susman, B.: On relation between constraint answer set programming and satisfiability modulo theories. Theory and Practice of Logic Programming 17(4), 559–590 (2017)
 [17] Lin, F., Zhao, Y.: Assat: Computing answer sets of a logic program by sat solvers. Artificial Intelligence 157, 115–137 (2004)
 [18] Nethercote, N., Stuckey, P., Becket, R., Brand, S., Duck, G., , Tack, G.: Minizinc: Towards a standard cp modelling language. In: Proceedings of the 13th International Conference on Principles and Practice of Constraint Programming. pp. 529–543 (2007)
 [19] Niemela, I.: Stable models and difference logic. Annals of Mathematics and Artificial Intelligence 53, 313–329 (2008)
 [20] Ostrowski, M.: Clingcon. https://github.com/potassco/clingcon/releases/tag/v3.3.0 (2017), [Accessed: 2018]
 [21] Shen, D., Lierler, Y.: Smtbased constraint answer set solver ezsmt+ for nontight programs. In: KR (2018)
 [22] Susman, B., Lierler, Y.: SMTBased Constraint Answer Set Solver EZSMT (System Description). In: Technical Communications of the 32nd International Conference on Logic Programming (ICLP 2016). vol. 52, pp. 1:1–1:15 (2016)
 [23] Wintersteiger, C.M., Bjørner, N., de Moura, L.: Z3. https://github.com/Z3Prover/z3/releases/tag/z34.5.0 (2016), [Accessed: 2018]
Comments
There are no comments yet.