Documentation

CslibFrontier.Computability.Complexity.FineGrained.MaxSAT

Exact MAX-SAT threshold counts #

An instance declares its number of Boolean variables and lists its clauses. Its score is the number of satisfied clauses, counting repeated clauses with their multiplicity. The compiled circuit has precisely those declared inputs, so every assignment contributes exactly once. No fresh guessed bits or auxiliary-assignment multiplicities enter the threshold count.

The circuit evaluates every clause and compares their population count with the requested cutoff. It has at most 478 * (literal occurrences + clauses + 1) gates. This bound depends on the formula's actual occurrence count: a variable-count bound requires a density hypothesis.

Variable references outside the declared range read false. This convention makes the compiler total; for well-formed instances all references are below the declared variable count. See Cslib.Logic.PL.MaxSAT (CslibFrontier.Logics.Propositional.MaxSAT) for the underlying propositional weighted partial MaxSAT definition, bridged in CslibFrontier.Computability.Complexity.FineGrained.MaxSAT.Histogram.

Main results #

References #

@[reducible, inline]

The declared variable count and the list of clauses.

Unary declared input count followed by the usual binary-indexed formula encoding.

@[reducible, inline]

A threshold query supplies the instance and a unary score cutoff.

Encoding of a complete threshold-count query.

Read an assignment on declared variables; undeclared references default to false.

Number of satisfied clauses, with the original list multiplicities.

Number of assignments satisfying at least the cutoff many clauses.

Structural formula size used in the exponent: literal occurrences plus clauses.

The score never exceeds the number of clauses.

A positive threshold count is precisely the existence of a qualifying assignment.

A declared literal needs at most one gate, including the default for invalid references.

@[simp]

Literal compilation respects polarity and the declared-variable convention.

A single literal costs at most one gate.

A two-input disjunction used to combine clause literals.

Evaluate one clause by a balanced disjunction of its literal circuits.

@[simp]

The clause compiler returns its disjunction, including false for an empty clause.

A balanced clause uses at most two gates per literal and one empty-clause fallback.

Compute all clause values on the original declared inputs.

The clause-value word has exactly the formula's score as its Hamming weight.

All clause values together have linear gate count.

The full threshold circuit, with no fresh guessed inputs.

@[simp]

Threshold compilation accepts exactly the assignments whose score meets the cutoff.

Exact assignment-count preservation; every declared input assignment contributes once.

All gates, including shared constants and empty-clause defaults, satisfy a linear bound.

theorem Cslib.Complexity.MaxSAT.workSize_le_of_width (k : ℕ) (F : Instance) (h : ∀ c ∈ F.2, List.length c ≤ k) :
workSize F ≤ (k + 1) * List.length F.2

On width-k formulas, the structural size is at most (k+1) times the clause count.