scispace - formally typeset
Open AccessProceedings ArticleDOI

Prime implicant computation using satisfiability algorithms

TLDR
Given the organization of the proposed SAT algorithm, the resulting ILP procedures implement powerful search pruning techniques, including a non-chronological backtracking search strategy, clause recording procedures and identification of necessary assignments.
Abstract
The computation of prime implicants has several and significant applications in different areas, including automated reasoning, non-monotonic reasoning, electronic design automation, among others. The authors describe a new model and algorithm for computing minimum-size prime implicants of propositional formulas. The proposed approach is based on creating an integer linear program (ILP) formulation for computing the minimum-size prime implicant, which simplifies existing formulations. In addition, they introduce two new algorithms for solving ILPs, both of which are built on top of an algorithm for propositional satisfiability (SAT). Given the organization of the proposed SAT algorithm, the resulting ILP procedures implement powerful search pruning techniques, including a non-chronological backtracking search strategy, clause recording procedures and identification of necessary assignments. Experimental results, obtained on several benchmark examples, indicate that the proposed model and algorithms are significantly more efficient than other existing solutions.

read more

Content maybe subject to copyright    Report

Prime Implicant Computation Using Satisfiability Algorithms
Vasco
M.
Manquinho, Paulo
E
Flores,
Jo20
P. Marques Silva, Arlindo
L.
Oliveira
Cadence European Laboratories
IS
TANES
C
1000
Lisboa, Portugal
vmm@calvin.inesc.pt,{pff,jpms,aml}@inesc.pt
Abstract
The computation of prime implicants has several and
significant applications in different areas, including Auto-
mated Reasoning, Non-Monotonic Reasoning, Electronic
Design Automation, among others. In this paper we
describe a new model and algorithm for computing mini-
mum-size prime implicants of propositional formulas. The
proposed approach is based
on
creating an integer linear
program (ILP) formulation for computing the minimum-
size prime implicant, which simplijes existing formula-
tions. In addition, we introduce
two
new algorithms for
solving ILPs, both of which are built
on
top of an algo-
rithm for propositional satisjability
(SAT).
Given the
organization
of
the proposed SAT algorithm, the resulting
ILP procedures implement powerful search pruning tech-
niques, including a non-chronological backtracking
search strategy, clause recording procedures and iden@-
cation of necessary assignments. Experimental results,
obtained
on
several benchmark examples, indicate that the
proposed model and algorithms are significantly more efi-
cient than other existing solutions.
1
Introduction
Given a propositional formula
cp
in Conjunctive Nor-
mal Form (CNF), denoting a boolean functionf, the prob-
lem
of
computing a minimum-size assignment (in the
number of literals) that satisfies
f
is referred to as the
mini-
mum-size prime implicant problem.
Minimum-size prime
implicants find application in many areas including,
among others, Automated Reasoning, Non-Monotonic
Reasoning and Electronic Design Automation. Moreover,
interest on computing minimum-size prime implicants of
boolean functions has motivated extensive research work
(see for example
[8,9],
which include comprehensive bib-
liographic references.).
In this paper we describe an Integer Linear Program
(ILP) formulation for computing minimum-size prime
implicants of boolean functions described by Conjunctive
Normal Form (CNF) formulas. The proposed ILP model,
first introduced in
[
141,
significantly simplifies the one
originally described in
[9].
Moreover, we propose two new
algorithms for solving ILPs where the variables have bool-
ean domains (01-ILPs). Both algorithms are based on
propositional satisfiability (SAT). The first one generalizes
the SAT-based ILP algorithm originally described in
[2],
whereas the second one describes a branch and bound ILP
procedure built on top of a SAT solver. For both algo-
rithms the GRASP SAT solver [12,
151
is used. Prelimi-
nary results, obtained on several satisfiable instances of
the DIMACS benchmarks
[6],
indicate that the proposed
model and algorithms can be used for computing mini-
mum-size prime implicants for several classes of boolean
functions. Furthermore, we show that widely used ILP
algorithms, most of which are based on linear-program-
ming (LP) relaxations
[7],
may be inadequate for comput-
ing minimum-size prime implicants. This result strongly
suggests using dedicated ILP algorithms for solving the
minimum-size prime implicant problem. Finally, we note
that the proposed
ILP
algorithms, implement powerful
search pruning techniques commonly used in SAT algo-
rithms, which include a non-chronological backtracking
search strategy, clause recording procedures and identifi-
cation
of
necessary assignments.
The paper is organized as follows. In Section
2
the
notational framework used throughout the paper is intro-
duced. Afterwards, we describe the ILP model for com-
puting minimum-size prime implicants of boolean
functions described with CNF formulas. This model is
based on the one proposed in
[9],
but significantly reduces
the number of variables as well as the size of their
domains. Consequently, the worst-case size of the search
space becomes drastically reduced, and hence a smaller
search space is expected for most practical examples. In
Section
4
we describe two new SAT-based ILP algorithms
and illustrate how the identification of prime implicants
can
be
iterated.
The
procedure proposed in this paper
for
iterating prime implicants by increasing size is provably
more efficient than the one described in
[9].
The different
algorithms are experimentally evaluated in Section
5.
Finally, Section
6
concludes the paper suggesting potential
improvements to the proposed model and algorithms.
232
1082-3409197 $10.00
0
1997
IEEE

2
Definitions
follows:
2n
min
Cyj
j=
1
The paper follows the definitions introduced in [12,
141, in particular for the organization of the GRASP SAT
algorithm which is described in Section 4. In general,
a
propositional formula
cp
in CNF denotes
a
boolean func-
tion
f
:
(0,
1
}
-+
{
0,
1
},
where each clause
w
is
a
sum
of litcrals, and
a
literal
I
is cither a variablc
xi
or its com-
plement
xi.
For
a
search-based algorithm for SAT,
a
con-
flict
is
said to he identified when all literals of at least one
clause are assigned value
0.
The GRASP SAT
[
121 algo-
rithm implements several techniques for pruning the
amount of search based on the
diagnosis
of conflicts iden-
tified during the search.
A clause
w
=
(11
+
...
+
Zk)
denotes a constraint
which can
also
be viewed
as
a
linear inequality,
1,
+
.
. .
+
I,>
1
.
We use this alternative representation
when appropriate. Furthermore, since
a
literal
1
=
xi'
can
also be defined by
1
=
1
-xi,
we shall in general use this
latter representation when viewing clauses as linear ine-
qualities.
3
Prime Implicant Computation Using Inte-
ger Programming
Given a description of
a
Boolean function in CNF, it
is straightforward to formulate the computation of the
minimum-size prime implicant
as
an integer linear pro-
gram
[9].
In this paper we show how to simplify the for-
mulation proposed in
[9],
thus allowing for
a
significant
reduction in the worst-case search space. This improved
model was first described in 1141.
Given a CNF formula
cp,
which is defined on
a
set of
variables {xl,
.
.
.,
xn},
with
p
clauses
{
w,,
.
.
.,
op},
and
which denotes
a
Boolean function
f:
(O,l}n+
(0,
l},
apply the following transformation.
1.
Create
a
new set of boolean variables {yl,
...,y2,,},
where
y2i
-
is associated with literal
xi,
and
yZi
is
associated with literal
x;
.
2. For each clause
o
=
(Il
+
...
+
1,)
,
replace each
literal
lj
with
y2k-,
if
lj
=
xk,
or with
yZk
if
1.
=
n.'
.
3.
For each pair of variables,
y2i-
and y2i, require that
at most one is set
to
one. Hence, y2i-
+
y2i
I
1
.
4.
The set of inequalities obtained from steps
2.
and
3.
can
be viewed
as
a
single set of inequalities
A
.y
2
b.
Furthermore, define the cost function to be,
11
2n
min
Cyj
(1)
j=
1
5.
The complete ILP formulation is thus defined as
s.t.
A.y2b
It is clear that the solution of (2) denotes
a
minimum-
size prime implicant of the original CNF formula
cp,
and
from
[9]
we have,
Proposition
1.
Given
a
CNF formula
cp
and associated
boolean function
f,
the solution of the optimization prob-
lem
(2)
is
a
minimum-size prime implicant off.
The proposed ILP model is based on the one
described in [9]. However, the model proposed in
[9]
asso-
ciates an integer variable
Ai
with each inequality created
from each original clause
wi
.
As
we showed above, such
integer variables are unnecessary and only increase the
worst-case search space. Indeed, for the ILP model of
(2),
the worst-case search space is,
22n
=
4"
(3)
whereas for the ILP model of [9], the worst-case search
space is,
4n.
fI,wi,
(4)
i=
1
where
lwll
denotes the number of literals of clause
w,
,
and represents the least upper bound on the integer vari-
able
hi
associated with clause
mi
and introduced in the
ILP model of [9]. Consequently, the worst-case search
space for the ILP model we propose in this paper is prov-
ably less than for the model proposed in
[Y].
We should
note that for both models, and for a search-based ILP algo-
rithm,
a
straightforward arrangement of the order of the
decision variables leads to a worst-case search space
of
3n
(since only
3
assignments are possible for each
of
the
n
pairs of variables), but unfortunately this information can-
not in general be made available to the ILP solver.
The construction of the ILP model (2) will be illus-
trated with the following CNF formula:
(5)
First,
we start by creating
a
new set of variables
{yl,
yZ,
y3,
y4,
Y~,
y+,
and associate
yZi-
with each
xi
and
y2i
with each
xi
.
Consequently, from
(5)
the folloa-
ing modified
CNF
formula
cp'
is obtained:
cp
=
(xl
+X2+X3)
.
(x1'+x2')
.
(Xl'+X3')
For
each clause, simple algebraic manipulation yields
233

an equivalent inequality:
Y,+Y,+Y521
Y2+Y42
1
(7)
Y2+Yg2'
The next step is to require that at most one variable of
each pair of variables y2i-
,
,
yZi
can be set to one, which
yields:
y,+yz<1,a-y1-y2>-1
y3+y41 1 '%y3-y42-l
(8)
y5+y6$ 1 e%-y5-yg2-1
Thus allowing for a given variable
xi
not to be
assigned. Equations
(7)
and
(8)
define the set of inequali-
ties
A
.
y
2
b
.
The next step is to identify the cost func-
tion, which minimizes the number of variables assigned
value one, i.e. the number of variables
xi
with an assigned
value. Finally the resulting ILP model becomes:
min
Y1+Y2+Y3+Y4+Y5fY6
s.t.
A.y2b
(9)
One solution to the integer linear program
(9)
is, for
example,
x1
=
0
and
x2
=
1
.
4
Search Algorithms
for
Solving
ILPs
In [2] P. Barth described how to solve ILPs using a
propositional satisfiability algorithm. However, the ILP
algorithm described in [2] is based on the Davis-Putnam
[5]
procedure, which has been shown to be particularly
inefficient for a large number of instances of SAT
[
121.
In this section we describe two different algorithms
for solving ILPs associated with instances
of
the mini-
mum-size prime implicant problem. Both are based on
SAT algorithms. The first algorithm follows P. Barth's
approach, whereas the second builds a branch and bound
procedure on top of a SAT engine. The two algorithms use
the GRASP SAT algorithm described in
[12],
which
includes several powerful pruning techniques for reducing
the amount of search associated with instances of SAT.
Among the pruning techniques included in GRASP, the
following have been shown to be particularly significant:
GRASP implements a
non-chronological backtracking
search strategy'. This backtracking strategy potentially
permits skipping over large portions
of
the decision tree
for some instances of SAT.
1.
Some variations
of
this strategy are also commonly
referred to as
dependency-directed backtracking
and
backjumping
[lo].
GRASP utilizes selective
clause recording
techniques.
During the search process, and as conflicts are
diagnosed, new clauses are created from the causes of
the conflicts. These clauses represent implicates of the
boolean function associated with the CNF formula, and
are often referred to
as
nogoods
[Ill. Newly recorded
clauses are then used for pruning the subsequent search.
Moreover, bounds on the size of recorded clauses can be
imposed, thus preventing an excessive growth of the
resulting CNF formula.
In most practical situations, instances
of
SAT can have
highly structured CNF representations. The intrinsic
structure of these representations can be exploited by
GRASP, after diagnosing the causes of conflicts, by
identifying
necessary assignments
required for
preventing conflicts from being identified during the
search.
In
addition, other pruning techniques can be
straightforwardly applied to SAT algorithms. In
particular, and as described in [13], several techniques
commonly used in algorithms for different variations of
the set covering problem [4].
4.1 SAT-Based Linear Search Algorithm
The first ILP algorithm follows P. Barth's ILP algo-
rithm
[2]
and was first described in [14]. Let
us
consider
the cost function (1). The possible values assumed by the
cost function for the different assignments to the variables
in the set {y,,
...,yZn}
range from
0,
when all variables
are assigned value
0,
to
2n,
when all variables are
assigned value 1. Note however, that for the minimum-
size prime implicant problem
a
trivial upper bound is
n
,
since for any pair of variables yZi-
,
yZi at most one can
be assigned value 1. P. Barth's [2] approach consists of
applying the following sequence of steps, starting from an
upper bound of
k
=
n
on the value of the cost function:
1.
Create a new inequality xyj
I
k.
This inequality
basically requires that a computed solution must have
no more than
k
literals assigned value
1.
2.
Solve the resulting instance of satisfiability. (Note that
the resulting instance of satisfiability is defined on linear
inequalities, but modifying most SAT algorithms for
handling this generalization is straightforward.)
3.
If the instance
of
SAT
is
satisfiable decrement
k
(i.e.
specify a new value for the cost function) and go back to
step
1.
Otherwise, report that the solution to the ILP is
k+l.
Note that this ILP algorithm allows for any SAT algo-
rithm
to
be used as the underlying SAT testing engine, pro-
vided the algorithm is modified to handle linear
inequalities. The proposed ILP algorithm is illustrated in
234

int
minjrime
('p)
t
k
=
n;
while
(k20)
{
cp
=
cpu
{
status
=
solve-sat(q);
cp
=
9-
{xl;'k}
;
if
(status
==
SATISFIABLE)
{
Y.lk}
;
c,
k
=
Xyj;
--k
;
1
else
{
++k;
break;
1
return
k
;
I
Figure
1
:
SAT-based linear search algorithm
+--
2
:::
(a) Bounding cannot be applied
:","
:=OPT
OPT
(b) Bounding can be applied
f
YE3,=OPT+ LB,
UB
=
OPT
(c) UB cannot decrease
Figure
2:
Using bounding in the ILP algorithm
Figure
1.
For
our
particular case, the solve-sat function
call invokes the GRASP SAT algorithm [12].
4.2 SAT-Based Branch and Bound Algorithm
A different algorithmic organization consists of using
a
variation of the branch and bound procedure
[7],
where
upper bounds to the cost function (1) are identified and
lower bounds to the current set of variable assignments are
estimated. In our implementation, we have used the lower
bound estimation procedures described in [4].
The operation of bounding for the proposed procedure
is illustrated in Figure
2.
Let UB denote the lowest
com-
puted
upper bound on the solution of (2), LB, denote an
estimated
lower bound on the solution of (2) and OPT
denote the solution of (2). If the estimated lower bound is
less than the already computed upper bound (as shown in
Figure 2-(a)), then the search cannot be bound since it may
still be possible to reduce the value of the upper bound.
Clearly, the search can be bound whenever the estimated
lower bound to the value of
(I)
is,larger than or equal to
the existing upper bound to the value of
(I),
as illustrated
in Figure 2-(b). Finally, observe that Figure 2-(c) denotes
the conditions after which the upper bound will no longer
be updated during the search.
Moreover, since the branch and bound procedure is
embedded in the SAT algorithm, every pruning technique
used by the SAT algorithm can
also
be used in solving the
ILP. This is particularly useful whenever a constraint of
(2) becomes unsatisfied. Consequently, the branch and
bound procedure consists of the following steps:
1.
Initialize the upper bound to highest possible value.
(Valid ILPs must correspond to instances of the
minimum-size prime implicant problem.)
2. If no decision can be made (i.e. a solution to the
constraints has been identified), then compute an upper
bound on the minimum value of the cost function of the
ILP formulation. Update current upper bound and issue
a conflict to guarantee that the search is bound.
Otherwise, branch on a given decision variable (i.e.
make decision assignment).
3.
Apply boolean constraint propagation [16]. If
a
conflict
is reached, then diagnose conflict, record relevant
clauses, and proceed with the search process
or
backtrack if required.
4.
Estimate lower bound. If this value is larger than or
equal to the current upper bound, then issue a conflict,
diagnose the conflict, backtrack, and continue the search
from step 2.
The pseudo-code for the algorithm is shown in Figure
3.
Observe that the proposed branch and bound SAT-based
ILP algorithm has the following main differences with
respect to the linear search ILP algorithm:
No
clauses involving the cost function are created. The
exception occurs when the estimated lower bound is no
less than the computed upper bound. In this situation
a
clause involving some of the literals in the cost function
is temporarily created, thus causing the search
procedure to backtrack. (See [I21 for details of the
backtrack search SAT algorithm.)
Lower bounding procedures are required.
As
mentioned
earlier, the lower bounding procedures of 141 are used,
but lower bounding procedures based on
linear-
programming relaxations
or
Lagrangian relaxations
235

tnt
bsolo
(cp)
UB
=
m;
while (TRUE)
{
if
(Solution-found0
11
Decide0
!=
DECISION)
Update-UB
( )
;
Issue-UB-based-conflict();
1
while
(Deduce
(
)
==
CONFLICT)
{
if
(Diagnose0
==
CONFLICT)
{
return
-UB;
I
I
while
(Estimate-LBO
2
-UB)
{
Issue-LB-based-conflict();
if
(Diagnose0
==
CONFLICT)
{
I
return
-UB;
I
1
t
Fiaure
3:
SAT-based branch and bound alaorithm
can also be used
[3,
71. Clearly, the tightness of the
lower bounding procedure is crucial for the efficiency of
the branch and bound procedure.
4.3
Extensions to the Basic ILP Algorithms
One extension to the proposed ILP algorithms is the
ability to incrementally enumerate prime implicants by
increasing size
[9].
The procedure proposed in
[9]
basi-
cally recreates the search for each new prime implicant to
be computed. Clearly, this solution can introduce signifi-
cant and unnecessary computational overhead. One possi-
ble improvement is based on the SAT-based linear search
ILP algorithm of Figure 1, and is organized as follows:
1.
Keep a stack of pairs of computed solutions and
associated upper bound values
k.
2. Use the current top of the stack to find the next
minimum-size prime implicant.
3.
For a given solution-upper bound pair
k,
apply the
algorithm of Figure 1 until the next optimal solution is
found. For this new optimal bound, enumerate all
solution assignments.
4. As soon as a given pair solution-upper bound yields no
more solutions, pop the stack and go back to step
2.
Repeat until stack of solution-upper bound pairs
becomes empty.
Since for each prime implicant size only part of the
search space is visited, the above algorithm ensures abet-
ter worst-case time complexity than the algorithm of [9].
5
Experimental Results
In this section we include experimental results of two
tools for computing minimum-size prime implicants,
min-
prime
[14] and
bsolo.
min-prime
is based on linear search
through the possible values of the cost function as
described in Section
4.1,
whereas
bsolo
uses the SAT-
based branch and bound algorithm as described in Section
4.2. We also compare these two SAT-based ILP algorithms
with other
ILP
solvers,
lp-solve
[3],
opbdp
[2], and the
commercial optimization tool
CPLEX.
Moreover, the
binate covering tool
scherzo
[4]
is
also evaluated, since
minimum-size prime implicant computation can also be
viewed as a restricted form of the binate covering prob-
lem. For this purpose we selected a set of satisfiable
instances of the DIMACS benchmarks [6], from most of
the available classes of instances. The CPU times,
obtained on a
SUN
5/85
machine with 64 MByte of physi-
cal memory, are shown in Table 1
and Table 2, where
Table 2 includes the results for the SAT-based algorithms.
For each benchmark and for each
tool
3000
seconds of
CPU time were allowed. Column
min
indicates the size of
the minimum-size prime implicant, when this size
is
known. (Observe that for some of the benchmarks the
minimum size prime implicant
is
still unknown.) Table
3
and Table 4 include the upper bound on the minimum size
prime implicant computed by each algorithm for each
benchmark. When each tool terminates, it reports the min-
imum size prime implicant if it was identified, otherwise
the lowest computed upper bound is reported provided at
least one upper bound was identified. For the results
shown,
whenever a tool quits earlier than
3000
sec, then
the tool exceeded the available virtual memory (i.e.
64
MB
y
te)
.
As can be concluded, general-purpose ILP solvers,
such as
CPLEX
and
lp-solve,
may be inadequate for com-
puting minimum-size prime implicants. Similarly, despite
the very promising results as an algorithm for solving
binate covering problems
[4],
scherzo
performs particu-
larly poorly when computing minimum-size prime impli-
cants. The three SAT-based ILP solvers can handle a large
number of benchmarks and, in general,
min-prime
and
bsolo
perform better and are more robust than
opbdp,
which is unable to find the solution on a larger number of
instances. For the
JNH
benchmarks,
opbdp
performs bet-
ter
because the amount
of
search is similar and the over-
head of the underlying GRASP SAT algorithm is larger.
One key drawback of
min-prime
derives from using an
ILP layer around the SAT algorithm which creates large
additional clauses. For the minimum-size prime implicant
236

Citations
More filters
Proceedings ArticleDOI

Feature Diagrams and Logics: There and Back Again

TL;DR: This paper gives an automatic and efficient procedure for computing a feature model from a formula and characterize a class of logical formulas equivalent to feature models and identify logical structures corresponding to their syntactic elements.
Book ChapterDOI

Approximate boolean reasoning: foundations and applications in data mining

TL;DR: The presentation of the theoretical foundation of RSABR as well as its application in solving many data mining problems and knowledge discovery in databases such as feature selection, feature extraction, data preprocessing, classification of decision rules and decision trees, association analysis.
Proceedings ArticleDOI

Feature Diagrams and Logics: There and Back Again

Czarnecki, +1 more
Proceedings ArticleDOI

Efficient synthesis of feature models

TL;DR: These algorithms are the first known techniques that are efficient enough to be applied to dependencies extracted from real systems, opening new possibilities of creating reverse engineering and model management tools for variability models.
Book ChapterDOI

Minimum satisfying assignments for SMT

TL;DR: In this paper, the authors present an algorithm for computing minimum satisfying assignments for satisfiability modulo theories that admit quantifier elimination, such as linear arithmetic over reals and integers, bitvectors, and difference logic.
References
More filters
Book

Artificial Intelligence: A Modern Approach

TL;DR: In this article, the authors present a comprehensive introduction to the theory and practice of artificial intelligence for modern applications, including game playing, planning and acting, and reinforcement learning with neural networks.
Book

Network Flows: Theory, Algorithms, and Applications

TL;DR: In-depth, self-contained treatments of shortest path, maximum flow, and minimum cost flow problems, including descriptions of polynomial-time algorithms for these core models are presented.
Book

Integer and Combinatorial Optimization

TL;DR: This chapter discusses the Scope of Integer and Combinatorial Optimization, as well as applications of Special-Purpose Algorithms and Matching.
Journal ArticleDOI

A Computing Procedure for Quantification Theory

Martin Davis, +1 more
- 01 Jul 1960 - 
TL;DR: In the present paper, a uniform proof procedure for quantification theory is given which is feasible for use with some rather complicated formulas and which does not ordinarily lead to exponentiation.
Book

Network Flows

TL;DR: The question the authors are trying to ask is: how many units of water can they send from the source to the sink per unit of time?