42#ifndef REACHABILITY_COMPILER_H
43#define REACHABILITY_COMPILER_H
66 :
std::runtime_error(what) {
205 unsigned long source,
206 unsigned long target,
232 unsigned long source,
253 const std::vector<SourceArc> &sources,
278 unsigned long source,
297 const std::vector<SourceArc> &sources,
326 const std::vector<SourceArc> &sources,
327 const std::vector<unsigned long> &set,
353 const std::vector<EdgeRow> &rows,
354 const std::vector<SourceArc> &sources,
355 const std::vector<std::vector<unsigned long> > &sets,
387 const std::vector<SourceArc> &sources,
388 const std::vector<unsigned long> &set,
398 const std::vector<EdgeRow> &rows,
399 const std::vector<SourceArc> &sources,
400 const std::vector<std::vector<unsigned long> > &sets,
gate_t
Strongly-typed gate identifier.
Tree decomposition of a Boolean circuit for knowledge compilation.
ReachabilityCompilerException(const std::string &what)
Construct with a human-readable message.
Compiles s-t reachability over a probabilistic edge relation into a d-D, along a tree decomposition o...
static AllHopsResult compileAllHops(const std::vector< EdgeRow > &rows, unsigned long source, bool directed, unsigned hop_bound, std::size_t max_states=DEFAULT_MAX_STATES)
Bounded-hop variant of compileAll(): per-(vertex, exact walk length) circuits for every length up to ...
static Result compile(const std::vector< EdgeRow > &rows, unsigned long source, unsigned long target, bool directed, std::size_t max_states=DEFAULT_MAX_STATES)
Compile s-t reachability over rows into a d-D.
static constexpr unsigned MAX_HOP_BOUND
Maximum supported hop bound for compileAllHops().
static Result compileCoverReach(const std::vector< EdgeRow > &rows, const std::vector< SourceArc > &sources, const std::vector< unsigned long > &set, bool directed, std::size_t max_states=DEFAULT_MAX_STATES)
Compile "every vertex of @p set is reachable" (k-terminal / coverage reachability) into one certified...
static Result compileAnyReach(const std::vector< EdgeRow > &rows, const std::vector< SourceArc > &sources, const std::vector< unsigned long > &set, bool directed, std::size_t max_states=DEFAULT_MAX_STATES)
Compile "some vertex of @p set is reachable" into one certified circuit.
static constexpr std::size_t DEFAULT_MAX_STATES
Default bound on the number of DP states at a single decomposition node.
static AnyReachAllResult compileAnyReachAll(const std::vector< EdgeRow > &rows, const std::vector< SourceArc > &sources, const std::vector< std::vector< unsigned long > > &sets, bool directed, std::size_t max_states=DEFAULT_MAX_STATES)
Multi-set variant of compileAnyReach(): one shared circuit, one root per target set.
static AnyReachAllResult compileCoverReachAll(const std::vector< EdgeRow > &rows, const std::vector< SourceArc > &sources, const std::vector< std::vector< unsigned long > > &sets, bool directed, std::size_t max_states=DEFAULT_MAX_STATES)
Multi-set variant of compileCoverReach(): one shared (content-deduplicated) circuit,...
static AllResult compileAll(const std::vector< EdgeRow > &rows, unsigned long source, bool directed, std::size_t max_states=DEFAULT_MAX_STATES)
Compile the reachability circuits of every vertex in one pass.
A d-DNNF circuit supporting exact probabilistic and game-theoretic evaluation.
Decomposable Deterministic Negation Normal Form circuit.
A bounded-hop all-targets compilation.
std::vector< VertexHopRoot > roots
Per (vertex, exact length) roots.
std::vector< VertexRoot > within_roots
Per-vertex "within the bound" roots.
Stats stats
Compilation statistics.
An all-targets compilation: one shared d-D, one root per reachable vertex.
std::vector< VertexRoot > roots
One entry per vertex reachable in the all-edges-present world (including the source itself,...
Stats stats
Compilation statistics.
dDNNF dd
Shared circuit (gates are reused across vertices).
A multi-set any-reach compilation: one shared circuit, one root per target set.
dDNNF dd
Shared circuit (consed: identical subcircuits are the same gate).
Stats stats
Compilation statistics (max_states maxed over the sweeps).
std::vector< gate_t > roots
One root per input set, in input order.
One row of the edge relation.
std::string token
Provenance token (UUID) of the edge tuple.
std::string block_key
Block-independent (BID) key variable (UUID) when the tuple is a mulinput alternative (e....
unsigned long src
Source vertex ID.
unsigned long dst
Destination vertex ID.
double prob
Probability of the edge tuple.
unsigned block_index
Outcome index within the block (the mulinput gate's info).
A compiled reachability query: the d-D and its statistics.
Stats stats
Compilation statistics.
dDNNF dd
d-D whose root computes "t is reachable from s"; input gates carry the edge tokens (UUID) and probabi...
One source of a multi-source compilation.
bool certain
Always-present source (no gating variable).
std::string token
Provenance token of the source tuple (unused when certain).
double prob
Source-tuple probability (unused when certain).
unsigned long vertex
Source vertex.
Structural statistics of a compilation, for diagnostics and tests.
std::size_t nb_gates
Number of gates of the emitted d-D.
std::size_t nb_bags
Number of bags of the decomposition.
std::size_t max_states
Maximum number of DP states at any node.
std::size_t nb_variables
Number of edge variables (provenance tokens).
unsigned data_treewidth
Treewidth of the min-fill decomposition of the data graph.
One (vertex, walk length) circuit of a bounded-hop compilation.
unsigned hops
Exact walk length (number of edges).
unsigned long vertex
Vertex ID.
gate_t root
Root of "some walk of exactly this many edges connects the source to the vertex".
One vertex's reachability circuit in an all-targets compilation.
gate_t root
Root of "vertex is reachable from the source" in the shared d-D.
unsigned long vertex
Vertex ID.