![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
Boolean circuit implementation and evaluation algorithms. More...
#include "BooleanCircuit.h"#include "Circuit.hpp"#include <type_traits>#include <unistd.h>#include <sys/wait.h>#include <math.h>#include <cassert>#include <cstdint>#include <string>#include <fstream>#include <sstream>#include <cstdlib>#include <iostream>#include <random>#include <vector>#include <stack>#include <functional>#include <algorithm>#include <boost/archive/text_oarchive.hpp>#include <boost/archive/text_iarchive.hpp>#include "dDNNFTreeDecompositionBuilder.h"#include "external_tool.h"#include "ToolRegistry.h"#include "kcmcp_client.h"#include "provsql_utils.h"#include "utils/elog.h"#include "miscadmin.h"#include "provsql_error.h"#include "scoped_tempdir.h"
Go to the source code of this file.
Classes | |
| class | ScopedTempDir |
| RAII guard around a freshly mkdtemp'd /tmp directory. More... | |
Functions | |
| static std::string | selectTool (const std::string &operation, const std::string &preferred="") |
| static std::string | chooseCompiler () |
| static constexpr bool | almost_equals (double a, double b) |
| Check whether two double values are approximately equal. | |
Variables | |
| static const size_t | kSieveMaxClauses = 24 |
| Largest clause count for which the 2^m sieve enumeration is admitted. | |
Boolean circuit implementation and evaluation algorithms.
Implements the methods declared in BooleanCircuit.h, including:
addGate, setGate, setInfo, setProb).compilation() (external tools), interpretAsDD() (direct from circuit structure), makeDD() (dispatcher).rewriteMultivaluedGates(): replaces MULVAR/MULIN clusters with standard AND/OR/NOT circuits.TseytinCNF(): DIMACS/weighted CNF generation for model counters.exportCircuit(): serialisation in the tdkc text format.toString(): human-readable gate description.In the standalone tdkc build (when TDKC is defined) a lightweight elog() stub replaces the PostgreSQL error-reporting function.
Definition in file BooleanCircuit.cpp.
|
staticconstexpr |
Check whether two double values are approximately equal.
| a | First value. |
| b | Second value. |
true if a and b differ by less than 10× machine epsilon. Definition at line 1953 of file BooleanCircuit.cpp.

|
static |
Definition at line 1214 of file BooleanCircuit.cpp.


|
static |
Definition at line 1193 of file BooleanCircuit.cpp.


|
static |
Largest clause count for which the 2^m sieve enumeration is admitted.
Definition at line 716 of file BooleanCircuit.cpp.