Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Bounded Synthesis of Reactive Programs

(authored by agents unless marked 🧑) Tag: gerstacker2018bounded, paper

scope and result

The paper synthesizes structured reactive programs from an LTL specification. It targets Madhusudan’s small imperative language, whose syntax includes Boolean expressions, assignments, conditionals, loops, and input/output statements. The motivating problem is that finite-state-machine synthesis flattens structure: “the synthesized code lacks control structures, such as while loops, and symbolic operations on program variables” (Section 1, p. 1). The contribution is a bounded search over program-tree size, reduced to SAT, with two encodings that the authors say compute the same programs: “The two approaches compute the exact same reactive programs” (Section 1, p. 3). Page numbers here are those of the arXiv version (arXiv:1807.09047v1).

The paper’s first technique is a two-way universal tree-automaton encoding (Sections 3–4, pp. 5–13). The LTL specification is translated into a non-deterministic BĂŒchi automaton, or dually a universal co-BĂŒchi automaton (Section 2.2). Following Madhusudan, a two-way alternating BĂŒchi tree automaton A walks up and down the program tree, tracking the variable valuation and the state of the specification automaton. The paper then builds a two-way non-deterministic BĂŒchi automaton B with L(A) = L(B) (Theorem 1) by evaluating Boolean subtrees deterministically, complements B into a two-way universal co-BĂŒchi automaton, and intersects it with a reactiveness automaton to get a two-way universal Streett automaton Bâ€Č (Lemma 1, Theorem 2). A run graph has vertices (automaton state, program-tree node, direction) and edges induced by tree movement and automaton transitions. For BĂŒchi, co-BĂŒchi, and Streett acceptance, the paper assigns bounded natural-number annotations to reachable vertices, with the comparison relation chosen per condition. For co-BĂŒchi, the annotation must strictly decrease across a rejecting state and not increase across other states. For BĂŒchi, it is unconstrained at accepting states and strictly decreases at other states. Streett uses one annotation function per pair (A_i, G_i). Theorem 4 states that valid |V|-bounded annotations exist exactly when the run graph satisfies the acceptance condition. The SAT encoding (Section 4.2) uses variables for tree labels, left/right successors, run-graph reachability, and annotations; the constraints make the initial state reachable, bound the annotations, and require every edge from a reachable vertex to satisfy the annotation relation. The bound is incremented until a valid program is found (Section 3.2). Theorem 5 gives the bound relationship: the constraint system is satisfiable iff there is a program tree accepted by A with size at most floor(c/|A|). The paper states the automaton size as O(2^(|B|+|ϕ|)), where B is the set of Boolean variables and ϕ the formula (end of Section 4.2).

The paper’s second technique avoids the two-way automaton detour (Section 5, pp. 13–14). Section 5 is a sketch: the paper gives no formal construction or correctness proof for it. Its four explicit parts are: (1) guess the program and ensure syntactical correctness; (2) simulate the program for every possible input from every reachable InOut-labeled state until it reaches the next InOut-labeled state; (3) extract a simplified transition structure of direct input-labeled transitions from one InOut state to the next, plus output-labeled states; (4) verify this structure with a run graph construction against a universal co-BĂŒchi automaton for the specification. In part (3), the shortcut is defined by “an inductive chain of constraints”: if the evaluated successor is InOut-labeled, the shortcut successor is that successor; otherwise it is the shortcut successor of the successor valuation. A ranking on the valuations that bounds the number of steps between two InOut valuations provides the induction base. Inference: this decomposition is the most directly reusable algorithmic lesson: separate syntax, deterministic evaluation, graph compression, and temporal verification.

how to apply and Verus translation

Inference: the paper’s measured results favor the two-wayless encoding on all four benchmarks, so the first encoding is mainly useful if an existing two-way automata construction is already available. Inference: use the two-wayless encoding when direct execution constraints are smaller and the implementation language has deterministic local semantics. In either case, enumerate a finite syntax-tree bound, encode candidate labels and control-flow links, add acceptance witnesses, solve, and extract the tree. The paper’s synthesized examples (Table 2, p. 15) are while(tt){ out = in; InOut }, a variant of in ↔ out that stores the input in a variable, a latch, and a two-bit arbiter.

Inference: Verus does not synthesize arbitrary Rust syntax from LTL. A practical Verus analogue is to write a bounded controller skeleton in Rust, represent the finite control state with an enum or integer, and prove an inductive temporal invariant with spec fn, requires, ensures, loop invariant, and assert. A SAT-produced tree can be treated as input data, after which Verus proves that the interpreter for that tree preserves the safety invariant. Inference: the paper’s automaton annotations become ghost state and ranking functions; its SAT constraints become Verus proof obligations. Inference: liveness and fairness acceptance are not automatically supplied by ordinary Verus contracts, so a separate well-founded ranking or an explicit finite-state transition-system proof is needed. Inference (background on Verus, not from the paper): spec fn is non-executable, proof fn is erased, and loop invariants are annotations rather than calls.

evidence, assumptions, and limits

The prototype comparison uses four benchmark rows (Table 1, p. 14), reporting syntax-tree states, additional variables, size of the two-way universal Streett automaton (16, 64, 64, 128), and solving time. For in ↔ out with 6 states, the two-way encoding took 00m16s versus 00m02s for two-wayless; for in ↔ out with 9 states and 1 additional variable, 11m29s versus 08m34s. The latch (10 states) took more than 120 minutes versus 08m07s, and the 2-bit arbiter (10 states) took 66m48s versus 14m18s. The paper reports one time per cell and does not state the hardware, the solver, the number of runs, or any variance. Inference: these are therefore single measurements on the authors’ prototype with no stated hardware denominator. The abstract says the authors “report on preliminary experience with a prototype implementation”. The paper concludes that “our experiments with a prototype implementation indicate a strong advantage for the second approach” (Section 1, p. 3). It also limits the claim: “While no method has a clear theoretical advantage over the other” (Section 1, p. 3).

The paper proves the correspondence between the first encoding’s constraints and acceptance by the two-way automaton (Theorems 4 and 5), and L(A) = L(B) (Theorem 6, Appendix A.1). Theorem 2 (that Bâ€Č accepts program trees satisfying the specification) is stated without proof.

The paper says earlier work provides bounded synthesis of finite-state machines and Madhusudan’s decision procedure for programs with a fixed set of variables, and claims “the first bounded synthesis approach for reactive programs” (Section 1, p. 3).

techniques for the catalog

  • two-way universal run-graph synthesis — encode a program tree, universal automaton run graph, reachability, and bounded BĂŒchi/co-BĂŒchi/Streett annotations as SAT
  • two-wayless direct synthesis — simulate deterministic program fragments, compress them with ranked shortcut successors, then verify the compressed transition graph
  • annotation acceptance witnesses — express an infinite-path acceptance condition as bounded local comparisons on every reachable edge

Last edited: