A Benchmark of Boolean Formulae


In order to test algorithms and programs it is convenient to have a benchmark of problems of various sizes and origins at one disposal. I collected a number of Boolean formulae that are available hereafter. These formulae come from different sources. Generators for scalable families of formulae are also available as Perl scripts. Translators from other formats to mine are also provided. Contributions to extend this benchmark are welcome.

Contents


Fault Trees

Here follows several fault trees coming from various areas (avionic systems, nuclear industry, ...). These formula are at the Aralia format

baobab1 baobab2 baobab3 cea9601 chinese
das9201 das9202 das9203 das9204 das9205
das9206 das9207 das9208 das9209 das9601
das9701 edf9201 edf9202 edf9203 edf9204
edf9205 edf9206 edfpa14b edfpa14o edfpa14p
edfpa14q edfpa14r edfpa15b edfpa15o edfpa15p
edfpa15q edfpa15r elf9601 ftr10 isp9601
isp9602 isp9603 isp9604 isp9605 isp9606
isp9607 jbd9601 nus9601

The whole benchmark of fault trees as a zip archive: FT.zip.

Sums of Products

Here follows several sums of products. These formula are at the DNF format

The following sums of products are the sums of the minimal cutsets of fault trees.

baobab1 baobab2 baobab3 chinese das9201
das9202 das9205 das9208 edf9205 edfpa15r
ftr10 isp9603 isp9605 isp9606 jbd9601

The following sums of products encode the s,t-paths of reliability networks.

KLY99-10 KLY99-11 KLY99-12 KLY99-13 KLY99-14
KLY99-15 KLY99-16 KLY99-17 KLY99-18 KLY99-19
KLY99-1 KLY99-20 KLY99-21 KLY99-22 KLY99-23
KLY99-24 KLY99-2 KLY99-3 KLY99-4 KLY99-5
KLY99-6 KLY99-7 KLY99-8 KLY99-9

The whole benchmark of sums of products as a zip archive: DNF.zip.

Some useful (Perl) scripts

Generators

bryant86.pl
This command generates the formula Fn = (x1.y1) + ... + (xn.yn) at the Aralia format. This formula has been given by Bryant in order to show the influence of variable ordering on BDD sizes. The Aralia command to set the worst order (x1 < ... < xn < y1 < ... < yn) is generated as well.
Usage: bryant86.pl n
fl-dnf.pl
This command generates a sum of products at random according to the fixed length model: each instance is characterized by four numbers: the number of variables n, the number of products m, the size of the products k and the seed of the random number generator s. Each product is generated independently by first picking k variables out of the n's and then deciding the polarity of each literal (positive and negative polarity have the same probability).
Usage: fl-dnf.pl n m k s
fl-mdnf.pl
This command generates a monotone sum of products at random according to the fixed length model: each instance is characterized by four numbers: the number of variables n, the number of products m, the size of the products k and the seed of the random number generator s. Each product is generated independently by picking k variables out of the n's.
Usage: fl-mdnf.pl n m k s
pigeonhole.pl
This command generates the formula that encodes the Pigeon-Hole problem: how to put p pigeons into h holes in such way that there is at most one pigeon per hole. Usage: pigeonhole.pl p h
queens.pl
This command generates the formula that encodes the n-queens problem: how to put n queens onto a nxn chessboard in such way that there is no two queens attacking each other. Usage: queens.pl n
sliding-kn.pl
This command generates the formula S(k,n,m) over the variables x1,...,xm such that S(k,n,m) is satisfied if and only if there is a window of n consecutive indices in which at least k variables are true. Usage: sliding-kn.pl k n m

Translators

dnf2dag.pl
This command translates a sum of products at the DNF format into a formula at the Aralia format.
Usage: dnf2dag.pl dnf-file

The Aralia format

The Aralia syntax for Boolean equations is as follows.
Variables: [a-zA-Z][a-zA-Z0-9_]*
I.e. any sequence of letters, digits, _, - or . starting with a letter.
Boolean constants: 0 et 1
If x, x1,..., xp are variables and F, F1,...,Fn are formulae, then the following constructs are formulae as well.
Syntax Semantics
-F1 Negation (not F1)
(F1 | ... | Fn) Disjunction (F1 or ... or Fn)
(F1 & ... & Fn) Conjunction (F1 and ... and Fn)
(F1 = ... = Fn) Equivalence (F1 iff ... iff Fn)
(F1 # ... # Fn) Exclusif or (F1 xor ... xor Fn)
(F1 => F2) Implication (F1 implies F2)
(F1 <= F2) Co-implication (F2 implies F1)
(F1 ? F2 : f3) If F1 Then F2 Else f3
@(k,[F1,...,Fn]) k out of F1,...,Fn
#(i,j,[F1,...,Fn]) At least i and at most j out of F1,...,Fn
exists x1,...,xp F1 Existential quantification
forall x1,...,xp F1 Universal Quantification
cofactor l1,...,lp F1 Cofactor, where li=xi or li=-xi (i=1,..,p)
x := F; variable definition (equation)

Example

TOP := (G1 | g2);

G1 := (E1 & E2);

G2 := (E2 & E3);

The DNF Format

The DNF format for sums of products is a very simple format in which everything is declared in advance (in order to allocate data structures before filling them). Here follows an introducing example.

DNF 4 3
VAR 1 a
VAR 2 b
VAR 3 c
VAR 4 d
LAW 1 0.01
PRD 3 1 -2 3
PRD 2 -4 1
PRD 2 -4 2

A description is a sequence of instructions (one per line). A description starts with a header of the form:

DNF #variables #products

Variables are numbered from 1 to #variables. Negative literals are just denoted with negative numbers. It is possible to name to variables through the instruction:

VAR number name

It is possible to associate probabilities to variables through the instruction

LAW number probability

The syntax for products is as follows.

PRD size literal1 ... literalsize

The description ends with the last product declaration (otherwise the various instructions can be given in any order).

The above description encode the sum of products a.-b.c + -d.a + -d.b . The probability 0.01 is associated with a.