Inferring Semantic Interfaces of Data Structures
In this paper, we show how to fully automatically infer semantic interfaces of data structures on the basis of systematic testing. Our semantic interfaces are a generalized form of Register Automata (RA), comprising parameterized input and output, allowing to model control- and data-flow in component interfaces concisely. Algorithmic key to the automated synthesis of these semantic interfaces is the extension of an active learning algorithm for Register Automata to explicitly deal with output. We evaluated our algorithm on a complex data structure, a “stack of stacks”, the largest of which we could learn in merely 20 seconds with less than 4000 membership queries, resulting in a model with rougly 800 nodes. In contrast, even when restricting the data domain to just four values, the corresponding plain Mealy machine would have more than 109 states and presumably require billions of membership queries.