Assign Examples
Assign Examples
As in Examples 1 and 2, consider the partial assignment 𝜇A def = {¬𝐴3, ¬𝐴4, ¬𝐴7} (4) which satisfies 𝜑.
First, it is
easy to see that 𝜇A satisfies also NNF(𝜑), in compliance with Lemma 2. Also, 𝜇A satisfies ∃
B.CNFPG(NNF(𝜑)),
because 𝜇A ∪ 𝜂B |=𝑝 CNFPG(NNF(𝜑)) where 𝜂B def = {¬𝐵+1, ¬𝐵+2, 𝐵−2, ¬𝐵+3, ¬𝐵−3, ¬𝐵+4 , 𝐵−4, 𝐵+5, 𝐵+6 ,
𝐵+7}.
The above assignment can be produced by adopting the strategy described above. First, we assign the
literals in 𝜇A,
which force to add also {¬𝐵+2, ¬𝐵+4 } due to (11f) and (11h) respectively. Then we add {𝐵+6 } by step
(a) on (11i), {𝐵−2 } by
step (b) on (11b), and {¬𝐵+1 , ¬𝐵−3, ¬𝐵+3 } by step (c) on (11a), (11c), (11g) respectively. These force to
add {𝐵+7 } and {𝐵+5 }
due to (11k) and (11j) respectively. Finally, we add {𝐵−4} by step (b) on (11d). Overall, this corresponds
to enumerate
only the partial assignment 𝜇A satisfying ∃B.CNFPG(NNF(𝜑)), with both disjoint and non-disjoint
enumeration:
{¬𝐴3, ¬𝐴4, ¬𝐴5} //{¬𝐵+1, ¬𝐵+2, 𝐵−2, ¬𝐵+3, ¬𝐵−3 , ¬𝐵+4, 𝐵−4 , 𝐵+5, 𝐵+6, 𝐵+7 }. ⋄
Notice that, the shorter is 𝜇A w.r.t. a total assignment, the higher is the chance that CNFTs and CNFPG force
the
production of a high number of extra assignments, the more beneficial is the usage of NNF+CNFPG which
avoids
it. This said, if the enumerator is able to produce short partial assignments 𝜇A satisfying the formula, we
expect a
high benefit from using NNF+CNFPG instead of CNFTs and CNFPG; vice versa, if the enumerator produces only
total or nearly-total assignments, we expect no or very-limited benefit respectively.
Implementation-wise, the strategy to assign the values of 𝜂B described above is difficult to implement
inside the
current enumerators. Therefore, there is no formal guarantee that a generic enumeration procedure
always finds
exactly the 𝜂B which prevents the generation of longer assignments. For example, the enumeration
procedure of
§2.2 finds a total truth assignment 𝜂A ∪ 𝜂B that satisfies the formula, and then finds 𝜇A ⊆ 𝜂A that is
minimal
w.r.t. that specific 𝜂B such that 𝜇A ∪ 𝜂B |=𝑝 CNFPG(NNF(𝜑)), so that the 𝜂B found is not guaranteed to be
the
one that allows for the most effective minimization of 𝜇A. Ad-hoc enumeration heuristics could be adopted.
Nevertheless, in §5 we show that a very simple heuristic —i.e., force the assignments of false values first
to decision
atoms— guarantees dramatic improvements w.r.t. previous approaches using two state-of-the-art
AllSAT/AllSMT
enumerators.
5 Experimental Evaluation
In this section, we experimentally evaluate the impact of different CNF-izations on the disjoint and non-
disjoint
AllSAT and AllSMT tasks. In order to compare them on fair ground, we have implemented a base version
of each
from scratch in PySMT [22], avoiding specific optimizations done by the solvers.
We have conducted a very extensive collection of experiments on AllSAT and AllSMT.We tested the
encodings
on MathSAT, which supports disjoint and non-disjoint AllSAT and AllSMT, and on TabularAllSAT and
TabularAllSMT, which support disjoint AllSAT and AllSMT, respectively. The choice of the solvers is
motivated
in §5.1; the benchmarks are described in §5.2, the information for the reproducibility of the experiments is
given in
§5.3, and the results are presented in §5.4; finally, in §5.5 we analyze and discuss the application of the
encodings
to related fields.
5.1 An Analysis of Available Solvers
In order to evaluate the different CNF encodings, we need an AllSAT/AllSMT solver that (i) is publicly
available,
(ii) takes as input a CNF formula, (iii) allows performing projected enumeration, (iv) allows enumerating
(disjoint
or non-disjoint) partial truth assignments; (v) also, the ability of producing minimal assignments is valuable
although not necessary.
In the literature, we found the following candidate solvers: for AllSAT, we found RELSAT [4], Grumberg
[26],
SOLALL [42], Jin [33, 34], clasp [24], PicoSAT [7], Yu [79], BC, NBC, and BDD [76], depbdd [75], Dualiza
[56],
BASolver [80], AllSATCC [43], HALL [21, 20], TabularAllSAT [72, 73], and model-graph [37]. For AllSMT,
the only candidates are MathSAT [15], aZ3 [63], and TabularAllSMT [73].