[Close window]

(b2c) boolean to constraints

b2c is a simple Win32 utility that converts boolean constraints to binary linear constraints; this constraint formulation is more suitable to integer linear programming solvers (CPLEX and others).

Command line arguments

------------------------------------------------------------------
Usage: b2c [-v ] [-e ] [-h]

 -v        number auxiliary vars from 
 -e        parse these boolean expressions
                (if -e is missing, reads from stdin)
 -h             shows this help message

This small utility converts a set of boolean
expressions into binary variable constraints
suitable to an ILP solver.

Accepted symbols:
variable=x or=| and=& xor=^
parentheses=( ) constraint-separator=;

Newlines and filling spaces/tabs are ignored.
------------------------------------------------------------------

Usage example

Developing and compilation details

This utility was built on Windows XP, using the MSYS+MinGW+UnxUtils packages to obtain a Unix-like environment. Executable is for Win32 platforms, but sources and makefile should compile straight under standard Unix/Linux systems (any feedback will be appreciated, thanks in advance).

Sources weren't commented, so some effort is needed to understand them. Spreading modified versions is of course freely allowed, but then please cite this website (http://andrear.altervista.org) as the original program repository. Have fun experimenting.

Download