ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
Loading...
Searching...
No Matches
provsql::MethodCatalog Class Reference

Registry of ProbabilityMethod objects. More...

#include "ProbabilityMethod.h"

Public Member Functions

void registerMethod (std::unique_ptr< ProbabilityMethod > m)
const ProbabilityMethodbyName (const std::string &name) const
 Exact match on name(); nullptr if absent.
double chooseAndRun (EvalContext &ctx, const Tolerance &tol) const
 Run the auto-chooser for tol: the portfolio methods admissible for the tolerance and applicable, sorted cheapest-first by estimatedCost and tried until one succeeds.
dDNNF chooseAndBuildDD (EvalContext &ctx, const Tolerance &tol) const
 The d-DNNF analogue of chooseAndRun: cost-select among the producesDD() portfolio (interpret-as-dd / tree-decomposition / compilation) with the same uniform-cost search and speculative budget, and return the chosen d-DNNF artifact (rather than a probability).

Static Public Member Functions

static const MethodCataloginstance ()
 The process-wide catalog, lazily populated with the built-in methods.

Private Attributes

std::vector< std::unique_ptr< ProbabilityMethod > > methods_

Detailed Description

Registry of ProbabilityMethod objects.

Mirrors the external-tool registry: adding a method is a new subclass plus one registerMethod call – the dispatcher never changes (open/closed).

Definition at line 176 of file ProbabilityMethod.h.

Member Function Documentation

◆ byName()

const ProbabilityMethod * provsql::MethodCatalog::byName ( const std::string & name) const

Exact match on name(); nullptr if absent.

Definition at line 1633 of file probability_evaluate.cpp.

Here is the caller graph for this function:

◆ chooseAndBuildDD()

dDNNF provsql::MethodCatalog::chooseAndBuildDD ( EvalContext & ctx,
const Tolerance & tol ) const

The d-DNNF analogue of chooseAndRun: cost-select among the producesDD() portfolio (interpret-as-dd / tree-decomposition / compilation) with the same uniform-cost search and speculative budget, and return the chosen d-DNNF artifact (rather than a probability).

This is the makeDD route optimizer – the same selection the probability chooser makes among these routes, surfaced for the d-D-artifact callers.

Definition at line 1785 of file probability_evaluate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ chooseAndRun()

double provsql::MethodCatalog::chooseAndRun ( EvalContext & ctx,
const Tolerance & tol ) const

Run the auto-chooser for tol: the portfolio methods admissible for the tolerance and applicable, sorted cheapest-first by estimatedCost and tried until one succeeds.

The costliest method's exception propagates (the portfolio is exhausted).

Definition at line 1770 of file probability_evaluate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ instance()

const MethodCatalog & provsql::MethodCatalog::instance ( )
static

The process-wide catalog, lazily populated with the built-in methods.

Definition at line 1800 of file probability_evaluate.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ registerMethod()

void provsql::MethodCatalog::registerMethod ( std::unique_ptr< ProbabilityMethod > m)

Definition at line 1607 of file probability_evaluate.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ methods_

std::vector<std::unique_ptr<ProbabilityMethod> > provsql::MethodCatalog::methods_
private

Definition at line 201 of file ProbabilityMethod.h.


The documentation for this class was generated from the following files: