The clause network of a CNF formula #
The explicit Boolean tensor network of the fixed-density case of Theorem 1.1 of [OAI26k] (Appendix D.2): its contraction is the number of satisfying assignments of the formula, it is bipartite with its rows first, and its degree is bounded by the clause width.
Number the literal occurrences of a formula φ with m clauses 0, …, N - 1 in order
(Cslib.Logic.PL.occurrences). Occurrence u has three edges, 3 u, 3 u + 1 and 3 u + 2.
- Rows. Clause
iis a vertex whose ports are the edges3 uof its occurrencesu; its tensor is one except at the single assignment that falsifies every literal of the clause (ClauseNetwork.clauseEntry). Occurrenceuhas a link vertex with the two ports3 u + 1and3 u + 2and the equality tensor. - Columns. Occurrence
uhas an equality vertex with the ports3 uand3 u + 1, and3 w + 2for every occurrencewwhose previous occurrence of the same variable isu(ClauseNetwork.prev, which iswitself at a first occurrence). Its tensor is equality (ClauseNetwork.eqEntry).
So the occurrences of a variable form a chain of equality vertices, subdivided by the link
vertices, and every edge joins a row to a column. The links and equality vertices force the three
edges of every occurrence to carry the value of its variable, so for any row tables the
contraction is the sum, over the assignments of the variables, of the product of the row entries
at the words the assignment puts on the rows (ClauseNetwork.contraction_network); the ports of
a row carry the literals of its clause in order (ClauseNetwork.map_clausePorts_occurrences).
With the clause tables (ClauseNetwork.clauseRow), a row entry is one exactly when the clause has
a true literal, so the contraction is the model count (ClauseNetwork.contraction_clauseNetwork).
Weighted tables give the constraint network of a weighted CSP
(Cslib.Circuits.Frontier.ClauseNetwork.cspNetwork).
This is the network of Appendix D.2 with equality chains in place of equality trees: its
equality vertices have degree at most four (ClauseNetwork.length_qPorts_le), which is all that
Theorem D.1 needs, and the subdivision is built in. It does not merge repeated variables of a
clause; their edges are joined by the chain.
The tables are listed from the first 2 ^ B numbers (ExplicitTensorNetwork.boundedTable), for
a bound B on the degrees, so that the network is computed from constant-length lists; for the
clause network of width k formulas, B = max k 4 (ClauseNetwork.clauseNetwork).
Main definitions #
Cslib.Circuits.Frontier.ClauseNetwork.prev: the previous occurrence of the same variable.Cslib.Circuits.Frontier.ClauseNetwork.clausePorts,Cslib.Circuits.Frontier.ClauseNetwork.qPorts: the ports of the clause and equality vertices.Cslib.Circuits.Frontier.ClauseNetwork.rowVertex,Cslib.Circuits.Frontier.ClauseNetwork.network: the row vertices and the network of an occurrence list, for any row tables.Cslib.Circuits.Frontier.ClauseNetwork.clauseRow: the clause tables.Cslib.Circuits.Frontier.ClauseNetwork.clauseNetwork: the clause network of a formula, with its number of rows.
Main results #
Cslib.Circuits.Frontier.ClauseNetwork.map_clausePorts_occurrences: the ports of a clause carry its literals in order.Cslib.Circuits.Frontier.ClauseNetwork.contraction_network: the contraction of the network with any row tables is a weighted sum over the assignments of the variables.Cslib.Circuits.Frontier.ClauseNetwork.contraction_clauseNetwork: the contraction of the clause network is the model count.Cslib.Circuits.Frontier.ClauseNetwork.isRowsFirstBipartite_clauseNetwork: the bipartition.Cslib.Circuits.Frontier.ClauseNetwork.maxDegree_clauseNetwork_le: degree at mostmax k 4.Cslib.Circuits.Frontier.ClauseNetwork.numEdges_clauseNetwork,Cslib.Circuits.Frontier.ClauseNetwork.length_vertices_clauseNetwork,Cslib.Circuits.Frontier.ClauseNetwork.length_table_clauseNetwork: its size and full tables.
References #
- OpenAI, The Exponential Time Hypothesis is False, Appendix D.2 (p. 54).
Occurrence data #
Occurrence u: its clause, its position in the clause and its literal, with a default past the
end.
The variable of occurrence u.
The polarity of occurrence u.
The literal of occurrence u.
The clause of occurrence u.
The previous occurrence of the variable of occurrence u, or u itself if there is none.
The network #
The equality tensor on w ports: one at the all-false and the all-true words.
The clause tensor: zero at the one word z that falsifies every literal, one elsewhere.
The ports of clause i: the edges 3 u of its occurrences u.
The ports of the equality vertex of occurrence w: 3 w, 3 w + 1, and 3 u + 2 for the
occurrences u whose previous occurrence is w.
The falsifying word of a clause vertex with the ports ps, as a number.
The clause tables: the table of clause i is zero exactly at its falsifying word.
The network of an occurrence list with m row vertices, row tables row and degree bound
B, with its number of rows m + N: the row vertices, the link vertices, and then the equality
vertices.
The clause network of a formula, for clause width at most k.
The occurrence data #
The occurrence with a given number, as a member of the list.
The previous occurrence. Either prev u < u is an occurrence of the same variable with no
occurrence of that variable strictly between, or u is the first occurrence of its variable.
Tables #
Ports #
The number of ports of clause i is its number of occurrences.
The ports of a clause carry its literals in order: reading the literal of the occurrence
of each port of clause i gives back the clause.
An equality vertex has at most four ports.
The network: sizes and bipartition #
The network is rows-first bipartite when every occurrence names one of the m
clauses.
Degrees #
The degree bound: if every clause has at most B occurrences, every vertex has at most
max B 4 ports.
Full tables: under the degree bound, every table lists 2 ^ (number of ports) values.
The contraction #
The contraction of a network is its weighted sum over assignments. For the set S of the
variables of the occurrences, the contraction is the sum, over the assignments τ of S, of the
product of the row entries at the values of the words that τ puts on the ports of the rows.
The contraction of the clause network #
The contraction of the clause network is the model count, for formulas whose clauses have
at most k literals.
The clause network is rows-first bipartite.
The degree bound: for clauses of at most k literals, every vertex has at most max k 4
ports.
Full tables, for clauses of at most k literals.
The clause network has three edges per literal occurrence.
The clause network has one vertex per clause and two per literal occurrence.