Constraint networks and their sweeps #
A constraint network is a multigraph whose edges carry values in an alphabet U and whose
vertices impose local constraints: the constraint at v sees only the values on the edges at
v and the inputs read at v. Each input is read at no more than one vertex. An input is
accepted when some assignment of values to the edges satisfies every constraint.
Networks are a semantics-free form of computation. Nothing in them is directed: a gate
z = g(x, y) becomes the relation {(x, y, z) | z = g(x, y)} between three edge values, and
the network never needs to invert g.
The separator lemma (Network.Satisfies.splice). Cut the vertices into a set L and its
complement. If two satisfying assignments, for inputs x and y, agree on the cut, then
taking the first assignment near L and the second away from it satisfies the network for the
input that reads like x at L and like y elsewhere. Once the values on the cut are fixed,
the two sides of the network are independent.
Sweeping a network. Process the vertices in the order of a layout. At time t the inputs
read by the first t vertices are revealed, and the message is the list of values on the
frontier, the cut after the first t vertices (Network.sweep). By the separator lemma
this is a sweep of the accepted set. A transition is determined by the values on two
consecutive frontiers and the inputs read at the vertex processed in between, so a layout of
width w in a network of degree at most d, reading at most m inputs per vertex, yields at
most |U| ^ (w + d + m) transitions per step (Network.ncard_accepted_le). One last step
reveals the inputs that the network does not read.
Main definitions #
Frontier.Network U ι V E: a constraint network.Frontier.Network.accepted: its accepted inputs.Frontier.Network.sweep: the sweep of the accepted set along a layout.
Main results #
Frontier.Network.Satisfies.splice: the separator lemma.Frontier.Network.dependsOn_read: acceptance depends only on the inputs read.Frontier.Network.ncard_accepted_le: the frontier counting lemma for networks.
A constraint network over the alphabet U with inputs indexed by ι: a multigraph on
vertices V and edges E, the vertex at which each input is read (if any), and a constraint at
each vertex that sees only the edges at that vertex and the inputs read there.
- src : E → V
- tgt : E → V
- site : ι → Option V
The vertex at which each input is read, if it is read at all.
- Check : V → (ι → U) → (E → U) → Prop
The constraint at a vertex, on the input and the values on the edges.
- check_local (v : V) (x x' : ι → U) (α α' : E → U) : (∀ (i : ι), self.site i = some v → x i = x' i) → (∀ (e : E), self.src e = v ∨ self.tgt e = v → α e = α' e) → self.Check v x α → self.Check v x' α'
Constraints are local: the constraint at
vsees only the inputs read atvand the values on the edges incident tov.
Instances For
The separator lemma. Let α satisfy the network on the input x and β on the input
y, and suppose that they agree on the cut of L. Then the network is satisfied on any input
z that agrees with x on the inputs read in L and with y on the others, by an assignment
that agrees with α on the edges touching L and with β on the remaining edges.
Sweeping along a layout #
The inputs revealed by time t: those read by the first t vertices, and after the last
vertex, all inputs, including those the network does not read.
Instances For
Sweeping along a layout. Fix values val x on the edges for every input x, and an extra
message extra t x at every time. The messages (extra t x, val x on the frontier at time t)
form a sweep of S as soon as inputs of S with the same message splice.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The inputs revealed while processing the vertex numbered t are read at that vertex.
Transitions by width. At a step that processes a vertex, the transition is determined by the extra messages, the values on the two frontiers, and the inputs read at the vertex.
Transitions by distinct labels. If edges with the same label carry the same value, charge a label only once across the union of the adjacent frontiers.
Transitions inside a closed set. If the vertex processed lies in W, both frontiers lie
among the edges at W, and the values on the edges at W are determined by the extra messages
and the inputs read in W, then so is the transition.
At the last step nothing is left on the frontier, and the transition is determined by the extra messages and the inputs that the network does not read.
The sweep of a network #
A satisfying assignment for an accepted input, chosen once and for all.
Equations
- N.witness x = Classical.epsilon (N.Satisfies x)
Instances For
The sweep of a network along a layout: the messages are the values of a satisfying assignment on the frontier, and splicing is the separator lemma.
Instances For
The frontier counting lemma for networks. Let the accepted inputs of a network be
K-rectangle-free, with at least K of them. If a layout has all frontiers of size at most
w, every vertex has degree at most d and reads at most m inputs, then
|accepted| ≤ (K - 1) ^ 2 · (|V| · |U| ^ (w + d + m) + |U| ^ #(unread inputs)).
A label budget on adjacent frontiers bounds the accepted set without charging repeated
copies of a label. This includes the inputs read during the step in the budget b.