ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
TreeDecompositionKnowledgeCompiler.cpp File Reference

Standalone tdkc tool: tree-decomposition-based knowledge compiler. More...

#include <iostream>
#include <fstream>
#include <iomanip>
#include <sys/time.h>
#include "dDNNFTreeDecompositionBuilder.h"
#include "Circuit.hpp"
Include dependency graph for TreeDecompositionKnowledgeCompiler.cpp:

Go to the source code of this file.

Functions

static double get_timestamp ()
 Return the current time as a floating-point number of seconds.
 
int main (int argc, char **argv)
 Entry point for the standalone tree-decomposition knowledge compiler.
 

Detailed Description

Standalone tdkc tool: tree-decomposition-based knowledge compiler.

This file contains the main() entry point for the standalone tdkc (Tree-Decomposition Knowledge Compiler) binary. It is built separately from the PostgreSQL extension (see Makefile target tdkc).

Usage:

tdkc <circuit_file>

The circuit file is a text file produced by BooleanCircuit::exportCircuit() listing the number of gates followed by one line per gate describing its type, probability, and children.

The tool:

  1. Reads the circuit from the file.
  2. Rewrites multivalued gates.
  3. Computes a tree decomposition.
  4. Builds a d-DNNF via dDNNFTreeDecompositionBuilder.
  5. Evaluates the probability and prints it to stdout.

Timing information is printed to stderr.

Definition in file TreeDecompositionKnowledgeCompiler.cpp.

Function Documentation

◆ get_timestamp()

static double get_timestamp ( )
static

Return the current time as a floating-point number of seconds.

Returns
Current time (seconds since the epoch, with microsecond precision).

Definition at line 42 of file TreeDecompositionKnowledgeCompiler.cpp.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

Entry point for the standalone tree-decomposition knowledge compiler.

Parameters
argcArgument count; must be 2.
argvArgument vector; argv[1] is the path to the circuit file.
Returns
0 on success, non-zero on error.

Definition at line 55 of file TreeDecompositionKnowledgeCompiler.cpp.

Here is the call graph for this function: