Interpret as the bits of a binary number, with most significant. Construct a propositional formula saying that this number is strictly less than . This gives a quadratic-size formula with prescribed model count.
For , write . For each with , define the conjunctionThe empty prefix for is omitted. Let . A Boolean valuation satisfies exactly when its first difference from the binary representation of is at position , changing a one of to a zero. All later bits are unrestricted. Hence these cases are disjoint and cover exactly the numbers .
Alternatively, counting the disjoint cases directly givesEach has length , including its logical connectives and parentheses; the total length is at most a constant multiple of . The endpoints are and . If constants are unavailable and , use and instead. Assignments are counted over all specified variables, including any absent from the formula. For , the constants describe the two possible counts, zero and one. Thus the construction covers , including the endpoint zero despite the source's word “positive”.
A quadratic-size formula with prescribed model count accepts the eleven four-bit numbers below : three disjoint prefix cases contribute , and satisfying assignments
. Details. 