The inductive-counting machine, abstractly #
The combinatorial heart of Immerman–Szelepcsényi (Immerman 1988, Szelepcsényi 1988): a nondeterministic walk on configurations that reaches an accepting configuration exactly when no target is reachable from a source in a finite graph.
Everything here is about an abstract finite linearly ordered node type V with
an edge relation E and source and target predicates S, T; nothing is
first-order yet. DescriptiveComplexity.InductiveCounting.Sound and
DescriptiveComplexity.InductiveCounting.Complete prove the two directions, and
DescriptiveComplexity.TransitiveClosureCompl runs the whole machine inside a single
TC by realizing each configuration as a mode together with a tuple of
elements.
The algorithm #
Write Rset d for the set of nodes reachable from a source in at most d
steps. The counts |Rset d| are computed by inductive counting: knowing
|Rset d| exactly, one can certify, for a given node v, whether
v ∈ Rset (d+1), by running over all nodes u in order, guessing which
belong to Rset d, certifying each guess by a path of length at most d from
a source, and checking at the end that exactly |Rset d| of them were
certified – which forces the guessed set to be Rset d itself. Counting the
v's that pass gives |Rset (d+1)|. The machine accepts when
|Rset (d+1)| = |Rset d|, at which point the reachable set is Rset d; since
every certified node is checked not to be a target, acceptance means no target
is reachable.
The registers #
The machine has eight registers, each holding an element of WithBot V: a
node, or a count read through DescriptiveComplexity.orank (so ⊥ is the count 0
and the count m is the m-th value of WithBot V). This uniformity is what
lets a register be stored, in the first-order realization, as one tuple of
elements together with a finite mode.
Layered reachability #
RInLe E n a b: the node b is reachable from a along E in at most
n steps.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.InductiveCounting.RInLe E 0 x✝¹ x✝ = (x✝¹ = x✝)
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Prepending an edge to a bounded walk.
Dependency graph
The set of nodes reachable from a source in at most d steps.
Equations
Instances For
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Dependency graph
Walking on from a layer: a bounded walk out of Rset i lands in a later
layer.
Dependency graph
Every member of a layer carries a bounded walk from a source.
Dependency graph
The layers exhaust the reachable set.
Dependency graph
Conversely, every member of a layer is reachable from a source.
Dependency graph
Once a layer repeats, all later layers agree with it.
Dependency graph
If no layer contains a target, no target is reachable from a source.
Dependency graph
Registers, slots and atomic constraints #
The eight registers of the machine.
Equations
Instances For
Dependency graph
Dependency graph
The count of the current layer, |Rset d|.
Equations
Instances For
Dependency graph
The count of the next layer being built, |Rset (d+1)|.
Equations
Instances For
Dependency graph
The node scanned by the outer loop.
Equations
Instances For
Dependency graph
The count of nodes certified in the inner loop.
Equations
Instances For
Dependency graph
The node scanned by the inner loop.
Equations
Instances For
Dependency graph
The node walked backwards along a certifying path.
Equations
Instances For
Dependency graph
The countdown of the certifying path's remaining length.
Equations
Instances For
Dependency graph
A slot: a register, read either in the current configuration (false) or
in the next one (true).
Equations
Instances For
Dependency graph
The slot reading a register in the current configuration.
Instances For
Dependency graph
The slot reading a register in the next configuration.
Instances For
Dependency graph
An atomic constraint relating the registers of two consecutive configurations. Each one is realized, in the first-order construction, by one formula over two tuples of variables.
- eqR
(a b : Slot)
: VAtom
Two slots hold the same value.
- neqR
(a b : Slot)
: VAtom
Two slots hold different values.
- succR
(a b : Slot)
: VAtom
The second slot holds the immediate successor of the first.
- edge
(a b : Slot)
: VAtom
The two slots hold nodes joined by an edge.
- nedge
(a b : Slot)
: VAtom
The two slots do not hold nodes joined by an edge.
- srcR
(a : Slot)
: VAtom
The slot holds a source node.
- nsrcR
(a : Slot)
: VAtom
The slot does not hold a source node.
- tgtR
(a : Slot)
: VAtom
The slot holds a target node.
- ntgtR
(a : Slot)
: VAtom
The slot does not hold a target node.
- botNode
(a : Slot)
: VAtom
The slot holds the least node.
- topNode
(a : Slot)
: VAtom
The slot holds the greatest node.
- isZero
(a : Slot)
: VAtom
The slot holds the count zero.
Instances For
Dependency graph
Configurations and the transition table #
The control phases of the machine.
- initCount : Phase
Scanning all nodes to count the sources, that is
|Rset 0|. - inner : Phase
The inner loop: at node
u, about to certify it or to skip it. - walk : Phase
Walking backwards along a certifying path for
u. - certDone : Phase
- check : Phase
The inner loop is over: check that the count matches
|Rset d|. - stageEnd : Phase
The outer loop is over:
c2holds|Rset (d+1)|. - accept : Phase
The accepting phase.
Instances For
Dependency graph
Dependency graph
Dependency graph
A configuration: a phase, the flag recording whether the current outer node has been found in the next layer, and the eight registers.
- phase : Phase
The control phase.
- flag : Bool
The flag:
vhas been seen to lie in the next layer. The registers.
Instances For
Dependency graph
The transition table: a list of alternatives, each a list of atomic constraints, for every pair of control states (a phase and the flag). The algorithm of the module docstring is entirely contained here.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The semantics of the machine #
Two slots hold nodes joined by an edge.
Equations
Instances For
Dependency graph
A slot holds a node satisfying a predicate.
Equations
- DescriptiveComplexity.InductiveCounting.PW S a = ∃ (p : V), a = ↑p ∧ S p
Instances For
Dependency graph
The value a slot reads, from the current and the next register vectors.
Equations
Instances For
Dependency graph
What an atomic constraint asserts about two register vectors.
Equations
- One or more equations did not get rendered due to their size.
- DescriptiveComplexity.InductiveCounting.VAtom.Holds E S T x y (DescriptiveComplexity.InductiveCounting.VAtom.isZero a) = (DescriptiveComplexity.InductiveCounting.slotVal x y a = ⊥)
Instances For
Dependency graph
All the constraints of an alternative hold.
Equations
- DescriptiveComplexity.InductiveCounting.Sat E S T x y l = ∀ a ∈ l, DescriptiveComplexity.InductiveCounting.VAtom.Holds E S T x y a
Instances For
Dependency graph
Dependency graph
Dependency graph
One step of the machine: some alternative of the table entry for the two control states is satisfied by the two register vectors.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
Reachability between configurations.
Equations
Instances For
Dependency graph
The initial configurations: the source scan is about to start, with a zero count and the outer register at the least node.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Dependency graph
The accepting configurations.
Equations
Instances For
Dependency graph
The machine accepts: an accepting configuration is reachable from an initial one.
Equations
- One or more equations did not get rendered due to their size.