ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
CircuitFromMMap.h
Go to the documentation of this file.
1/**
2 * @file CircuitFromMMap.h
3 * @brief Build in-memory circuits from the mmap-backed persistent store.
4 *
5 * Declares two free functions that traverse the memory-mapped circuit
6 * storage starting from a given root UUID and construct the corresponding
7 * in-memory circuit representation. These functions are the primary
8 * bridge between the persistent @c MMappedCircuit and the evaluation
9 * algorithms that operate on @c BooleanCircuit or @c GenericCircuit.
10 */
11#ifndef BOOLEAN_CIRCUIT_FROM_MMAP_H
12#define BOOLEAN_CIRCUIT_FROM_MMAP_H
13
14extern "C" {
15#include "provsql_utils.h"
16}
17
18#include "BooleanCircuit.h"
19#include "GenericCircuit.h"
20
21/**
22 * @brief Build a @c BooleanCircuit from the mmap store rooted at @p token.
23 *
24 * Performs a depth-first traversal of the persistent circuit starting at
25 * @p token, translating each @c gate_type to the corresponding
26 * @c BooleanGate and copying probabilities and info integers.
27 *
28 * On return, @p gate is set to the @c gate_t identifier within the
29 * returned circuit that corresponds to @p token.
30 *
31 * @param token UUID of the root gate.
32 * @param gate Output: @c gate_t of the root within the returned circuit.
33 * @return An in-memory @c BooleanCircuit.
34 */
36
37/**
38 * @brief Build a @c GenericCircuit from the mmap store rooted at @p token.
39 *
40 * Equivalent to @c createGenericCircuit() declared in @c MMappedCircuit.h.
41 * Performs a depth-first traversal and copies all gate metadata
42 * (type, info1/info2, extra strings, probabilities) into the returned
43 * @c GenericCircuit.
44 *
45 * @param token UUID of the root gate.
46 * @return An in-memory @c GenericCircuit.
47 */
49
50#endif /* BOOLEAN_CIRCUIT_FROM_MMAP_H */
Boolean provenance circuit with support for knowledge compilation.
BooleanCircuit getBooleanCircuit(pg_uuid_t token, gate_t &gate)
Build a BooleanCircuit from the mmap store rooted at token.
GenericCircuit getGenericCircuit(pg_uuid_t token)
Build a GenericCircuit from the mmap store rooted at token.
gate_t
Strongly-typed gate identifier.
Definition Circuit.h:48
Semiring-agnostic in-memory provenance circuit.
Boolean circuit for provenance formula evaluation.
In-memory provenance circuit with semiring-generic evaluation.
Core types, constants, and utilities shared across ProvSQL.
UUID structure.