A d-DNNF circuit supporting exact probabilistic and game-theoretic evaluation.
More...
|
| gate_t | getRoot () const |
| | Return the root gate of this d-DNNF.
|
| void | setRoot (gate_t g) |
| | Set the root gate.
|
| std::unordered_set< gate_t > | vars (gate_t root) const |
| | Return the set of all variable (IN) gates reachable from root.
|
| void | makeSmooth () |
| | Make the d-DNNF smooth.
|
| void | makeGatesBinary (BooleanGate type) |
| | Rewrite all n-ary AND/OR gates into binary trees.
|
| void | simplify () |
| | Simplify the d-DNNF by removing redundant constants.
|
| dDNNF | conditionAndSimplify (gate_t var, bool value) const |
| | Condition on variable var having value value and simplify.
|
| dDNNF | condition (gate_t var, bool value) const |
| | Condition on variable var having value value (no simplification).
|
| double | probabilityEvaluation () const |
| | Compute the exact probability of the d-DNNF being true.
|
| double | shapley (gate_t var) const |
| | Compute the Shapley value of input gate var.
|
| double | banzhaf (gate_t var) const |
| | Compute the Banzhaf power index of input gate var.
|
| Stats | nodeStats () const |
| | Compute structural statistics over the gates reachable from root.
|
| std::string | toDot () const |
| | Return a GraphViz DOT representation of the d-DNNF.
|
| std::string | toNNF (const std::function< int(const std::string &)> &var_of_uuid={}) const |
| | Serialise the d-DNNF in the c2d / d4 ".nnf" text format.
|
| bool | isDNNFCertified (gate_t g) const |
| | Is gate g certified by the d-DNNF per-gate marking?
|
| | BooleanCircuit () |
| | Construct an empty Boolean circuit.
|
| virtual | ~BooleanCircuit () |
| gate_t | addGate () override |
| | Allocate a new gate with a default-initialised type.
|
| gate_t | setGate (BooleanGate type) override |
| | Allocate a new gate with type type and no UUID.
|
| gate_t | setGate (const uuid &u, BooleanGate type) override |
| | Create or update the gate associated with UUID u.
|
| gate_t | setGate (BooleanGate t, double p) |
| | Create a new gate with a probability annotation.
|
| gate_t | setGate (const uuid &u, BooleanGate t, double p) |
| | Create (or update) a gate with a UUID and probability.
|
| const std::set< gate_t > & | getInputs () const |
| | Return the set of input (IN) gate IDs.
|
| bool | hasMultivaluedGates () const |
| | Return true if the circuit contains any MULIN gates.
|
| void | setProb (gate_t g, double p) |
| | Set the probability for gate g and mark the circuit as probabilistic.
|
| double | getProb (gate_t g) const |
| | Return the probability stored for gate g.
|
| bool | isProbabilistic () const |
| | Return true if any gate has a non-trivial (< 1) probability.
|
| void | setInfo (gate_t g, unsigned info) |
| | Store an integer annotation on gate g.
|
| unsigned | getInfo (gate_t g) const |
| | Return the integer annotation for gate g.
|
| double | possibleWorlds (gate_t g) const |
| | Compute the probability by exact enumeration of all possible worlds.
|
| dDNNF | compilation (gate_t g, std::string compiler, std::string *resolved=nullptr) const |
| | Compile the sub-circuit rooted at g to a dDNNF via an external tool.
|
| dDNNF | parseDDNNF (std::istream &in, const std::vector< gate_t > &inputOrder) const |
| | Parse a c2d/d4 NNF stream into a dDNNF over this circuit's input gates.
|
| double | monteCarlo (gate_t g, unsigned samples) const |
| | Estimate the probability via Monte Carlo sampling.
|
| bool | dnfShape (gate_t g, std::vector< gate_t > &clauses, std::vector< std::set< gate_t > > &supports) const |
| | Detect the DNF shape the Karp-Luby FPRAS requires.
|
| bool | dnfShapeInfo (gate_t g, std::size_t &num_clauses) const |
| | Cheap shape test: is the circuit DNF-shaped, and how many clauses?
|
| double | karpLuby (const std::vector< gate_t > &clauses, const std::vector< std::set< gate_t > > &supports, unsigned long samples) const |
| | Karp-Luby FPRAS estimate of a DNF-shaped circuit's probability (fixed sample budget, stratified).
|
| double | sieve (const std::vector< gate_t > &clauses, const std::vector< std::set< gate_t > > &supports) const |
| | Exact probability of a monotone DNF by inclusion-exclusion (sieve).
|
| void | dnfBounds (const std::vector< std::set< gate_t > > &clauses, double &lower, double &upper) const |
| | Cheap certified probability interval [lower,upper] of a monotone DNF, without compiling it (Olteanu-Huang-Koch d-tree leaf bound).
|
| double | karpLubyStopping (const std::vector< gate_t > &clauses, const std::vector< std::set< gate_t > > &supports, double eps, double delta, unsigned long max_samples, unsigned long &samples_used, bool &reached_target) const |
| | Karp-Luby FPRAS with the self-adjusting stopping rule (adaptive sample count for a relative (eps,delta) guarantee).
|
| double | wmcCount (gate_t g, const std::string &tool, const std::string &opt) const |
| | Weighted model counting through a registered external counter.
|
| double | independentEvaluation (gate_t g) const |
| | Compute the probability exactly when inputs are independent.
|
| void | rewriteMultivaluedGates () |
| | Rewrite all MULVAR/MULIN gate clusters into standard AND/OR/NOT circuits.
|
| dDNNF | interpretAsDD (gate_t g) const |
| | Build a dDNNF directly from the Boolean circuit's structure.
|
| dDNNF | makeDD (gate_t g, const std::string &method, const std::string &args) const |
| | Dispatch to the appropriate d-DNNF construction method.
|
| dDNNF | makeDDByName (gate_t g, const std::string &name) const |
| | Build a dDNNF from a single compiler/route name.
|
| virtual std::string | toString (gate_t g) const override |
| | Return a textual description of gate g for debugging.
|
| std::string | toString (gate_t g, const std::unordered_map< gate_t, std::string > &labels) const |
| | Render the sub-circuit at g, labelling input gates from a map.
|
| std::string | exportCircuit (gate_t g) const |
| | Export the circuit in the textual format expected by external compilers.
|
| std::string | TseytinCNF (gate_t g, bool display_prob, bool mapping=false) const |
| | Return the Tseytin transformation of the sub-circuit at g as a DIMACS string.
|
| std::vector< CNFInputMapping > | tseytinVariableMapping () const |
| | Map each input gate to its DIMACS variable, UUID, probability.
|
| std::string | BCS12 (gate_t g, std::vector< gate_t > &inputOrder) const |
| | Serialise the sub-circuit at g in d4's BC-S1.2 circuit format.
|
| dDNNF | parsePaniniDD (const std::string &outfilename) const |
| | Parse a Panini (KCBox) DD output file into a ProvSQL d-DNNF.
|
| template<class Archive> |
| void | serialize (Archive &ar, const unsigned int version) |
| | Boost serialisation support.
|
| virtual | ~Circuit () |
| std::vector< gate_t >::size_type | getNbGates () const |
| | Return the total number of gates in the circuit.
|
| gate_t | getGate (const uuid &u) |
| | Return (or create) the gate associated with UUID u.
|
| uuid | getUUID (gate_t g) const |
| | Return the UUID string associated with gate g.
|
| BooleanGate | getGateType (gate_t g) const |
| | Return the type of gate g.
|
| std::vector< gate_t > & | getWires (gate_t g) |
| | Return a mutable reference to the child-wire list of gate g.
|
| virtual gate_t | setGate (const uuid &u, BooleanGate type) |
| | Create or update the gate associated with UUID u.
|
| bool | hasGate (const uuid &u) const |
| | Test whether a gate with UUID u exists.
|
| void | addWire (gate_t f, gate_t t) |
| | Add a directed wire from gate f (parent) to gate t (child).
|
A d-DNNF circuit supporting exact probabilistic and game-theoretic evaluation.
Inherits the full BooleanCircuit structure and adds a root gate and algorithms that exploit the d-DNNF structural properties for efficient computation.
Definition at line 71 of file dDNNF.h.