Johnson's algorithm runs in polynomial time #
Johnson's algorithm (Cslib.Logic.PL.johnson) is polynomial-time for any encoding of the
variables, with literals encoded by encPair and clauses and formulas by encList
(Cslib.Logic.PL.computableInPolyTime_johnson). Removing repeated literals, setting a variable
and computing the weight are polynomial-time, the weight in binary from the bound L in unary.
The algorithm is a fold over the distinct variables whose step reads the input formula; setting a
variable does not lengthen the encoded formula (Cslib.Logic.PL.CNF.length_encList_restrict_le)
and each round adds one variable to the output, so the state stays polynomially bounded. The
weights have O(L) bits, and comparing them is polynomial-time.
Main results #
Cslib.Logic.PL.Clause.computableInPolyTime_eraseDupLits,Cslib.Logic.PL.CNF.computableInPolyTime_eraseDupLits: removing repeated literals.Cslib.Logic.PL.CNF.computableInPolyTime_restrict: setting a variable.Cslib.Logic.PL.CNF.computableInPolyTime_johnsonWeight: Johnson's weight.Cslib.Logic.PL.computableInPolyTime_johnson: Johnson's algorithm.
References #
Removing repeated literals from a clause is polynomial-time.
Removing repeated literals from every clause is polynomial-time.
Setting a variable is polynomial-time.
Johnson's weight, in binary, is polynomial-time in a unary bound L and the formula.
Setting a variable does not lengthen the encoding of a formula.
Setting a computed variable to a computed value in a computed formula is polynomial-time.
Johnson's weight of a computed formula with a computed unary bound is polynomial-time.
Johnson's algorithm is polynomial-time, for any encoding of the variables.