{'fraction_non_alphanumeric': 0.033942098772681895, 'fraction_numerical': 0.0053438252392976685, 'mean_word_length': 4.689943200801871, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On SAT Models Enumeration in Itemset Mining

Frequent itemset mining is an essential part of data analysis and data mining. Recent works propose interesting SAT-based encodings for the problem of discovering frequent itemsets. Our aim in this work is to define strategies for adapting SAT solvers to such encodings in order to improve models enumeration. In this context, we deeply study the effects of restart, branching heuristics and clauses learning. We then conduct an experimental evaluation on SAT-Based itemset mining instances to show how SAT solvers can be adapted to obtain an efficient SAT model enumerator.


Introduction
Frequent itemset mining is a keystone in several data analysis and data mining tasks. Since the first article of Agrawal [1] on association rules and itemset mining, the huge number of works, challenges, datasets and projects show the actual interest in this problem (see [21] for a survey of works addressing this problem). In [18], De Raedt et al initiate a research trend on constraint programming and data mining. The authors proposed a framework for itemset mining offering a declarative and flexible representation with several generic and efficient CP solving techniques. Encouraged by the promising results of this framework, several contributions addressed other data mining problems using either constraint programming (CP) or propositional satisfiability (SAT) (e.g. [18,8,?,5,12,11]). In this work, we focus on the SAT-based encoding of itemset mining problems [12]. In this new SAT application, the goal is to enumerate all the models of the propositional formula.
Today, propositional satisfiability has gained a considerable audience with the advent of a new generation of solvers able to solve large instances encoding real-world problems. In addition to the traditional applications of SAT to hardware and software formal verification, this impressive progress led to increasing use of SAT technology to solve new real-world applications such as planning, bioinformatics, cryptography. In the majority of these applications, we are mainly interested in the decision problem and some of its optimisation variants (e.g. Max-SAT). Compared to other issues in SAT, the SAT model enumeration problem has received much less attention. Most of the recent proposed model enumeration approaches are built on the top of SAT solvers. Usually, these implementations are based on the use of additional clauses, called blocking clauses, to avoid producing repeated models [16,4,17,14]. Improvements have been proposed to this blocking clause based enumeration solvers (e.g. [14,17]). In particular, the authors in [17] proposed several optimizations obtained through learning and simplification of blocked clauses. However, these kind of approaches are clearly impractical. Indeed, in addition to clauses learned form conflicts, one might add an exponential number of blocked clauses in the worst case. In [7], the authors elaborate an interesting approach for enumerating answer sets of a logic program (ASP), centered around First-UIP learning and backjumping.
In [10], we proposed an approach based on a combination of a DPLL-like procedure with CDCL-based SAT solvers in order to mainly avoid the limitation that concerns the space complexity induced by blocking clauses addition. In this work, we focus on the SAT encoding of the problem of frequent itemset mining that we introduced in [12]. In such encoding, there is a one-to-one mapping between the models of the propositional formula and the set of interesting patterns of the transaction database. Additionally, even for condensed representation such as closed or maximal itemsets, the size of the output might be exponential in the worst case.
The work presented in this paper is mainly motivated by this interesting SAT application to data mining and by the lack of efficient model enumerator.
Our aim is to study through an extensive empirical evaluation, the effects on model enumeration of the main components of CDCL based SAT solvers including restarts, branching heuristics and clauses learning.

Background
Let us first introduce the propositional satisfiability problem (SAT) and some necessary notations. We consider the conjunctive normal form (CNF) representation for the propositional formulas. A CNF formula Φ is a conjunction (∧) of clauses, where a clause is a disjunction (∨) of literals. A literal is a positive (p) or negated (¬p) propositional variable. The two literals p and ¬p are called complementary. A CNF formula can also be seen as a set of clauses, and a clause as a set of literals. Let us mention that any propositional formula can be translated to CNF using linear Tseitin's encoding [22]. We denote by V ar(Φ) the set of propositional variables occurring in Φ.
A Boolean interpretation B of a propositional formula Φ is a function which associates a value B(p) ∈ {0, 1} (0 corresponds to f alse and 1 to true) to the propositional variables p ∈ V ar(Φ). It is extended to CNF formulas as usual. A model of a formula Φ is a Boolean interpretation B that satisfies the formula, i.e., B(Φ) = 1. We note M(Φ) the set of models of Φ. SAT problem consists in deciding if a given formula admits a model or not.
Let us informally describe the most important components of modern SAT solvers. They are based on a reincarnation of the historical Davis, Putnam, Logemann and Loveland procedure, commonly called DPLL [6]. It performs a backtrack search; selecting at each level of the search tree, a decision variable which is set to a Boolean value. This assignment is followed by an inference step that deduces and propagates some forced unit literal assignments. This is recorded in the implication graph, a central datastructure, which encodes the decision literals together with there implications. This branching process is repeated until finding a model or a conflict. In the first case, the formula is answered satisfiable, and the model is reported, whereas in the second case, a conflict clause (called learnt clause) is generated by resolution following a bottomup traversal of the implication graph [15,24]. The learning or conflict analysis process stops when a conflict clause containing only one literal from the current decision level is generated. Such a conflict clause asserts that the unique literal with the current level (called asserting literal) is implied at a previous level, called assertion level, identified as the maximum level of the other literals of the clause. The solver backtracks to the assertion level and assigns that asserting literal to true. When an empty conflict clause is generated, the literal is implied at level 0, and the original formula can be reported unsatisfiable. In addition to this basic scheme, modern SAT solvers use other components such as activity based heuristics and restart policies. An extensive overview can be found in [3].

Frequent Itemset Mining
Formally, we define the problem of mining frequent itemsets (FMI for short) in the following way. Let Ω be a finite set of items. A transaction is defined as a couple (tid, I) where tid is the transaction identifier and I is an itemset, i.e., I ⊆ Ω. A transaction database is a finite set of transactions where the attribute tid refers to a unique itemset. We say that a transaction (tid, I) supports an itemset J if J ⊆ I.  Let D be a transaction database over Ω and n a minimum support threshold. The frequent itemset mining problem consists in computing the following set: One can see that all the elements of FIM(D, n) can be obtained from the closed itemsets by computing their subsets. Enumerating all closed itemsets allows us to reduce the size of the output. We denote by CF IM(D, n) the subset of all closed itemsets in FIM(D, n).
For instance, consider the transaction database described in Table 1. The closed frequent itemsets with the minimal support threshold equal to 2 are: CF IM(D, 2) = {A, D, G, AB, AC, AF, ABC, ACD}.

A SAT Encoding of Frequent Itemset Mining
In this section, we describe SAT encodings for itemset mining which are mainly based on the encodings proposed in [12]. In order to do this, we fix, without loss of generality, a transaction database D = {(1, I 1 ), . . . , (m, I m )} and a minimal support threshold n.
The SAT encoding of itemset mining that we consider is based on the use of propositional variables representing the items and the transaction identifiers in D. More precisely, for each item a (resp. transaction identifier i), we associate a propositional variable, denoted p a (resp. q i ). These propositional variables are used to capture all possible itemsets and their covers. Formally, given a model B of the considered encoding, the candidate itemset is {a ∈ Ω | B(p a ) = 1} and its cover is {i ∈ N | B(q i ) = 1}.
The first propositional formula that we describe allows us to obtain the cover of the candidate itemset: This formula expresses that q i is true if and only if the candidate itemset is supported by the i th transaction. In other words, the candidate itemset is not supported by the i th transaction (q i is false), when there exists an item a (p a is true) that does not belong to the transaction (a ∈ Ω \ I i ).
The following propositional formula allows us to consider the itemsets having a support greater than or equal to the minimal support threshold: This formula corresponds to 0/1 linear inequalities, usually called cardinality constraints. The first linear encoding of general 0/1 linear inequalities to CNF have been proposed by J. P. Warners in [23]. Several authors have addressed the issue of finding an efficient encoding of cardinality (e.g. [20,19,2]) as a CNF formula. Efficiency refers to both the compactness of the representation (size of the CNF formula) and to the ability to achieve the same level of constraint propagation (generalized arc consistency) on the CNF formula.
We use E F IM (D, n) to denote the encoding corresponding to the conjunction of the two formulae (1) and (2). Then, we have the following property: B is a model of We now describe the propositional formula allowing to force the candidate itemset to be closed: This formula means that if we have S(I, D) = S(I ∪ {a}, D) then a ∈ I holds. This condition is necessary and sufficient to force the candidate itemset to be closed. Let us note that the expressions of the form a ∈ I i correspond to constants, i.e., a ∈ I i corresponds to if the item a is in I i , to ⊥ otherwise. Note that the formula (3) can be simply reformulated as a conjunction of clauses as follows: This reformulation is obtained using the equivalence A → B ≡ ¬A ∨ B.
We use E CF IM (D, n) to denote the encoding corresponding to the conjunction of the formulae (1), (2) Table 1. The Problem encoding the enumeration of frequent closed itemsets with a threshold 4 can be written as:

Enumerating all Models of CNF Formulae
A naive way to extend modern SAT solvers for the problem of enumerating all models of a CNF formula consists in adding a blocking clause to prevent the search to return the same model again. This approach is used in the majority of the model enumeration methods in the literature. The main limitation of this approach concerns the space complexity, since the number of blocking clauses may be exponential in the worst case. Indeed, in addition to the clauses learned at each conflict by the CDCL-based SAT solver, the number of added blocking clauses is very important on problems with a huge number of models. This explains why it is necessary to design methods avoiding the need to keep all blocking clauses. It is particularly the case for encodings of data mining tasks where the number of interesting patterns is often significant, even when using condensed representations such as closed patterns.
Our main aim is to experimentally study the effects of each component of modern SAT solvers on the efficiency of the model enumeration, in the case of the encoding described in Section 4. As the number of frequent closed itemsets is usually huge, this results in a huge number of models for the considered encoding. Consequently, it is not suitable to store the found models using blocking clauses during the enumeration process.
We proceed by removing incrementally some components of modern SAT solvers in order to evaluate their effects on the efficiency of model enumeration. The first removed component is the restart policy. Indeed, we inhibit the restart in order to allow solvers to avoid the use of blocking clauses. Thus, our procedure performs a simple backtracking at each found model. The second removed component is that of clause learning, which leads to a DPLL-like procedure. Considering a DPLL-like procedure, we pursue our analysis by considering the branching heuristics. Indeed, our goal is to find the heuristics suitable to the considered SAT encoding. To this end, we consider three branching heuristics. We first study the performance of the well-known VSIDS (Variable State Independent, Decaying Sum) branching heuristic. In this case, at each conflict an analysis is only performed to weight variables (no learnt clause is added). The second considered branching heuristic is based on the maximum number of occurrences of the the variables. The third one consists in selecting the variables randomly.

Experiments
We carried out an experimental evaluation to analyze the effects of adding blocking clauses, adding learned clauses and branching heuristics. To this end, we implemented a DPLL-like procedure, denoted DPLL-Enum, without adding blocking and learned clauses. We also implemented a procedure on the top of the state-of-the-art CDCL SAT solver MiniSAT 2.2, denoted CDCL-Enum. In this procedure, each time a model is found, we add a no-good and perform a restart. We considered a variety of datasets taken from the FIMI 1 and CP4IM 2 repositories. All the experiments were done on Intel Xeon quad-core machines with 32GB of RAM running at 2.66 Ghz. For each instance, we used a timeout of 15 minutes of CPU time.
In our experiments, we compare the performances of CDCL-Enum to three variants of DPLL-Enum, with different branching heuristics, in enumerating all the models corresponding to the closed frequent itemsets. The considered variants of DPLL-Enum are the following: -DPLL-Enum+VSIDS: DPLL-Enum with the VSIDS branching heuristic; -DPLL-Enum+JW: DPLL-Enum with a branching heuristic based on the maximum number of occurrences of the variables [13]; -DPLL-Enum+RAND: DPLL-Enum with a random variable selection.
Our comparison is depicted by the the cactus plots of Figure 1. Each dots (x, y) represents an instance with a fixed minimal support threshold n. Each cactus plot represents an instance and the evolution of CPU time needed to enumerate all models with the different algorithms while varying the quorum. For each instance, we tested different values of n. The x-axis (respectively y-axis) represents the CPU time (in seconds) needed for the enumeration of all closed frequent itemsets.
Unsurprisingly, the DPLL-like procedures outperform CDCL-Enum on the majority of instances. This shows that a DPLL based approach is more suitable for SATbased itemset mining. Part of explanation lies in the significant number of models. Furthermore, DPLL-Enum+RAND is clearly less efficient than DPLL-Enum+VSIDS and DPLL-Enum+JW, which shows that the branching heuristic plays a key role in model enumeration algorithms. Moreover, our experiments show that DPLL-Enum+JW is better than DPLL-Enum+VSIDS, even if DPLL-Enum+VSIDS compete with the procedure DPLL-Enum+JW on datasets such as anneal and mushroom. Indeed, DPLL-Enum+JW clearly outperforms DPLL-Enum+VSIDS on several datasets, such as chess, kr-vs-kp and splice-1. Note that for theses two data, the solvers DPLL-Enum+RAND and CDCL-Enum are not able to enumerate completely the set of all models of all considered quorums.
As a summary, our experimental evaluation suggests that a DPLL-like procedure is a more suitable approach when the number of models of a propositional formula is significant. It also suggests that the branching heuristic is a key point in such a procedure to improve the performance.

Conclusion
In this paper, we investigated the impact of modern SAT solvers on the problem of enumerating all the models of CNF formulas encoding frequent closed itemsets mining problem. Our goal is to measure the impact of the classical components of CDCL-based SAT solvers on the efficiency of model enumeration. Our results suggest that on formula with a huge number of models, SAT solvers must be adapted to efficiently enumerate all the models. We showed that the simple DPLL solver augmented with the classical Jeroslow-Wang heuristic achieve better performance.
As a future work, we plan to pursue our investigation in order to find the best heuristics for enumerating models encoding data mining problems. Finding how to efficiently integrate clauses learning for model enumeration is another interesting issue.