Documentation

CslibFrontier.Computability.Circuit.Frontier.TensorNetwork.CSPNetwork

The constraint network of a weighted Boolean CSP #

The network of the occurrence list of a CSP instance F : CSP Rel ℕ (Cslib.Circuits.Frontier.ClauseNetwork.network) with weighted row tables: the row of constraint ⟨R, vs⟩ lists wt R w at the words w of length |vs|, and the variables are joined by the equality chains of the clause network. Its contraction is the partition function F.partitionFunction wt (ClauseNetwork.contraction_cspNetwork). This is the network of Appendix D.2 of [OAI26k] with the clause tables replaced by arbitrary weight tables, as in a Holant or weighted #CSP instance; like the clause network, it is bipartite with its rows first and its degree is at most max k 4 for constraints of arity at most k.

The occurrences are those of the positive formula F.varCNF with the same scopes, so the ports of row i carry the scope of constraint i in order (ClauseNetwork.map_clausePorts_occurrences).

Main definitions #

Main results #

References #

def Cslib.Circuits.Frontier.ClauseNetwork.cspEntry {Rel : Type u_1} (k : ℕ) (wt : Rel → List Bool → ℕ) (c : Logic.PL.Constraint Rel ℕ) (idx : ℕ) :

The table entry of a constraint c, of arity at most k, at the word of value idx: wt c.rel w for the word w of length |c.scope| with value idx.

def Cslib.Circuits.Frontier.ClauseNetwork.cspRow {Rel : Type u_1} (k : ℕ) (wt : Rel → List Bool → ℕ) (F : Logic.PL.CSP Rel ℕ) (i idx : ℕ) :

The row tables of a CSP instance: row i is the table of constraint i.

The constraint network of a weighted Boolean CSP instance with constraints of arity at most k, with its number of rows.

theorem Cslib.Circuits.Frontier.ClauseNetwork.contraction_cspNetwork {Rel : Type u_1} {k : ℕ} {wt : Rel → List Bool → ℕ} {F : Logic.PL.CSP Rel ℕ} (hk : ∀ c ∈ F, c.scope.length ≤ k) :

The contraction of the constraint network is the partition function, for instances whose constraints have arity at most k.

The constraint network is rows-first bipartite.

theorem Cslib.Circuits.Frontier.ClauseNetwork.maxDegree_cspNetwork_le {Rel : Type u_1} {k : ℕ} {wt : Rel → List Bool → ℕ} {F : Logic.PL.CSP Rel ℕ} (hk : ∀ c ∈ F, c.scope.length ≤ k) :
(cspNetwork k wt F).2.maxDegree ≤ max k 4

The degree bound: for constraints of arity at most k, every vertex has at most max k 4 ports.

theorem Cslib.Circuits.Frontier.ClauseNetwork.length_table_cspNetwork {Rel : Type u_1} {k : ℕ} {wt : Rel → List Bool → ℕ} {F : Logic.PL.CSP Rel ℕ} (hk : ∀ c ∈ F, c.scope.length ≤ k) (v : List ℕ × List ℕ) :
v ∈ (cspNetwork k wt F).2.vertices → v.2.length = 2 ^ v.1.length

Full tables, for constraints of arity at most k.

theorem Cslib.Circuits.Frontier.ClauseNetwork.numEdges_cspNetwork {Rel : Type u_1} (k : ℕ) (wt : Rel → List Bool → ℕ) (F : Logic.PL.CSP Rel ℕ) :
(cspNetwork k wt F).2.numEdges = 3 * F.vars.length

The constraint network has three edges per variable occurrence.

The constraint network has one vertex per constraint and two per variable occurrence.