BoSy: An Experimentation Framework for Bounded Synthesis
Peter Faymonville Bernd Finkbeiner Leander Tentrup


The Arches cluster revisited: I. Data presentation and stellar census  
Based on observations made at the European Southern Observatory, 
Paranal, Chile under programs ESO 087.D-0317, 091.D-0187 and 099.D-0345. 

    J. S. Clark1
M.E. Lohr1
F. Najarro2
H. Dong3
F. Martins4
    

====================================================================================================================================================================================================================




We present , a reactive synthesis tool based on the bounded synthesis approach.  Bounded synthesis ensures the minimality of the synthesized implementation by incrementally increasing a bound on the size of the solutions it considers.
For each bound, the existence of a solution is encoded as a logical constraint solving problem that is solved by an appropriate solver.

 constructs bounded synthesis encodings into SAT, QBF, DQBF, EPR, and SMT, and interfaces to solvers of the corresponding type.  When supported by the solver,  extracts solutions as circuits, which can, if desired, be verified with standard hardware model checkers.
 won the LTL synthesis track at SYNTCOMP 2016. In addition to its use as a synthesis tool,  can also be used as an experimentation and performance
evaluation framework for various types of satisfiability solvers.





§ INTRODUCTION


The reactive synthesis problem is to check whether a given ω-regular specification, usually presented as an LTL formula, has an implementation, and, if the answer is yes, to construct such an implementation. As a theoretical problem, reactive synthesis dates back all the way to Alonzo Church's solvability question <cit.> in the 1950s; as a practical engineering challenge, the problem is fairly new. Tools for reactive synthesis started to come out around 2007 <cit.>. The first SYNTCOMP tool competition took place at CAV 2014 and was originally restricted to safety specifications, and only later, starting with CAV 2016, extended with an LTL synthesis track <cit.>. 

In this paper, we present , the winner of the 2016 LTL synthesis track.  is based on the bounded synthesis approach <cit.>. Bounded synthesis ensures the minimality of the synthesized implementation by incrementally increasing a bound on the size of the solutions it considers.
For each bound, the existence of a solution is encoded as a logical constraint solving problem that is solved by an appropriate solver. If the solver returns “unsat”, the bound is increased and a new constraint system is constructed; if the solver returns a satisfying assignment, an implementation is constructed.

From an engineering perspective, an interesting feature of the bounded synthesis approach is that it is highly modular. The construction of the constraint system
involves a translation of the specification into an ω-automaton. Because the same type of translation is used in model checking, a lot of research has
gone into optimizing this construction; well-known tools include  <cit.> and  <cit.>.
On the solver side, the synthesis problem can be encoded in a range of logics, including boolean formulas (SAT), quantified boolean formulas (QBF), dependency quantified boolean formulas (DQBF), the effective propositional fragment of first-order logic (EPR), and logical formulas with background theories (SMT) (cf. <cit.>). For each of these encodings, there are again multiple competing solvers.

 leverages the best tools for the LTL-to-automaton translation and the best tools for solving the resulting constraint systems. In addition to its main purpose, which is the highly effective synthesis of reactive implementations from LTL specifications,  is therefore also an experimentation framework, which can be used to compare individual tools for each problem, and even to compare tools across different logical encodings. For example, the QBF encoding is more compact than the SAT encoding, because it treats the inputs of the synthesized system symbolically.  can be used to validate, experimentally, whether QBF solvers translate this compactness into better performance (spoiler alert: in our experiments, they do). Likewise, the DQBF/EPR encoding is more compact than the QBF encoding, because this encoding treats the states of the synthesized system symbolically. In our experiments, the QBF solvers nevertheless outperform the currently available DQBF solvers.

