Algorithms for Propositional Model Enumeration and Counting

Algorithms for Propositional Model Enumeration and Counting

Algorithms for Propositional Model Enumeration and Counting A. Morgado and J. Marques-Silva Technical Report RT/039/05-CDIL February 2005 Software Algorithms and Tools for constraint solving - SAT Instituto de Engenharia de Sistemas e Computadores, Investiga¸c~ao e Desenvolvimento, Lisboa 2 Abstract A large number of practical applications rely on effective algorithms for propositional model enumeration and counting. Examples include knowledge compilation, model checking and hy- brid solvers. Besides practical applications, the problem of counting propositional models is of key relevancy in computational complexity. In recent years a number of algorithms have been proposed for propositional model counting and enumeration. However, the algorithms for model counting and model enumeration have been developed in different contexts, and so are based on fairly different techniques. This paper surveys algorithms for both model enumeration and model counting, proposes optimizations to model enumeration algorithms, and addresses open topics in model counting. Experimental results, obtained on practical and representative problem instances, indicate that the proposed techniques are effective for model enumeration. 1 Introduction Propositional model counting has several applications in artificial intelligence, including Bayesian belief networks, knowledge compilation and truth maintenance [21, 7]. Propositional model enumer- ation also has several applications, including model checking [18, 13, 12] and hybrid solvers [1]. In recent years a number of algorithms have been proposed, for model counting [5, 3, 2, 22], but also for model enumeration [18, 6, 13, 23, 15, 20, 12]. Interestingly, the algorithms for model counting and model enumeration have been proposed in different contexts, and so utilize fairly different tech- niques. For model counting, existing techniques include connected components [3], conflict clause learning [3, 22] and component caching [2, 22]. In contrast, algorithms for model enumeration (most often in the context of model checking) have mostly utilized techniques based on clause learning, namely conflict clause learning and blocking clause learning. Blocking clauses can be viewed as an instantiation of good learning, a technique suggested (but not implemented or detailed) by Bayardo and Pehoushek in [3]. It is also interesting to observe that model enumeration algorithms are of- ten allowed to produce repeated models, whereas model counting algorithms must necessarily avoid repeated models. This paper reviews algorithms for model counting and for model enumeration, addresses limita- tions of current model enumeration algorithms, and proposes new algorithms for model enumeration. The new algorithms improve the identification of blocking clauses. In addition, the paper shows how to utilize blocking clauses (or goods) in model counting algorithms. The paper is organized as follows. The next section introduces basic notation, provides a brief perspective on SAT solvers, and briefly surveys algorithms for model enumeration and for model counting. Afterwards, Section 3 addresses clause learning, and its utilizations in model enumeration and counting algorithms. Section 4 proposes techniques for simplifying satisfying assignments, with direct application in model enumeration and counting. Experimental results, evaluating the practical usefulness of the proposed techniques, are provided in Section 5. Finally, Section 6 concludes the paper. 1 2 Preliminaries A Conjunctive Normal Form (CNF) formula ' is defined over a finite set of variables X = fx1; x2; : : : ; xng. A CNF formula ' consists of a conjunction of clauses, where each clause ! is a disjunction of literals, and where each literal l is either a variable xi or its complement :xi. Where appropriate a CNF formula ' can be viewed as a set of clauses and each clause ! can be viewed as a set of literals. An assignment A is a function from X to f0; u; 1g, where u represents an unspecified (or don't care) value, with 0 ≤ u ≤ 1. An assignment A is said to be complete if 8xi2X A(xi) 2 f0; 1g; otherwise it is partial. Where appropriate an assignment A can be viewed as a set of pairs (xi; vi), A = f(x1; v1); : : : ; (xn; vn)g, where vi = A(xi) 2 f0; u; 1g denotes the value assigned to xi 2 X. In general, A = AU [ AS, where AU denotes the unspecified variable assignments, of the form (xi; u), and AS denotes the specified variable assignments, of the form (xi; vi), vi 2 f0; 1g. Moreover, AS = AD [ AI , where AD denotes the variable assignments declared as decision assignments by the SAT solver, and AI denotes the variable assignments implied by unit propagation. For modern SAT solvers, AD denotes the assigned variables that have no antecedent, and AI denotes the assigned variables that have an antecedent [17]. Given an assignment A, the value of a CNF formula ', 'jA is defined as follows: • The value of a literal ljA is given by A(xi) if l = xi and is given by 1 − A(xi) if l = :xi. • The value of a clause !, !jA, is given by maxl2! ljA. A clause ! 2 ' is said to be satisfied if !jA = 1 and unsatisfied if !jA = 0; otherwise it is said to be undecided. • The value of a CNF formula ', 'jA, is given by min!2' !jA. A formula ' is said to be satisfied if 'jA = 1 and unsatisfied if if 'jA = 0; otherwise it is said to be undecided. An assignment A such that 'jA = 1 is said to be a satisfying assignment. 0 An assignment A is said to be covered by an assignment A if for every xi 2 X, with A(xi) 2 f0; 1g, 0 0 0 we have A (xi) 2 f0; 1g. Hence, A is covered by A provided A contains at least the specified assignments of A. Two assignments A and A0 are said to intersect if either A covers A0 or A0 covers A. Finally, a model of a CNF formula ' is a complete assignment A such that 'jA = 1. 2.1 Boolean Satisfiability Solvers The evolution of Boolean Satisfiability (SAT) solvers over the last decade [17, 19, 10] has mo- tivated the widespread use of SAT solvers in practical applications. For real-world instances the most effective SAT solvers are based on backtrack search [8] and share a number of key techniques, including: • Unit propagation, also referred as Boolean constraint propagation, that consists of the identi- fication of implied variable assignments [9]. 2 Algorithm 1 Basic Model Counting Algorithm [5] function CountModels('; A; n) UnitPropagate('; A) if () 2 ' then return 0 end if if ' == ; then return 2n−|Aj end if (xi; vi) =SelectBranchVariable(') (lp; ln) = (vi == 1) ? (xi; :xi) : (:xi; xi) c1 = CountModels(' [ f(lp)g; A [ f(xi; vi)g; n − 1) c2 = CountModels(' [ f(ln)g; A [ f(xi; 1 − vi)g; n − 1) return c1 + c2 end function • Clause learning, consisting of learning new clauses in presence of conflicts during the execution of backtrack search. A few techniques related with clause learning are the utilization of unique implication points (UIPs) [17], and non-chronological backtracking [17]. • Efficient and lazy data structures [19]. • Adaptive branching heuristic, usually derived from the VSIDS heuristic [19]. • Utilization of search restarts [11]. 2.2 Model Counting and Enumeration The most effective model counting algorithms are based on the Davis-Logemann-Loveland (DLL) procedure [8]. Other algorithms have been proposed (see [16] for a survey), but are in general impractical. The first DLL-based algorithm for model counting was proposed by Birnbaum and Lozinskii [5]. This algorithm corresponds to an implementation of the standard DLL algorithm, but the algorithm is modified to count identified models. The organization of the algorithm is shown in Algorithm 1. Bayardo and Pehoushek [3] improved the algorithm of [5] by exploiting the existence of connected components in CNF formulas and by the utilization of an improved SAT solver [4]. More recently, Bacchus et al [2]. and Sang et al. [22] proposed the utilization of the techniques used in [3], namely connected components and clause learning, as well as component caching. Besides the work on model counting, a number of authors have addressed model enumeration techniques [18, 6, 13, 23, 15, 20, 12]. Whereas in algorithms for model counting, the accuracy of counting is paramount, in algorithms for model enumeration the objective is to identify a small num- ber of partial assignments that cover all models of the original formula, even though some models may 3 Algorithm 2 Basic Model Enumeration Algorithm function EnumerateModels('; A) UnitPropagate('; A) if () 2 ' then return False end if if ' == ; then A0 =MinimizePartialAssignment(A) Save(A0) BlockPartialAssignment(A0) . Eliminate assignments that intersect A0 return True end if (xi; vi) = SelectBranchVariable(') (lp; ln) = (vi == 1) ? (xi; :xi) : (:xi; xi) s1 = EnumerateModels(' [ f(lp)g; A [ f(xi; vi)g) s2 = EnumerateModels(' [ f(ln)g; A [ f(xi; 1 − vi)g) return s1 _ s2 end function be covered by more than one partial assignment. Hence, the work on model enumeration has focused on techniques for reducing the size of computed satisfying partial assignments. The organization of a model enumeration algorithm is illustrated in Algorithm 2. Observe that most model enumeration algorithms assume a Boolean circuit, and often the enumerated partial assignments are expressed in terms of primary inputs and state variables [18, 6, 13, 23, 15, 20, 12]. Moreover, the process of blocking the enumeration of satisfying partial assignments that intersect A0 usually involves creating a new clause. Finally observe that the most effective techniques used in model counting, connected compo- nents [3] and component caching [22], are not readily applicable in model enumeration. The utiliza- tion of connected components allows multiplying the number of solutions in different components. For model enumeration, one must actually enumerate the products of the models for the different components. The same holds true for component caching. As a result, the remainder of the paper addresses techniques that can be readily used in model enumeration.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    17 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us