Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 1.01 KB

README.md

File metadata and controls

59 lines (42 loc) · 1.01 KB

boloq

Build Status

BDD/ZDD library to replesent boolean functions using modern C++ features

Getting started

Requirements

  • C++11
  • boost
  • CMake

Install

git clone https://github.com/utisam/boloq.git
cd boloq/build
cmake ..
make -j4 && sudo make install

Sample

#include <array>
#include <iostream>
#include <unordered_set>
#include <boloq.h>
using namespace std;
using namespace boloq;

int main() {
    boolean_function x('x'), y('y');

    array<boolean_function, 4> fns = {{
        ~x | ~y, ~(x & y),
        ~x & ~y, ~(x | y),
    }};

    // equivalence: O(1)
    cout << boolalpha << (fns[0] == fns[1]) << endl; // true

    // hashable
    unordered_set<boolean_function> fn_set(fns.begin(), fns.end());
    cout << fn_set.size() << endl; // 2
    return 0;
}

Develop

cmake -DCMAKE_BUILD_TYPE=Debug ..
make -j4
make test

Documentation

cd src
doxygen