Sweeping a program with a ledger #
Let the special gates of a program p have a ledger in M, and let p accept the inputs whose
value at a wire o lies in a set Acc. Erase the special gates. A wire is live
(Frontier.Live) if it is an input or an ordinary gate of positive arity; the others are
constants of the erased program, among them the constants replacing the special gates. The
live circuit (Frontier.liveCircuit) is the erased program with every live wire as an output.
For a guess m ∈ M, the constraint network of the live circuit accepting every value
(Frontier.Ledger.network) is satisfied exactly by the run with guess m. Its graph and its
sites do not depend on m: they make up the live network (Frontier.liveNetwork), which has no
constraints and serves for the frontiers, components and inputs read of every guess.
The ledger sweep (Frontier.Ledger.sweep) is the sweep along a layout of the live network
(Frontier.Network.frontierSweep) whose extra message has two parts: the readout L.readout m of
the consistent guess m = L.total (p.trace I x) on the special gates, and the product of the
contributions of the wires whose vertices come first (the ledger so far). Two inputs with the
same message can be spliced (Frontier.Ledger.mem_of_splice): matching readouts give the exact
same erased constraint network; the two parts of the ledger multiply back to the second input's
consistent guess; and a consistent guess yields the true run.
Tightened transitions (|U|^k · |M|, bounded also by |M|^2). Because the readout stays
constant across step t → t + 1 and the contribution of a newly processed signal vertex w is
determined by its outgoing head edge in frontier π t ∪ frontier π (t + 1) (or touching W), the
extra message L.extra π (t + 1) x is already determined by L.extra π t x and the edge values of
the step (Frontier.Ledger.extra_succ_eq). Thus each step multiplies the transition count only by
min (|U| ^ k) |M| * |M|, where k = |{g // special g}| (Frontier.Ledger.ncard_extra_le),
replacing the naive |M| ^ 3 bound (Frontier.Ledger.exists_ncard_le).
Main definitions #
Cslib.Circuits.Frontier.Live: the live wires of a program with erased special gates.Cslib.Circuits.Frontier.liveCircuit: the erased program with every live wire as an output.Cslib.Circuits.Frontier.liveNetwork,Cslib.Circuits.Frontier.wiresIn: its graph and sites, as a network without constraints, and the wires whose vertices lie in a set.Cslib.Circuits.Frontier.Ledger.network: its constraint network on a guess.Cslib.Circuits.Frontier.Ledger.extra,Cslib.Circuits.Frontier.Ledger.sweep: the extra message and sweep of a program with a ledger.
Main results #
Cslib.Circuits.Frontier.reach_input,Cslib.Circuits.Frontier.read_liveNetwork: every input is a signal ofliveCircuit, andliveNetworkreads every input.Cslib.Circuits.Frontier.Ledger.trace_of_splice,Cslib.Circuits.Frontier.Ledger.mem_of_splice: splicing two inputs whose readouts, partial ledgers and cut values agree.Cslib.Circuits.Frontier.Ledger.run_eq_of_eqOn_readIn: locality inside a closed set.Cslib.Circuits.Frontier.Ledger.ncard_extra_le: the extra message at timettakes at mostmin (|U| ^ k) |M| * |M|values.Cslib.Circuits.Frontier.Ledger.ncard_transition_le_width,Cslib.Circuits.Frontier.Ledger.ncard_transition_le_readIn: transitions by width and by the inputs read in a closed set.Cslib.Circuits.Frontier.Ledger.exists_ncard_le: counting along a layout of the components.
The live circuit #
A wire is live, once the special gates of p are erased, when it is an input or an
ordinary gate of positive arity. The other wires are constants of the erased program: the
constants replacing the special gates and the gates of arity zero.
The live circuit: the program p with its special gates erased, and with every live wire
as an output.
The live network: the graph of the live circuit and the sites of its inputs, without
constraints. It does not depend on a ledger or a guess; its frontiers, components and inputs read
are those of the network of the live circuit on every guess (Frontier.Ledger.network).
The inputs are signals of the live circuit.
The inner gates of the live circuit are the ordinary inner gates.
There are at most n + s' live wires, where s' counts the ordinary inner gates.
The live network reads every input.
When there are inputs, the graph of the live circuit has a vertex.
The wires whose vertices lie in P.
The constraint network of the live circuit on the guess m, accepting every value. Its
satisfying assignments are the runs with guess m. Its graph and its sites are those of the live
network, whatever the guess.
Splicing #
Splicing traces wire by wire. If the runs of x and y have the same readout on the
special gates, the same ledger on the wires of a set of vertices P, and the same values on the
edge cut of P, then every input z that reads like x at P and like y elsewhere has
p.trace I z equal to p.trace I x on wiresIn P and equal to p.trace I y outside
wiresIn P.
Splicing two inputs with the same message. Let x and y be inputs whose value at the
wire o lies in Acc. If their runs have the same readout on the special gates, the same ledger
on the wires of a set of vertices P, and the same values on the edge cut of P, then every
input z that reads like x at P and like y elsewhere has its value at o in Acc as
well.
Locality inside a closed set. For a fixed guess, the values of the run on the edges at a
closed set of vertices W depend only on the inputs read in W.
The sweep #
The extra message at time t: the readout of the consistent guess on the special gates and
the ledger of the first t vertices. After the last vertex it is constant.
The sweep of a program with a ledger, along a layout of its live network: the frontier sweep of the values of the run, whose extra message is the readout on the special gates and the ledger so far.
When step t processes vertex v, L.extra π (t + 1) is determined by L.extra π t and, if
v = .signal w₀, the value of the run at w₀.
The extra message at time t takes at most min (|U| ^ k) |M| * |M| values, where k is the
number of special gates: the readout lies in {g // special g} → U as well as in the image of M,
and the partial ledger lies in M.
Transitions by width. A transition at step t is determined by the extra message at time
t, the values on the two frontiers, and the input read at the vertex processed.
Transitions inside a closed set. If the vertex processed at step t lies in a closed
set W whose edges contain both frontiers of the step, a transition is determined by the extra
message at time t and the inputs read in W.
Counting along a layout of the components. Suppose that, at each step of a layout, the
frontiers lie among the edges of the component of the vertex processed. Then some step t
bounds the set accepted by p by
(K - 1) ^ 2 (|V| + 1) (min (|U| ^ k) |M| * |M|) q ^ e, where q = |U|, k counts the special
gates, and e is the smaller of the width of the step and the number of inputs read in the
component of the vertex processed.