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

Semiring-agnostic in-memory provenance circuit. More...

#include <map>
#include <type_traits>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/serialization/unordered_map.hpp>
#include <boost/serialization/map.hpp>
#include <boost/serialization/set.hpp>
#include <boost/serialization/vector.hpp>
#include "Circuit.h"
#include "semiring/Semiring.h"
#include "provsql_utils.h"
Include dependency graph for GenericCircuit.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  GenericCircuit
 In-memory provenance circuit with semiring-generic evaluation. More...
 

Detailed Description

Semiring-agnostic in-memory provenance circuit.

GenericCircuit is an in-memory directed acyclic graph whose gate types use the PostgreSQL gate_type enumeration. It is built from the persistent mmap representation (via createGenericCircuit() / getGenericCircuit()) and then evaluated over an arbitrary semiring using the evaluate() template method.

Beyond the gate/wire data inherited from Circuit<gate_type>, GenericCircuit tracks:

  • Per-gate integer annotation pairs (info1, info2) used by aggregation and semimodule gates.
  • Per-gate variable-length string extras (e.g. label strings for gate_value gates).
  • A probability vector for probabilistic evaluation.
  • The set of input gate IDs (for semiring evaluation traversal).

The circuit is Boost-serialisable, which is used when sending it as a blob to an external knowledge-compiler process.

Definition in file GenericCircuit.h.