Enumeration Problems Related to Ground Horn Theories

Abstract

We investigate the enumeration of varieties of boolean theories related to Horn clauses. We describe a number of combinatorial equivalences among different characterizations and calculate the number of different theories in n variables for slightly different characterizations. The method of counting is via counting models using a satisfiability checker. 1 Canonical Propositional Systems Let V be a set of n propositional variables. A nontrivial monomial over V is the product (conjunction) of some variables in V . We say that both 1 and 0 are the trivial monomials and take the convention that 1 is the product of zero variables. A binomial equation is an equality of monomials. Let E be a set of binomial equations over V . If, say, V = {x, y}, we would have E ⊆ {xy = x, xy = y, xy = 1, xy = 0, x = y, x = 1, x = 0, y = 1, y = 1, 1 = 0}. We can apply the Gröbner basis construction to E ∪ {xx = x}x∈V with a given ordering on monomials, and eventually we will get a unique canonical system for E and the particular choice of ordering. How many distinct canonical systems are there over n variables? At first glance, it seems that this question is very difficult. There are 2(2 + 1)/2 E ’s, and some may have the same canonical system. We have to retain those that are in canonical form and rule out those that are not. So that this will not be the proverbial search for a needle in a haystack, we take the following approach: the key point is that this enumeration problem is in fact equivalent to counting the number of distinct Horn functions of n variables. A SAT solver (or more precisely, a SAT enumerator) can help to count this number. The following lemma reveals the fact that E indeed defines an equivalent set of Horn clauses. Lemma 1. Given any set of binomial equations, there is a set of Horn clauses that defines the same constraint. Proof. Given any monomial m, we use x ∈ m to denote that variable x appears in m. We let true ∈ 1 and false ∈ 0. Let c(m) be the conjunction of elements in m. Now for any binomial equation m1 = m2, the corresponding Horn clauses are c(m1) ⇒ x for all x ∈ m2 and c(m2) ⇒ y for all y ∈ m1. ⊓⊔ Conversely, given any set of Horn clauses, the corresponding set of binomial equations can be found by the following transformation: Given x1∧· · ·∧xj ⇒ y, produce x1 · · ·xj = yx1 · · ·xj . Lemma 1 says that each set of binomial equations corresponds to a presentation of Horn clauses. Furthermore, there is a one-one correspondence between the canonical systems of binomial equations and the Boolean functions that satisfy the system. Lemma 1 implies that these functions are in fact constrained by Horn clauses. Let us call a Boolean function Horn, if it can be expressed as a conjunction of Horn clauses. As there are many equivalent sets of binomial equations but only one is canonical, there are many equivalent presentations made of Horn clauses but only one Horn function. We are interested in counting canonical sets of binomial equations, or canonical Horn presentations. Either way, the canonical set or canonical presentation is the canonical representation of a Horn function. Therefore, our enumeration problem is identical to count the number of distinct Horn functions over V . Given a Horn function f , we collect the vectors that f maps to 1 and call that collection the Horn set associated with f . Let t1, t2, and t3 be vectors in {0, 1}. We say that t3 is the meet of t1 and t2 if t3 is obtained by performing the logical-and operation on each individual coordinate of t1 and t2. Horn [1] originally characterized the Horn sets as follows: Lemma 2. A set of vectors is a Horn set iff it is closed under the meet operation. Hence, whether or not a set of vectors is Horn can be tested by the meet criterion in Lemma 2. As there is a one-one correspondence between Horn functions and Horn sets, our problem is further reduced to the problem of counting Horn sets. Now we state how to encode our counting problem in SAT. For each vector μ in {0, 1}, we associate with it a predicate Pμ which means μ is included in the current Horn set. For any t1 and t2, we generate a clause ¬Pt1 ∨¬Pt2 ∨Pt3 where t3 is the meet of t1 and t2. This set of clauses asserts the closure property of the meet operation. And then we could feed the set of clauses into a #SAT solver that counts the number of satisfying models. Note that some clauses may be redundant, since t3 may be identical to t1 or t2. Therefore we generate fewer than 4 clauses. Observe that the generated clauses are indeed Horn clauses. Therefore, a reasonable DPLL-based #SAT solver cannot fail to find a model for any branch of the search, and as one can see the number of models accumulates quickly. There are four variations for counting the number of canonical systems over n variables: 1. f(n) without constants 1 and 0 in the systems (i.e., no m = 1 and m = 0, where m and m are monomials); 2. F (n) without constant 1 (i.e., no m = 1, but may or may not have m = 0); 3. g(n) without constant 0 (i.e., no m = 0, but may or may not have m = 1); 4. G(n) with both 1 and 0 (i.e., may or may not have m = 1 and m = 0). Counting semi-lattices (idempotent commutative semigroups) with n generators is Case 1; Case 3 is idempotent commutative monoids; counting the number of Horn theories is Case 4. There are some relations between these algebras: F (n) = 2f(n) G(n) = 2g(n), since m = 0 is dual tom = V in the canonical systems, wherem is any monomial and V is the product of all variables. This fact can also be seen from their SAT encodings as described above. The monomial m = 0 forbids to select the vector 1 (a vector with all 1s) in a Horn set, and selecting the vector 1 in a Horn set forbids the existence of m = 0 in the canonical system. And in our SAT encoding, the predicate for 1 (i.e., P1) does not appear since it only occurs in the tautology clause which are removed. Therefore P1 is a free variable that can be set to either true or false, and this is just the case for F and G. Case 3 can also be reduced to Case 1, and Case 4 can be reduced to Case 2, since an equation m = 1 can also be resolved. They have the following relationships:

Extracted Key Phrases

Cite this paper

@article{Dershowitz2005EnumerationPR, title={Enumeration Problems Related to Ground Horn Theories}, author={Nachum Dershowitz and Mitchell A. Harris and Guan-Shieng Huang}, journal={CoRR}, year={2005}, volume={abs/cs/0610054} }