CAL  3.0.0
An External Memory Decision Diagram Library
Getting started

Dependencies

One needs a C++ compiler of ones choice that supports both the C and C++ 11 standard, such as the GNU, Clang, and MSVC compilers. The entire project is built with CMake.

Furthermore, to create the documentation files, you need the Doxygen tool.

To install all of the above then run the respective command below.

Operating System Shell command
Ubuntu 22+ apt install cmake g++ doxygen
Fedora 36+ dnf install cmake gcc-c++ doxygen

Building with CMake

To get started with CAL, you need to place the repository somewhere on your machine. The simplest way to do so is to add it as a submodule inside of your Git repository.

git submodule add https://github.com/SSoelvsten/cal external/cal
git submodule update --init --recursive

Then include the following line in your project's CMakeLists.txt.

add_subdirectory (external/cal cal)

Finally, every single executable target is linked to CAL in the CMakeLists.txt file with the following lines.

add_executable(<target> <source>)
target_link_libraries(<target> cal)

Usage

After having linked the C++ source file with CAL as described above, one can either use CAL through a C and a C++ API.

C API

The original C API from the 90s can be found in the <cal.h> header file.

#include <cal.h>
int main()
{
Cal_BddManager bddManager = Cal_BddManagerInit();
// Do your stuff here...
Cal_BddManagerQuit(bddManager);
}
EXTERN Cal_BddManager Cal_BddManagerInit()
Creates and initializes a new BDD manager.
EXTERN int Cal_BddManagerQuit(Cal_BddManager bddManager)
Frees the BDD manager and all the associated allocations.

See the C API module for all functions.

C++ API

The C++ header-only interface provides a zero-overhead wrapper for CAL in <calObj.hh>. This is in many ways very similar to the C++ API of CUDD.

#include <adiar/adiar.h>
int main()
{
Cal();
// do your stuff here...
}
Core Manager of everything BDDs, variables, and more.
Definition: calObj.hh:823

See the C++ API module for all functions

Warning
All BDD objects have to be destructed (i.e. go out of a scope) before their associated Cal object is destructed itself.