46 gettimeofday (&now, NULL);
47 return now.tv_usec * 1e-6 + now.tv_sec;
56int main(
int argc,
char **argv) {
59 if(argc == 3 && std::string(argv[1]) ==
"--kcmcp")
63 std::cerr <<
"Usage: " << argv[0] <<
" circuit\n"
65 <<
" --kcmcp unix:/path|host:port (KCMCP reference server)"
70 std::ifstream g(argv[1]);
78 for(
unsigned i=0; i<nbGates; ++i) {
79 std::getline(g, line);
89 std::cerr <<
"Wrong line type: " << line << std::endl;
104 std::cerr <<
"Treewidth: " << td.
getTreewidth() << std::endl;
106 std::cerr <<
"Computing tree decomposition took " << (t1-t0) <<
"s" << std::endl;
111 std::cerr <<
"Computing dDNNF took " << (t1-t0) <<
"s" << std::endl;
114 std::cerr <<
"Probability: " << std::setprecision (15) << dnnf.probabilityEvaluation() << std::endl;
116 std::cerr <<
"Evaluating dDNNF took " << (t1-t0) <<
"s" << std::endl;
@ NOT
Logical negation of a single child gate.
@ OR
Logical disjunction of child gates.
@ AND
Logical conjunction of child gates.
@ IN
Input (variable) gate representing a base tuple.
gate_t
Strongly-typed gate identifier.
Out-of-line template method implementations for Circuit<gateType>.
int main(int argc, char **argv)
Entry point for the standalone tree-decomposition knowledge compiler.
static double get_timestamp()
Return the current time as a floating-point number of seconds.
Boolean circuit for provenance formula evaluation.
gate_t setGate(BooleanGate type) override
Allocate a new gate with type type and no UUID.
void addWire(gate_t f, gate_t t)
Add a directed wire from gate f (parent) to gate t (child).
gate_t getGate(const uuid &u)
Return (or create) the gate associated with UUID u.
Exception thrown when a tree decomposition cannot be constructed.
Tree decomposition of a Boolean circuit's primal graph.
unsigned getTreewidth() const
Return the treewidth of this decomposition.
static constexpr int MAX_TREEWIDTH
Maximum supported treewidth.
Builds a d-DNNF from a Boolean circuit using a tree decomposition.
dDNNF && build() &&
Execute the compilation and return the resulting d-DNNF.
Constructs a d-DNNF from a Boolean circuit and its tree decomposition.
int kcmcp_serve(const std::string &endpoint)
Serve KCMCP on endpoint until terminated.
The tdkc KCMCP reference server.