In the remainder of this paper, we present the tool architecture, including the interfaces to other tools, and report on experimental results[ is available online at <https://react.uni-saarland.de/tools/bosy/>.].



§ TOOL ARCHITECTURE





An overview of the architecture of  is given in Figure <ref>. For a given bounded synthesis instance,  accepts a JSON-based input format that contains a specification φ given in LTL, the signature of the implementation given as a partition of the set of atomic propositions into inputs and outputs, and the target semantics as a Mealy or a Moore implementation. 
In the preprocessing component, the tool starts to search for a system strategy with φ and an environment counter-strategy with φ in parallel.[The LTL reactive synthesis problem is not dual with respect to dualizing the LTL formula only, but the target semantics has to be adapted as well.
If one searches for a transition-labeled (Mealy) implementation, a counterexample is state-labeled (Moore) and vice versa.] 

After parsing, the LTL formula is translated into an equivalent universal co-Büchi automaton using an external automata translation tool. Currently, we support  <cit.> and  <cit.> for this conversion, but further translation tools can be integrated easily. Tools that output  never-claims or the HOA format are supported.

To the resulting automaton, we apply some basic optimization steps like replacing rejecting terminal states with safety conditions and an analysis of strongly connected components to reduce the size of the constraint system <cit.>.

The encoding component is responsible for creating the constraint system based on the selected encoding, the specification automaton, and the current bound on the number of states of the system. The component constructs a constraint system using a logic representation which supports propositional logic, different kinds of quantification, and comparison operators (between natural numbers).
Our implementation contains the following encoding options. These encodings differ in their ability to support the symbolic encoding of the existence of functions.
We refer the reader to <cit.> for details.

  
  * A propositional backend for SAT, where all functions are unrolled to conjunctions over their domain.
  
  * An input-symbolic encoding employing QBF solvers, where functions with one application context are symbolically represented.
  
  * Two encodings (state-symbolic, symbolic) using DQBF/EPR solvers, where functions, which are used in multiple contexts, are encoded symbolically.
  
  * An SMT encoding resembling the original bounded synthesis encoding <cit.>.


This constraint system is then translated to a format that the selected solver understands, and the solver is called as an external tool. 

We support SAT solvers that accept the DIMACS input format and that can output satisfying assignments, currently  <cit.> and  <cit.>.
We have three categories of QBF solving tools: QDIMACS/QCIR solver that can output top-level assignments ( <cit.>,  <cit.>, and  <cit.>), QDIMACS preprocessors ( <cit.>), and certifying QDIMACS/QCIR solver that can provide boolean functions witnessing satisfiable queries ( <cit.>,  <cit.>, and  <cit.>).
For the remaining formats, i.e., DQDIMACS ( <cit.>), TPTP3, 
and SMT ( <cit.>,  <cit.>), we only require format conformance as witness extraction is not supported, yet.

After the selected solver with corresponding encoding has finished processing the query and reports unsatisfiable, the search strategy determines how the bound for the next constraint encoding is increased. Currently, we have implemented a linear and an exponential search strategy.

In case the solver reports satisfiable, the implementation will be extracted in the postprocessing component. The extraction depends on the encoding and solver support, we currently support it for SAT and QBF.

In case of the encoding to SAT, the solver delivers an assignment, which is then translated to our representation of the synthesized implementation.  The transition function and the functions computing the outputs are represented as circuits.

In case of the QBF-encoding, we take a two-step approach for synthesis.
The QBF query has the quantifier prefix ∃∀∃ <cit.>.
In synthesis mode, the query is solved by a combination of QBF preprocessor and QBF solver.
From a satisfiable query, the assignment of the top-level existential quantification is extracted <cit.> and then used to reduce the original query by eliminating the top level existential quantifier.
The resulting query, now with a ∀∃ prefix, is then solved using a certifying QBF solver that returns a certificate, that is a circuit representing the witnessing boolean functions.
This certificate is then translated into the same functional representation of the synthesized implementation as in the SAT case.

This common representation of the implementations allows the translation into different output formats.
From our representation, it is possible to translate the implementation into an AIGER circuit as required by the SYNTCOMP rules, to a SMV model for model checking, or to a graphical representation using the DOT format.

Further encodings can be integrated as extra components in the tool. Such an encoder component has access to the automaton, the semantics, and the input and output signals. The encoder must provide a method  that takes as its parameter a bound and returns whether there is an implementation with the given bound that realizes the specification.
The method is implemented by building the constraint system and solving it using a theory solver.
One can either use our logic representation or build the textual solver representation directly.
If the component supports synthesis, it implements a second method  that is called if  returns true.
It returns a representation of the realizing implementation as described above.

In order to integrate new solver formats, one has to provide a translator from our logic representation to this format.



§ EXPERIMENTATION


The reactive synthesis competition has a library of LTL benchmarks that can be transformed into the  file format using the organizers' conversion tool <cit.>.
The tool  <cit.> is used in our experiments to get predictable timing results and to set appropriate time and memory limits.
Figure 2 compares the performance of the different encodings for determining realizability on the SYNTCOMP benchmark set.
Notably, the encoding employing QBF solving performed better than the SAT-based one and both solve more instances than the original SMT encoding.
The two encodings using DQBF are not yet competitive due to limited availability of DQBF solvers.





Different configurations of  may not only result in varying running times, but may also effect the quality of the synthesized implementation.

A measurement of the quality of the implementation that has also been used in the reactive synthesis competition is the size of the implementation, measured in the number of gates in the circuit representation.

The correctness of an implementation, i.e., whether the synthesized solution actually satisfies the original specification can be verified by model checking.
One can either encode the solution as a circuit and use an AIGER model checker, or one can use the SMV representation and model check it with  <cit.>.

For a sample benchmark, a parametric load-balancer <cit.> instantiated with 5 clients, we provide experimental results for different configurations of  in Fig. <ref>.
The two automaton conversion tools produce significantly different automata, where the state space of the automaton produced by  is only one third of the one produced by .
Consequently, the constraint system generated for the  version is larger and thereby the running time worse compared to the  version.
This impact is stronger on the propositional encoding than on the input-symbolic one for realizability.
An observation that also translates to other benchmarks is that the size of the implementation is usually smaller using the input-symbolic encoding.
On the other hand, extracting solutions is cheaper in the propositional case as only assignments are extracted.




splncs03


