This repository includes the code and data to reproduce the experimental results in the paper "Variance Computation for Weighted Model Counting with Knowledge Compliation Approach", which is accepted for AAAI 2026. The full version of this paper will be announced upon publication on arXiv.
All codes are written in C++. If your environment has C++ compiler that supports (at least) C++11 features and CMake version >=3.8, you can build all binaries with the following commands:
mkdir release
cd release
cmake -DCMAKE_BUILD_TYPE=Release ..
makeAfter that, all binaries are generated at release/.
All data used in the experiments are found in data.tar.gz.
By inflating this archive, data/ directory appears.
The original Bayesian network descriptions are found in data/net/, which were retrieved from bnRep repository.
Each network was converted into a CNF representing the encoded Boolean function by Ace version 3.0.
We used -encodeOnly -noEclause -sbk05 options for Ace to ensure that the used encoding is ENC2 proposed by Sang, Beame, and Kautz (2005).
All CNF files are included in data/cnf/, along with lmap files that describes the correspondence between the parameters and variables of Bayesian networks and the Boolean variables in the Boolean function.
Every CNF file was compiled with SDD package with no specific options other than specifying the output files.
All SDD and vtree files are included in data/sdd/.
The mean and variance of the weights of variables are stored in data/params/, which were converted from lmap files in data/cnf/ with the enc2lmap program included in this repository.
The usage of enc2lmap is described later.
Variance computation can be executed by the following command:
./main [vtree_file] [sdd_file] [parameter_file][vtree_file], [sdd_file], and [parameter_file] specify the path to the file describing vtree, SDD, and parameters.
After execution, the expectation and variance of WMC of the Boolean function represented by [sdd_file] is computed.
Example: To measure the computational time using projectmanagement network, run:
./main ../data/sdd/projectmanagement.net.cnf.vtree ../data/sdd/projectmanagement.net.cnf.sdd ../data/params/projectmanagement.net.cnf.paramNote that the variable used as a partial assignment for every network is recorded in data/partialassignment.csv.
The parameter files for this experiment are stored in data/params/showcase/ directory.
For algalactivity2 network, the parameter file for the variance computation of data/params/showcase/algalactivity2.net.cnf.param.<k>.
Note that there are only 40 parameter files out of 43 parameters for the algalactivity2 network because 3 parameters have value either 0 or 1 and thus they have zero variance.
For blockchain network, the parameter file for data/params/showcase/blockchain.net.cnf.param.<k>.
For projectmanagement network, the parameter file for data/params/showcase/projectmanagement.net.cnf.O2.param.<k> and that for data/params/showcase/projectmanagement.net.cnf.O4.param.<k>.
The variance of the marginal where the k-th parameter's variance becomes one tenth can be computed by the same command.
./main [vtree_file] [sdd_file] [parameter_file]Example: To compute the variance of algalactivity2 network becomes one tenth, run:
./main ../data/sdd/algalactivity2.net.cnf.vtree ../data/sdd/algalactivity2.net.cnf.sdd ../data/params/showcase/algalactivity2.net.cnf.param.7Note that the descriptions for parameter values is recorded in [network_name]-parammap.csv.
The enc2lmap is the program for converting an lmap file to a parameter file.
The usage is as follows:
./main [lmap_file] [theta_value] [evidence_name] <k>[lmap_file] specifies the path to the input lmap file.
[theta_value] is the parameter [evidence_name] specifies the name of the evidence random variable.
<k> is an optional argument that set the k-th parameter's variance one tenth.
This software is released under the NTT license; see LICENSE.pdf.