![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
SQL function provsql.probability_evaluate() – probabilistic circuit evaluation.
More...
#include "postgres.h"#include "fmgr.h"#include "catalog/pg_type.h"#include "utils/uuid.h"#include "executor/spi.h"#include "provsql_shmem.h"#include "provsql_utils.h"#include "c_cpp_compatibility.h"#include <set>#include <cmath>#include <csignal>#include "BooleanCircuit.h"#include "CircuitFromMMap.h"#include "GenericCircuit.h"#include "dDNNFTreeDecompositionBuilder.h"#include "having_semantics.hpp"#include "provsql_mmap.h"#include "provsql_utils_cpp.h"#include "semiring/BoolExpr.h"
Go to the source code of this file.
Functions | |
| static void | provsql_sigint_handler (int) |
| SIGINT handler that sets the global interrupted flag. | |
| static Datum | probability_evaluate_internal (pg_uuid_t token, const string &method, const string &args) |
| Core implementation of probability evaluation for a circuit token. | |
| Datum | probability_evaluate (PG_FUNCTION_ARGS) |
| PostgreSQL-callable wrapper for probability_evaluate(). | |
SQL function provsql.probability_evaluate() – probabilistic circuit evaluation.
Implements provsql.probability_evaluate(), which computes the probability that a provenance circuit evaluates to true under the tuple-independent probabilistic-database model.
The method argument selects the computation algorithm:
"possible-worlds": exact enumeration of all 2^n worlds."monte-carlo": approximate via random sampling (fast, inexact)."weightmc": approximate using the weightmc model counter."tree-decomposition": exact via tree-decomposition-based d-DNNF."independent": exact evaluation for disconnected circuits."d4", "c2d", "minic2d", "dsharp").A SIGINT signal sets a process-local flag that causes the evaluation to abort and return NULL (used when the user cancels a long-running probability computation).
Definition in file probability_evaluate.cpp.
| Datum probability_evaluate | ( | PG_FUNCTION_ARGS | ) |
PostgreSQL-callable wrapper for probability_evaluate().
Definition at line 146 of file probability_evaluate.cpp.

|
static |
Core implementation of probability evaluation for a circuit token.
| token | UUID of the root provenance gate. |
| method | Evaluation method name (e.g. "independent", "monte-carlo"). |
| args | Additional arguments for the chosen method. |
Definition at line 67 of file probability_evaluate.cpp.


|
static |
SIGINT handler that sets the global interrupted flag.
The signal number argument is required by the signal() API but is not used.
Definition at line 55 of file probability_evaluate.cpp.
