![]() |
ProvSQL C/C++ API
Adding support for provenance and uncertainty management to PostgreSQL databases
|
One registered external tool. More...
#include "ToolRegistry.h"
Public Member Functions | |
| bool | hasOperation (const std::string &op) const |
| bool | acceptsInput (const std::string &fmt) const |
| std::string | buildCommand (const std::string &in, const std::string &out, const std::string &binary_override, const std::vector< std::pair< std::string, std::string > > &extra={}) const |
| Build the command line for this tool. | |
Public Attributes | |
| std::string | name |
| std::string | kind |
"cli" (spawn a binary) or "kcmcp" (talk to a socket server at endpoint). | |
| std::string | binary |
| std::vector< std::string > | operations |
| std::vector< std::string > | input_formats |
| std::string | output_format |
| std::string | parser |
| int | preference = 0 |
| bool | enabled = true |
| std::vector< std::string > | dependencies |
| std::string | argtpl |
| std::string | argtpl_circuit |
| std::string | endpoint |
| KCMCP server address for kind "kcmcp": "unix:/path" or "host:port". | |
One registered external tool.
name is the logical id used by the dispatchers and the provsql.fallback_compiler GUC (e.g. "d4"). binary is the executable resolved through find_external_tool; it defaults to name but may be repointed (e.g. an absolute path to a specific build) without changing the logical id. Distinct logical ids may share one binary: the three panini-* compiler variants all run "panini" with a different --lang. operations advertises what the tool can do: "compile" (knowledge compilation to a d-DNNF / NNF the compilation() parser reads), "wmc" (weighted model counting), or "render" (DOT visualisation); a record with no operation would be unselectable, so every record advertises at least one. preference orders candidates within an operation (higher first); enabled lets an admin keep a record but stop the dispatchers from selecting it.
dependencies lists extra executables the tool needs at run time beyond binary: sharpsat-td needs flow_cutter_pace17, and dpmc is a two-binary pipeline (htb | dmc) with an empty binary and dependencies = {htb, dmc}. A tool is "available" iff binary (when non-empty) and every dependency resolve on PATH.
The capability triple operations / input_formats / output_format uses the KCMCP shared registry names (see doc/source/dev/kc-server-protocol.rst), so a CLI record and a future kind="kcmcp" server record are directly comparable: operations is "compile" / "wmc" (the ProvSQL-local "render" has no KCMCP counterpart); input_formats is drawn from "dimacs-cnf" / "circuit-bcs12"; output_format from "ddnnf-nnf" / "decimal" / "rational" (with ProvSQL-local "panini-dd" / "ascii" where KCMCP has no code). A KCMCP server discovers this triple at the handshake; a CLI tool declares it here.
parser is CLI-only – it says how to decode this tool's raw output into output_format, a job a KCMCP server does on the wire and so leaves empty: the single tolerant "nnf" reader yields output_format "ddnnf-nnf" (it auto-detects the c2d/d4 magic header, covering both the d4-family and classic forms); "wmc-line" (the "c s exact" line) and "weightmc" (mantissa x 2^e) both yield "decimal"; "panini-dd" and "ascii" are their own.
argtpl is the command the dispatcher runs, with {in} / {out} substituted by the input/output temp files and a few tool-specific placeholders ({binary}, {tmpdir}, {pivotAC}). When argtpl contains no {binary}, the resolved binary is prepended; otherwise the template is the whole command (used by the dpmc pipeline and the sharpsat-td cd-prefix). argtpl_circuit is the alternative command used when the "circuit-bcs12" input is selected (the input is then a BC-S1.2 circuit rather than a Tseytin CNF); only a tool that accepts that input needs it. Together these make a CLI tool's whole invocation data: a new tool whose output is a known parser/format can be registered without recompiling.
Definition at line 136 of file ToolRegistry.h.
| bool provsql::ToolRecord::acceptsInput | ( | const std::string & | fmt | ) | const |
| std::string provsql::ToolRecord::buildCommand | ( | const std::string & | in, |
| const std::string & | out, | ||
| const std::string & | binary_override, | ||
| const std::vector< std::pair< std::string, std::string > > & | extra = {} ) const |
Build the command line for this tool.
Expands {in} / {out} (and extra placeholders, e.g. {tmpdir}, {pivotAC}) in argtpl. binary_override is the executable to use (the registry-resolved binary, possibly repointed); when argtpl references {binary} it is substituted inline, otherwise a non-empty binary is prepended.
Definition at line 28 of file ToolRegistry.cpp.


| bool provsql::ToolRecord::hasOperation | ( | const std::string & | op | ) | const |
| std::string provsql::ToolRecord::argtpl |
Definition at line 148 of file ToolRegistry.h.
| std::string provsql::ToolRecord::argtpl_circuit |
Definition at line 149 of file ToolRegistry.h.
| std::string provsql::ToolRecord::binary |
Definition at line 140 of file ToolRegistry.h.
| std::vector<std::string> provsql::ToolRecord::dependencies |
Definition at line 147 of file ToolRegistry.h.
| bool provsql::ToolRecord::enabled = true |
Definition at line 146 of file ToolRegistry.h.
| std::string provsql::ToolRecord::endpoint |
KCMCP server address for kind "kcmcp": "unix:/path" or "host:port".
Definition at line 150 of file ToolRegistry.h.
| std::vector<std::string> provsql::ToolRecord::input_formats |
Definition at line 142 of file ToolRegistry.h.
| std::string provsql::ToolRecord::kind |
"cli" (spawn a binary) or "kcmcp" (talk to a socket server at endpoint).
Definition at line 138 of file ToolRegistry.h.
| std::string provsql::ToolRecord::name |
Definition at line 137 of file ToolRegistry.h.
| std::vector<std::string> provsql::ToolRecord::operations |
Definition at line 141 of file ToolRegistry.h.
| std::string provsql::ToolRecord::output_format |
Definition at line 143 of file ToolRegistry.h.
| std::string provsql::ToolRecord::parser |
Definition at line 144 of file ToolRegistry.h.
| int provsql::ToolRecord::preference = 0 |
Definition at line 145 of file ToolRegistry.h.