Polynomial-time CNF construction #
The clause and formula constructors used by reductions to satisfiability are polynomial-time
for any fixed encoding of their variables. Literals use encPair, and clauses and formulas use
encList. Specializing the variable encoding to binary naturals gives the encoding of SAT.
These results certify the existing constructors, including the ordered-pair implementation of exactly-one constraints. They apply to empty lists and lists with repeated variables. Relabelling requires a polynomial-time renaming function, but does not require injectivity; injectivity is needed separately when transferring satisfiability.
Main definitions #
Cslib.Logic.PL.encOccurrence: encoding of a literal occurrence.
Main results #
Cslib.Logic.PL.Literal.computableInPolyTime_negate: literal negation.Cslib.Logic.PL.Clause.computableInPolyTime_impLits,Cslib.Logic.PL.Clause.computableInPolyTime_imp: implication clauses.Cslib.Logic.PL.Clause.computableInPolyTime_relabel,Cslib.Logic.PL.CNF.computableInPolyTime_relabel: renaming variables.Cslib.Logic.PL.CNF.computableInPolyTime_atLeastOne,Cslib.Logic.PL.CNF.computableInPolyTime_atMostOne,Cslib.Logic.PL.CNF.computableInPolyTime_exactlyOne: at-least-one, at-most-one and exactly-one constraints.Cslib.Logic.PL.CNF.computableInPolyTime_vars,Cslib.Logic.PL.CNF.computableInPolyTime_distinctVars,Cslib.Logic.PL.computableInPolyTime_occurrences: listing variable occurrences, distinct variables and literal occurrences.Cslib.Logic.PL.Clause.computableInPolyTime_length,Cslib.Logic.PL.CNF.computableInPolyTime_length,Cslib.Logic.PL.CNF.computableInPolyTime_vars_length,Cslib.Logic.PL.CNF.computableInPolyTime_numVars: clause, formula, variable-occurrence and distinct-variable counts in unary.Cslib.Logic.PL.CNF.computableInPolyTime_eval_bitsAssignment: evaluating a formula under a numbered assignment.Cslib.Logic.PL.CNF.isPolyTime_compact: compact unary indices for arbitrary variable names.
References #
Negating a literal changes only its polarity.
Construct an implication from literals, with a positive conclusion.
Construct an implication from positive hypotheses and a positive conclusion.
Relabelling a clause is polynomial-time whenever the renaming function is.
Relabelling a formula is polynomial-time whenever the renaming function is.
List the variables of a formula in order, including repetitions.
The number of literals in a polynomial-time clause, in unary, is polynomial-time.
The number of clauses in a polynomial-time formula, in unary, is polynomial-time.
The number of variable occurrences in a polynomial-time formula, in unary, is polynomial-time.
Listing the distinct variables of a formula in order of first occurrence is polynomial-time.
The number of distinct variables of a formula, in unary, is polynomial-time.
Encoding of a literal occurrence: unary clause and position indices with an encoded literal.
Instances For
Enumerating the literal occurrences of a CNF formula is polynomial-time.
Evaluating a formula under the assignment numbered by i on a list of variables is
polynomial-time.
Construct the clause requiring at least one listed variable to hold.
Construct the clauses forbidding two distinct listed variables from both holding. The list may contain repeated variables.
Construct exactly-one constraints in polynomial time, including for empty or repeated lists.
The entire input-dependent renaming is polynomial-time for any original variable encoding. Its output indices use unary encoding and are bounded by the input's number of occurrences.