Class KnowledgeCompilation
- Namespace
- LogicalOptimizer
- Assembly
- LogicalOptimizer.Dnnf.dll
Knowledge compilation entry point: turn a boolean formula into a d-DNNF circuit that answers model-counting and enumeration queries in time linear in the circuit size.
public static class KnowledgeCompilation
- Inheritance
-
KnowledgeCompilation
- Inherited Members
Fields
DefaultNodeBudget
Default node budget for CompileToDnnf(AstNode, int, CancellationToken).
public const int DefaultNodeBudget = 1000000
Field Value
Methods
CompileToDnnf(AstNode, int, CancellationToken)
Compile formula into a DnnfCircuit using a top-down
decision-DNNF compiler with component caching. Compilation can blow up on hard CNF, so
nodeBudget caps the DAG size (an InvalidOperationException
is thrown when it is exceeded) and cancellationToken interrupts a
long compile. Both are heuristic safety limits, not guarantees of tractability.
public static DnnfCircuit CompileToDnnf(AstNode formula, int nodeBudget = 1000000, CancellationToken cancellationToken = default)
Parameters
formulaAstNodeThe formula to compile.
nodeBudgetintMaximum number of DAG nodes before compilation aborts.
cancellationTokenCancellationTokenCancels a long-running compilation.
Returns
Exceptions
- InvalidOperationException
The node budget was exceeded.
- OperationCanceledException
The token was cancelled.