BoolTool - the Boolean function manipulation tool



Valid HTML 4.01 Transitional


System requirements:

Supported input formats: PLA (only the on-set is used), pseudo-VHDL and DIMACS (cnf only)

Supported output formats: PLA, BLIF, VHDL, pseudo-VHDL and DIMACS (cnf only)


Program can be run either interactively or non-interactively, non-interactive usage can by invoked by entering all three input parameters, otherwise interactive usage is invoked.

Command line syntax:

booltool [input] [output] [script]

If name of the input file contains string .pla or .vhdl the file type is recognized automatically

Non-interactive usage:

This way of usage enables performing any script given as parameter and save the result in a PLA format, the script itself contains expressions which determine operations between functions that are supposed to be done.

Syntax of the script is the same as in the VHDL format - commands must be in format id <= V; where id denotes the name of output variable and V denotes any Boolean expression. Multiple output functions can be created this way.

Example of a script:
y4 <= (0 or 1) and 3;
y5 <= 2 xor 3;
y6 <= 4 nand 5;

This script would create new output variables y4, y5 and y6 and would substitute the numbers by functions on positions (in the input file) corresponding to the nubmers (output variable names can also be used instead of numbers).
Results of the operation are saved automatically.
It is not possible to refer to functions that haven't been defined yet, if user does this a warning is displayed.

Note: Input and output variables are numbered from zero

Comprehensive example:

Let us have the following PLA file as an input (source.pla):

.i 4
.o 3
.ilb a b c d
.ob x y z
00-- 100
1-11 100
-11- 010
1--- 001
-10- 001

Such a PLA describes the following set of functions:
x = a'b' + acd
y = bc
z = a + bc'

Next, the following script (script.vhd):

u <= x and y;
v <= x or y;
w <= (y xor z) and x;
not_u <= not u;

By running the command: BoolTool source.pla out.pla script.vhd,
the following PLA (out.pla) is obtained:

.i 4
.o 4
.ilb a b c d
.ob u v w not_u
.p 9
# literals: 19
1111 1000
00-- 0100
-11- 0100
1-11 0100
1011 0010
0--- 0001
-0-- 0001
--0- 0001
---0 0001

Note: Defining the variable names is optional. Instead, the variables can be addressed by their ordinal numbers in the source PLA file (e.g., u <= 0 and 1;).

Interactive usage - available operations:

  1. Negation - negates the entire input
  2. And-Or-Not form - transforms the entire input into form containing only and, or, not operators
  3. CNF - converts input into CNF (automatically minimizes the result)
  4. DNF - converts input into DNF (automatically minimizes the result)
  5. Satisfiability test - runs satisfiability test (produces exact solution)
  6. Nand form - transforms input into form containing only Nand nodes
  7. Nor form - transforms input into form containing only Nor nodes
  8. Add function - adds a new function by combining input functions
  9. Save as PLA - saves results in PLA format
  10. Save as VHDL - saves results in VDHL format
  11. Save as BLIF - saves results in BLIF format
  12. Save as DIMACS - saves results in DIMACS format
  13. Disable/enable absorption - disables/enables absorption (enabled by default)
  14. Compute cofactor - computes cofactor of a function against the selected variable
  15. Exit - exits program

When performing the operation add function it is necessary to enter the input string in form id <= V; where id denotes the name of output variable and V denotes any Boolean expression.

example of usage: y4 <= (0 and 1) xor (2 or 3);

By entering this string a new output variable y4 would be created and numbers 0,1,2,3 would be substituted by functions on positions corresponding to the numbers.

When saving the results is it necessary to choose if all functions or only those newly added have to be saved.