boolstuff(3)boolstuff(3)NAMEboolstuff - Disjunctive Normal Form boolean expression C++ library
SYNOPSIS
g++ prog.cpp -lboolstuff
DESCRIPTIONboolstuff is a C++ library that contains an algorithm to convert a
boolean expression binary tree into the Disjunctive Normal Form. The
NOT operator is supported. A C API covers most of the library's func‐
tionality.
The Disjunctive Normal Form is an ORing of ANDed terms. In other
words, if the OR is considered an additive operation and the AND a mul‐
tiplicative operation, then the DNF is a sum of products.
For example, the DNF of the expression a&(b|c) is a&b|a&c
The DNF eliminates parentheses and provides a normalized form of the
original expression. This normalized form is easier to execute.
The DNF produced by BoolStuff is devoid of any "useless" terms, which
are always false (e.g., x&y&!x), but the terms that form the DNF are
not necessarily simplified (e.g., x&y&x). When executing an expression
in DNF, it is recommended to obtain the list of terms and then to
obtain the set of variables used in each term. In the case of the term
x&y&x, the set will only contain x once.
EXAMPLES
The library's source archive comes with an example program (in the
'examples' subdirectory) and with two testing programs (in the
src/boolstuff subdirectory).
LICENSE
This program is free software; you may redistribute it under the terms
of the GNU General Public License. This program has absolutely no war‐
ranty.
AUTHOR
Pierre Sarrazin
See the BoolStuff Home Page:
http://sarrazip.com/dev/boolstuff.html
Comments are welcome.
BUGS
Version 0.1.x is an unstable development version. The programming
interface of the library and the command-line options of the accompany‐
ing commands are not necessarily fixed. The documentation has not been
reviewed for completeness.
HISTORY
George Boole (1815-1864) is an English mathematician who helped estab‐
lish modern symbolic logic and whose algebra of logic, now called Bool‐
ean algebra, is basic to the design of digital computer circuits.
February 14th, 2010 boolstuff(3)