15#if PG_VERSION_NUM >= 160000
18#include "catalog/pg_type.h"
19#include "utils/uuid.h"
49 pg_uuid_t *token = DatumGetUUIDP(PG_GETARG_DATUM(0));
52 if(!PG_ARGISNULL(1)) {
53 text *t = PG_GETARG_TEXT_P(1);
54 compiler = string(VARDATA(t), VARSIZE(t)-VARHDRSZ);
67 if(compiler ==
"inversion-free") {
75 string dot = d.
toDot();
77 text *result = (text *) palloc(VARHDRSZ + dot.size());
78 SET_VARSIZE(result, VARHDRSZ + dot.size());
79 memcpy((
void *) VARDATA(result), dot.c_str(), dot.size());
80 PG_RETURN_TEXT_P(result);
81 }
catch(
const std::exception &e) {
Boolean provenance circuit with support for knowledge compilation.
BooleanCircuit getBooleanCircuit(GenericCircuit &gc, pg_uuid_t token, gate_t &gate, std::unordered_map< gate_t, gate_t > &gc_to_bc)
Build a BooleanCircuit from an already-loaded GenericCircuit.
Build in-memory circuits from the mmap-backed persistent store.
dDNNF buildInversionFreeDDNNF(pg_uuid_t token)
Compile a query certified inversion-free to its structured d-DNNF.
gate_t
Strongly-typed gate identifier.
Fix gettext macro conflicts between PostgreSQL and the C++ STL.
Boolean circuit for provenance formula evaluation.
void rewriteMultivaluedGates()
Rewrite all MULVAR/MULIN gate clusters into standard AND/OR/NOT circuits.
dDNNF makeDDByName(gate_t g, const std::string &name) const
Build a dDNNF from a single compiler/route name.
A d-DNNF circuit supporting exact probabilistic and game-theoretic evaluation.
std::string toDot() const
Return a GraphViz DOT representation of the d-DNNF.
Datum compile_to_ddnnf_dot(PG_FUNCTION_ARGS)
PostgreSQL-callable entry point.
Decomposable Deterministic Negation Normal Form circuit.
#define provsql_error(fmt,...)
Report a fatal ProvSQL error and abort the current transaction.
Shared-memory segment and inter-process pipe management.
Core types, constants, and utilities shared across ProvSQL.
C++ utility functions for UUID manipulation.