Read-once branching programs as d-DNNFs and decomposable DAGs #
A read-once branching program P of length L with states S over the alphabet Bool
(Cslib.BranchingPrograms.ReadOnceProgram), together with a variable order ord : Fin L → ι,
computes x ↦ P.eval (x ∘ ord): an ordered binary decision diagram reading x (ord 0),
x (ord 1), …. When the order is injective, this function is computed by a d-DNNF with
(L + 1) |S| + 2L + 2L |S| nodes (ReadOnceProgram.toNNF, ReadOnceProgram.card_nnfNode), the
compilation of ordered binary decision diagrams into d-DNNFs
[ArenasBroadrickLiewVanDenBroeck2026, Fact 3.3].
The circuit has a node (t, q) for each time t ≤ L and state q, computing whether the program
accepts from state q at time t (ReadOnceProgram.eval_state): at t = L it is the constant
accept q, and before it is
(¬x_{ord t} ∧ (t + 1, step t q false)) ∨ (x_{ord t} ∧ (t + 1, step t q true)). The ∨ is
deterministic because its children disagree on x_{ord t}, and the ∧ is decomposable because
ord t is not read again.
Over an arbitrary finite alphabet U, the same construction compiles a read-once program (an
ordered multi-valued decision diagram, MDD) directly into a deterministic DecomposableDAG ι U
(ReadOnceProgram.toDecomposableDAG, ReadOnceProgram.accepted_toDecomposableDAG,
ReadOnceProgram.isDeterministic_toDecomposableDAG) of size 2 L |S| |U|
(ReadOnceProgram.size_toDecomposableDAG), which is also smooth whenever ord is surjective
(ReadOnceProgram.isSmooth_toDecomposableDAG).
Programs reading a list of labelled variables with a label-dependent transition
(ReadOnceProgram.ofList, ReadOnceProgram.listOrder) evaluate by a left fold over the list
(ReadOnceProgram.eval_ofList).
Main definitions #
Cslib.BranchingPrograms.ReadOnceProgram.toNNF: the d-DNNF of a Boolean program and a variable order.Cslib.BranchingPrograms.ReadOnceProgram.toDecomposableDAG: the deterministic decomposable DAG (MDD) of a program over an arbitrary finite alphabetUand an injective variable order.Cslib.BranchingPrograms.ReadOnceProgram.ofList,Cslib.BranchingPrograms.ReadOnceProgram.listOrder: the program reading a list of labelled variables.
Main results #
Cslib.BranchingPrograms.ReadOnceProgram.toFun_toNNF: the circuit computes the program.Cslib.BranchingPrograms.ReadOnceProgram.isDecomposable_toNNF,Cslib.BranchingPrograms.ReadOnceProgram.isDeterministic_toNNF: it is a d-DNNF for an injective order.Cslib.BranchingPrograms.ReadOnceProgram.card_nnfNode: its size.Cslib.BranchingPrograms.ReadOnceProgram.accepted_toDecomposableDAG,Cslib.BranchingPrograms.ReadOnceProgram.isDeterministic_toDecomposableDAG,Cslib.BranchingPrograms.ReadOnceProgram.isSmooth_toDecomposableDAG,Cslib.BranchingPrograms.ReadOnceProgram.size_toDecomposableDAG: correctness, determinism, smoothness and size of the multi-valued decomposable DAG.Cslib.BranchingPrograms.ReadOnceProgram.eval_ofList: list programs evaluate by a fold.
References #
The nodes of the d-DNNF of a program: states at each time, literals at each time, and the conjunctions of a literal with the next state.
The gate at a node of the d-DNNF of a program.
The d-DNNF of a program reading the variables in the order ord.
The state nodes compute the program: the node (t, q) accepts exactly when the program
accepts from the state q at time t.
The state node at time t mentions only the variables read from time t on.
The circuit is decomposable when the order reads every variable at most once.
The circuit is deterministic: the two branches of a state node disagree on the variable read.
Size: the d-DNNF of a program of length L with |S| states has
(L + 1) |S| + 2L + 2L |S| nodes.
Programs reading a list of labelled variables #
The program reading the list items of labelled variables in order, moving from state s
to step λ s b on reading the value b of a variable labelled λ.
Multi-valued read-once programs as decomposable DAGs #
The nodes of the decomposable DAG (MDD) of a read-once program over alphabet U: states at
each time, letter tests at each time, and products of a letter test with the next state.
Compile a read-once branching program over an arbitrary finite alphabet U (an ordered MDD)
under an injective variable order into a deterministic DecomposableDAG.
Correctness of the MDD compilation: P.toDecomposableDAG ord hord accepts exactly the
inputs accepted by P under the variable order ord.
Determinism of the MDD compilation: distinct outgoing letters at each state node are disjoint.
Smoothness of the MDD compilation: every union is already smooth, so the DAG is smooth over
all coordinates whenever ord is surjective (in particular for ord = id).
Size of the MDD compilation: L |S| |U| union edges and L |S| |U| products, for a total
size of 2 L |S| |U|.