We build on the underlying theory of symbolic transducers to fuse pipelines of effectful comprehensions into a single representation, from which efficient code can be generated. This is motivated by operations such as compression/decompression and serialization/deserialization that are common in log/data processing pipelines and require loop-carried state when processing an input stream of data. This paper puts forth effectful comprehensions as an elegant way to describe list comprehensions that incorporate loop-carried state. List comprehensions provide a powerful abstraction mechanism for expressing computations over ordered collections of data declaratively without having to use explicit iteration constructs. Our techniques can synthe-size string pre-images in excess of 8, 000 bytes in roughly a minute, and we find that our new encodings significantly outperform previous techniques in succinctness and speed of analysis.
We demonstrate our techniques on four case studies, covering a wide range of applications. In practice we leverage recent advances in satisfiability modulo theory (SMT) solvers. Unlike previous work, we do not need any syntactic restriction of the formulas on the transitions, only a decision procedure.
The algorithms give rise to a complete decidable algebra of symbolic transducers. Our base algorithms are unusual in that they are non-constructive, therefore, we also supply a separate model gen-eration algorithm that can quickly find counterexamples in the case two symbolic finite transducers are not equivalent. We provide novel algorithms for these operations and extend composition to symbolic transducers augmented with regis-ters. Despite this, the main operations, including composition, checking that a transducer is single-valued, and equivalence checking for single-valued symbolic finite transducers are ef-fective given a decision procedure for the background theory. Admitting potentially infinite alphabets makes this representation strictly more general and succinct than classical finite transducers and automata over strings. We extend these classic objects with symbolic alphabets represented as para-metric theories.
Finite automata and finite transducers are used in a wide range of applications in software engineering, from regu-lar expressions to specification languages.