Deterministic branching programs #
A deterministic branching program over inputs x : ι → α is a directed acyclic graph in which
every node is either a sink returning a Boolean output or a query node that reads a coordinate
i : ι and moves to the node chosen by the letter x i. Its output on x is the sink reached
from a designated start node Arora and Barak, Section 13.4.4,
Jukna, Section 1.3. Any coordinate may be queried at any node, and a coordinate may be
queried several times along a path.
The nodes are listed in a topological order. BranchingProgram.Nodes ι α n is a sequence of n
nodes in which a query node moves only to earlier nodes, so acyclicity is part of the
representation, as it is for the straight-line programs Cslib.Circuits.Program. A
BranchingProgram is such a sequence with a start node, and its size is its number of nodes, the
measure BP(f) of Jukna, Section 15.1. The output (BranchingProgram.eval) is
defined by structural recursion on the sequence, so it computes by decide on a concrete program.
The sources fix one accepting and one rejecting sink; here any number of nodes may be sinks.
A program is often easier to describe as a graph on a finite type of structured nodes, such as the
configurations of a machine, with a rank that decreases along every edge
(BranchingProgram.Graph). Listing the nodes of such a graph by rank gives a branching program
with one node for each node of the graph (BranchingProgram.Graph.toBranchingProgram,
BranchingProgram.Graph.size_toBranchingProgram), whose outputs unfold along the edges of the
graph (BranchingProgram.Graph.evalNode_sink, BranchingProgram.Graph.evalNode_branch).
Main definitions #
Cslib.BranchingPrograms.BranchingProgram.Step: the action at a node, a sink or a query.Cslib.BranchingPrograms.BranchingProgram.Nodes: a sequence of nodes in topological order.Cslib.BranchingPrograms.BranchingProgram: a deterministic branching program.Cslib.BranchingPrograms.BranchingProgram.eval: the output of a program on an input.Cslib.BranchingPrograms.BranchingProgram.const,Cslib.BranchingPrograms.BranchingProgram.rename,Cslib.BranchingPrograms.BranchingProgram.comap: constant programs, and change of coordinates and of alphabet.Cslib.BranchingPrograms.BranchingProgram.Graph: a program described as a ranked graph on any node type.Cslib.BranchingPrograms.BranchingProgram.Graph.toBranchingProgram: the branching program of a graph on a finite node type.
Main results #
Cslib.BranchingPrograms.BranchingProgram.Graph.evalNode_sink,Cslib.BranchingPrograms.BranchingProgram.Graph.evalNode_branch: the outputs of the program of a graph follow the edges of the graph.
References #
The action at a node of a deterministic branching program over inputs ι → α whose successors
lie in Node: either a sink returning a Boolean value, or a query that reads coordinate i and
moves to next a on the letter a.
A sequence of n nodes in topological order: each node is a sink, or queries a coordinate and
moves to an earlier node.
A deterministic branching program over inputs ι → α: nodes in topological order, each a
sink or a query moving to an earlier node, with a start node
Arora and Barak, Section 13.4.4. Its size is its number of nodes
Jukna, Section 15.1.
- size : ℕ
The number of nodes.
The nodes, in topological order.
The start node.
The output of P on the input x: the value of the sink reached from the start node.
The one-node branching program returning the constant b.
A branching program with at most one node cannot query its input, so it is constant.
The branching program that queries f i wherever P queries i.
Renaming the coordinates keeps the nodes.
The branching program over the alphabet β that reads each letter b as g b.
Pulling back along a map of alphabets keeps the nodes.
Programs described as graphs #
A deterministic branching program described as a graph on the nodes Node: each node is a sink
or a query, and every edge out of a query node leads to a node of strictly smaller rank, which
makes the graph acyclic. For finite Node, Graph.toBranchingProgram lists the nodes by rank.
- start : Node
The start node.
- node : Node → Step ι α Node
The action at each node.
- rank : Node → ℕ
A rank decreasing along every edge.
- rank_lt (v : Node) (i : ι) (next : α → Node) (a : α) : self.node v = Step.branch i next → self.rank (next a) < self.rank v
Every edge out of a query node leads to a node of strictly smaller rank.
The branching program of a graph on a finite node type: its nodes listed by rank.
A query node of the graph reaches the output of the node it moves to.