Class WcnfParser
- Namespace
- LogicalOptimizer
- Assembly
- LogicalOptimizer.Formats.dll
Streaming parser for the WCNF (weighted partial MaxSAT) format. Two dialects are accepted, the classic one first and by default:
-
Classic — a
p wcnf <nvars> <nclauses> <top>header (the trailingtopis optional; when absent every clause is soft), then one<weight> <lit...> 0clause per record (records may span lines). A clause whose weight equalstopis hard. -
New-style (MaxSAT Evaluation 2022+) — no
pline; one clause per line, a leadinghmarking a hard clause and a leading positive integer marking a soft clause of that weight. A trailing0is tolerated but not required.topis synthesized as (Σ soft weights)+1 so the writer can round-trip through the classic form.
c comment lines are ignored. Reads line by line and never materializes the whole
input; budget/variable overruns raise ComputationBudgetExceededException
and other malformation raises FormatParseException.
public static class WcnfParser
- Inheritance
-
WcnfParser
- Inherited Members
Methods
Parse(TextReader, ResourceBudget?, CancellationToken)
public static WeightedCnfProblem Parse(TextReader reader, ResourceBudget? budget = null, CancellationToken cancellationToken = default)
Parameters
readerTextReaderbudgetResourceBudgetcancellationTokenCancellationToken