scieee AI-readable full text Open interactive document viewer

Inferring Specifications in the K Framework

Alpuente Frasnedo, María,Pardo Pont, Daniel,Villanueva, Alicia

Abstract

[EN] Despite its many unquestionable benefits, formal specifications are not widely used in industrial software development. In order to reduce the time and effort required to write formal specifications, in this paper we propose a technique for automatically discovering specifications from real code. The proposed methodology relies on the symbolic execution capabilities recently provided by the K framework that we exploit to automatically infer formal specifications from programs that are written in a non trivial fragment of C, called KERNELC. Roughly speaking, our symbolic analysis of KERNELC programs explains the execution of a (modifier) function by using other (observer) routines in the program. We implemented our technique in the automated tool KINDSPEC 2.0, which generates axioms that describe the precise input/output behavior of C routines that handle pointer- based structures (i.e., result values and state change). We describe the implementation of our system and discuss the differences w.r.t. our previous work on inferring specifications from C code.

Full text

Submitted to: PROLE 2015 © María Alpuente, Daniel Pardo & Alicia Villanueva This work is licensed under the Creative Commons Attribution License. Inferring Specifications in the K framework ∗ Work in Progress María Alpuente Daniel Pardo Alicia Villanueva DSIC, Universitat Politècnica de València Camino de Vera s/n 46022 Valencia, Spain {alpuente,daparpon,villanue}@dsic.upv.es Despite its many unquestionable benefits, formal specifications are not widely used in industrial software development. In order to reduce the time and effort required to write formal specifications, in this paper we propose a technique for automatically discovering specifications from real code. The proposed methodology relies on the symbolic execution capabilities recently provided by the Kframework that we exploit to automatically infer formal specifications from programs that are written in a non–trivial fragment of C, called KERNELC. Roughly speaking, our symbolic analysis of KERNELC programs explains the execution of a (modifier) function by using other (observer) routines in the program. We implemented our technique in the automated tool KINDSPEC 2.0, which generates axioms that describe the precise input/output behavior of C routines that handle pointerbased structures (i.e., result values and state change). We describe the implementation of our system and discuss the differences w.r.t. our previous work on inferring specifications from C code. 1 Introduction Formal specifications can be used for various software engineering activities ranging from documenting software to automated debugging, verification, and test-case generation. However, there are a variety of reasons why software companies do not currently consider formal specification to be cost-effective to apply; these include time, complexity, and tool support. Specification inference can help to mitigate these problems and is also useful for legacy program understanding and malware deobfuscation [5]. This paper describes our ongoing work in developing a specification inference system for heapmanipulating programs that are written in a non-trivial fragment of C called KERNELC [21], which includes functions, structures, pointers, and I/O primitives. We rely on the (rewriting logic) semantic framework K[20], which facilitates the development of executable semantics of programming languages and also allows formal analysis tools for the defined languages to be derived with minimal effort. A language definition in Kessentially consists of three parts: the BNF language syntax (annotated with Kspecific attributes), the structure of program configurations, and the semantic rules. Similarly to the classic operational semantics, program configurations contain an encoding for the environment, the heap, stacks, etc. and are represented as algebraic datatypes in K. Program configurations organize the state in units called cells, which are labeled and can be nested. For example, following the Knotation, the program configuration htv(int,0)ikhx7→ xienvhx7→ tv(int,5)iheap cfg (1) ∗This work has been partially supported by the EU (FEDER) and the Spanish MINECO ref. TIN2013-45732-C4 (DAMAS), and by Generalitat Valenciana ref. PROMETEOII/2015/013. D. Pardo is supported by FPU-ME grant FPU14/01830. models the final state of a computation whose return value is the integer 0 (stored in the kcell, which contains the current code to be run), while program variable x(stored in the env cell) has the value 5 (stored in the memory address given by xin the heap cell, where information about pointers and data structures is recorded). Variables representing symbolic memory addresses are written in sans-serif font. In K, the configuration (1) is a friendly representation for the term <cfg> <k> tv(int,0) </k> <env> x => pointer(x) </env> <heap> pointer(x) => tv(int,5) </heap> </cfg> Symbolic execution (SE) is a well-known program analysis technique that allows the program to be executed using symbolic input values instead of actual (concrete) data so that it executes the program by manipulating program expressions involving the symbolic values [16,19]. Unlike concrete execution, where the path taken is determined by the input, in symbolic execution the program can take any feasible path. That path is given by a logical constraint on past and present values of the variables, called path condition because it is formed by constraints that are accumulated on the path taken by the execution to reach the current program point. Each symbolic execution path stands for many actual program runs (in fact, for exactly the set of runs whose concrete values satisfy the logical constraints). One of the traditional drawbacks of SE-based techniques is the high cost of decision procedures to solve path conditions. Recently, SE has found renewed interest due in part to the huge recent advances in decision procedures for logical satisfiability. Ksemantics is traditionally1compiled into Maude [7] for execution, debugging, and model checking. Kimplements reachability logic in the same way that Maude implements rewriting logic. In reachability logic, a particular class of first-order formulas with equality (encoded as (boolean) terms with logical variables and constraints over them) is used. These formulas, called patterns, specify those concrete configurations that match the pattern algebraic structure and satisfy its constraints. Since patterns allow logical variables and constraints over them, by using patterns, Krewriting becomes symbolic execution with the semantic rules of the language [3]. The SMT solver Z3 [18] is used in Kfor checking the satisfiability of the path constraints. Symbolic execution in Krelies on an automated transformation of both Kconfigurations and K rules into corresponding symbolic Kconfigurations (i.e., patterns) and symbolic Krules that capture all required symbolic ingredients: symbolic values for data structure fields and program variables; path conditions that constrain the variables in cells; multiple branches when a condition is reached during execution, etc. The transformed, symbolic rules define how symbolic configurations are rewritten during computation. Roughly speaking, each data structure field and program variable originally holds an initial, symbolic value. Then, by symbolically executing a program statement, the configuration cells (such as k, env and heap in the example above) are updated by mapping fields and variables to new symbolic values that are represented as symbolic expressions, while the path conditions (stored in the path-condition cell) are correspondingly updated at each branching point. For instance, the following pattern *htv(int,0)ik h··· x7→ x,s7→ s···ienv h··· s7→ (size 7→ ?s.size,capacity 7→ ?s.capacity)···iheap +cfgs6=NULL ∧?s.size >0path-condition 1K’s backend is currently being ported into Java, and K4.0 is expected to be released when the Java backend is deemed a suitable complete replacement for Maude. specifies the set of configurations as follows: (1) the kcell contains the integer value 0; (2) in the env cell, program variable x(in typographic font) is associated to the memory address xand sis bound to the pointer s; and (3) in the heap cell, the field size of scontains the symbolic value ?s.size (symbolic values are preceded by a question mark). Finally, sis not null and the value of its size field is greater than 0. In this paper, we redesign the technique of [1] for discovering specifications for heap-manipulating programs by adapting the symbolic infrastructure of Kto support the specification inference process for KERNELC programs. Specification inference is the task of discovering high-level specifications that closely describe the program behavior. Given a program P, the specification discovery problem for P is typically described as the problem of inferring a likely specification for every function min Pthat uses I/O primitives and/or modifies the state of encapsulated, dynamic data structures defined in the program. Following the standard terminology, any such function mis called a modifier. The intended specification for mis to be cleanly expressed by using any combination of the non-modifier functions of P(i.e., functions, called observers), which inspect the program state and return values expressing some information about the encapsulated data. However, because the C language does not enforce data encapsulation, we cannot assume purity of any function: every function in the program can potentially change the execution state, including the heap component of the state. In other words, any function can potentially be a modifier; hence we simply define an observer as any function whose return type is different from void (i.e., potentially expresses a property concerning the final heap contents or the return value of the function call). The key idea behind our inference methodology was originally described in [1]. Given a modifier procedure for which we desire to obtain a specification, we start from an initial symbolic state sand symbolically evaluate mon sto obtain as a result a set of pairs (s,s0)of initial and final symbolic states, respectively. Then, the observer methods in the program are used to explain the computed final symbolic states. This is achieved by analyzing the results of the symbolic execution of each observer method owhen it is fed with (suitable information that is easily extracted from) sand s0. More precisely, for each pair (s,s0)of initial and final states, a pre/post statement is synthesized where the precondition is expressed in terms of the observers that explain the initial state s, whereas the postcondition contains the observers that explain the final state s0. To express a (partial) observational abstraction or explanation for (the constraints in) a given state in terms of the observer o, our criterion is that ocomputes the same symbolic values at the end of all its symbolic execution branches. In contrast to [1], in this work we rely on the newly defined symbolic machinery for K, while [1] was built on a symbolic infrastructure for KERNELC that we manually developed in a quite ad-hoc and error prone way, by reusing some spare features of the formal verifier MatchC [23]. This strategic technological change will allow us to define a generic and more robust framework for the inference of specifications of languages defined within the Kframework. Also differently from [1], here we fully use the lazy initialization approach of [2] in order to deal with complex data structures and pointers, which were only partially adopted in our previous work. With lazy initialization, the first time an uninitialized field or reference is accessed, instead of considering all the possible instances of these data structures, the execution is non-deterministically branched by simply initializing the field to the different scenarios: the field is null, points to a new object with uninitialized fields, or points to an already created object. Contributions We summarize the main contributions of this paper as follows: • In the current Ksystem, we revisit the approach to extract lightweight specifications from heapmanipulating code of [1], which consists of a symbolic analysis that explores and summarizes the behavior of a modifier routine by using other available routines in the program, called observers. This corresponds to the primary motivation for this work: to migrate the specification discovery technique of [1] to the holistic framework of the latest Krelease, which is based on symbolic execution, whereas [1] relied on the MatchC verification infrastructure of the old Kplatform, which is currently unsupported. • We adapt the symbolic mechanism of Kto deal with KERNELC, also adapting and implementing the lazy initialization technique for manipulating complex KERNELC input data. • We implement our specification inference technique in the KINDSPEC 2.0 system, which fully builds on the capabilities of the SMT solver Z3 [18] to not only prove the (accumulated path) constraints as in Kbut also to incrementally simplify them on the fly. Moreover, the synthesized pre/post axioms are further simplified (to be given more compact representation) and are eventually presented in a more friendly sugared form that abstracts from any implementation details. Related work The wide interest in program specifications as helpers for other analysis, validation, and verification processes have resulted in numerous approaches for (semi-)automatic computation of different kinds of specifications. Specifications can be property oriented (i.e., described by pre-/post conditions or functional code); stateful (i.e., described by some form of state machine); or intensional (i.e., described by axioms), and can take the form of contracts, interfaces, summaries, assumptions, invariants, properties, component abstractions, process models, rules, graphs, automata, etc. In this work, we focus on input-output relations: given a precondition for the state, we infer which modifications in the state are implied, and we express the relations as logical implications that reuse the program functions themselves, thus improving comprehension since the user is acquainted with them. A thorough comparison with the related literature can be found in [1]. Here we only try to cover those lines of research that have influenced our work the most. Our axiomatic representation is inspired by [25], which relies on a model checker for symbolic execution and generates either Spec# specifications or parameterized unit tests. In contrast to [25], we take advantage of Ksymbolic capabilities to generate simpler and more accurate formulas that avoid reasoning with the global heap because the different pieces of the heap that are reachable from the function argument addresses are kept separate. Unlike our symbolic approach, Daikon [10] and DIDUCE [13] detect program invariants by extensive testing. Also, Henkel and Diwan [14] dynamically discover specifications for interfaces of Java classes by generalizing the results of automated tests runs as an algebraic specification. QUICKSPEC [6] relies on the automated testing tool QuickCheck to distill general laws that a Haskell program satisfies. Whereas Daikon discovers invariants that hold at existing program points, QUICKSPEC discovers equations between arbitrary terms that are constructed using an API, similarly to [14]. ABSSPEC [4] is a semantic-based inference method that relies on abstract interpretation and generates laws for Curry programs in the style of QUICKSPEC. A different abstract interpretation approach to infer approximate specifications is [24]. A combination of symbolic execution with dynamic testing is used in Dysy [8]. An alternative approach is based on inductive matching learning: rather than using test cases to validate a tentative specification, they are used as examples to induce the specification (e.g., [26,12]). Finally, Ghezzi et al. [11] infer specifications for container-like classes and express them as finite state automata that are supplemented with graph transformation rules. This work improves existing approaches in the literature in several ways. Thanks to the handling of MAUDE’s (hence K’s) equational attributes [7], algebraic laws such as associativity, commutatitvity, or identity are naturally supported in our approach, which 1) leads to simpler and more efficient specifications, and 2) makes it easy to reason about typed data structures such as lists (list concatenation is associative with identity element nil), multisets (bag insertion is associative-commutative with identity /0), and sets (set insertion is associative-commutative-idempotent with identity /0). As a further advantage w.r.t. [25], in our framework, the correctness of the delivered specifications can be automatically ensured by using the existing Kformal tools [20]. Since our approach is generic and not tied to the Ksemantics specification of KERNELC, we expect the methodology developed in this work to be easily extendable to other languages for which a Ksemantics is given. Plan of the Paper. In Section 2, we summarize the key concepts of the Kframework that are crucial for this work. Section 3introduces a running example that is used as a case study throughout the paper to discuss the adequacy and effectiveness of the proposed inference methodology. Section 4presents how we had to adapt the symbolic machinery of Kto support specification discovery. Finally, Section 5 describes our specification inference procedure and discusses directions for future work. 2 The KFramework In this section, we recall the fundamental concepts of the Ksemantic framework [22]. K[22] is a framework for engineering language semantics. Given a syntax and a semantics of a language, Kgenerates a parser, an interpreter, and formal analysis tools such as model checkers and deductive theorem provers at no additional cost. It also supports various backends, such as Maude and, experimentally, Coq. In other words, language semantics defined in Kcan be translated into Maude or Coq definitions. Complete formal program semantics for Scheme, Java 1.4, JavaScript, Python, Verilog, and C are currently available in K[20,22]. Program configurations are represented in Kas potentially nested structures of labeled cells (or containers) that represent the program state. They include a computation stack or continuation (named k), environments (env,heap), and a call stack (stack), among others. Kcells can be lists, maps, (multi)sets of computations, or a multiset of other cells. Computations carry “computational meaning” as special nested list structures that sequentialize computational tasks, such as fragments of a program. The part of the Kconfiguration structure for the KERNELC semantics that is relevant to this work is shown below. hKikhMapienvhLististackhMapiheap cfg Rules in Kstate how configurations (terms) evolve throughout the computation. Similarly to configurations, rules can also be graphically represented and are split in two levels. Changes in the current configuration (which is shown in the upper level) are explicitly represented by underlining the part of the configuration that changes. The new value that substitutes the one that changes is written below the underlined part. As an example, we show the KERNELC rule for assigning a value Vof type Tto the variable X. This rule uses three cells: k,env, and heap. The env cell is a mapping of variable names to their memory positions, whereas the heap cell binds the active memory positions to the actual values. Meanwhile, the kcell represents a stack of computations waiting to be run, with the left-most (i.e., top) element of the stack being the next computation to be undertaken. hX=tv(T,V)··· ikh··· X7→ X··· ienvh··· X7→ _··· iheap tv(T,V)tv(T,V) This rule states that, if the next pending computation (which may be a part of the evaluation of a bigger expression) consists of an assignment X=tv(T,V), then we look for Xin the environment (X7→ _) and we update the associated mapping in the memory with the new value Vof type T(tv(T,V)). The value tv(T,V)is kept at the top of the stack (it might be used in the evaluation of the bigger expression). The rest of the cell’s content in the rule does not undergo any modification (this is represented by the ··· card). This example rule reveals a useful feature of K: «rules only need to mention the minimum part of the configuration that is relevant for their operation». That is, only the cells read or changed by the rule have to be specified, and, within a cell, it is possible to omit parts of it by simply writing “··· ”. For example, the rule above emphasizes the interest in: the instruction X=tv(T,V)only at the beginning of the kcell, and the mapping from variable Xto its memory pointer Xat any position in the env cell. Except for the subterms that are explicitly identified, upon variable assignment everything is kept unchanged. The (desugared) Krule for KERNELC variable assignment is rule <k> X = tv(T,V) => tv(T,V) ...</k> <env>... X |-> pointer(X) ...</env> <heap>... pointer(X) |-> (_ => tv(T,V)) ...</heap> where the underscore stands for an anonymous variable. The ellipses are also part of the desugared K syntax and are used to replace the unnecessary parts of the cells. Hence, also in the desugared rule, the developers typically only mention the information that is absolutely necessary in their rules. 3 Running Example Our inference technique relies on the classification scheme developed in [17] for data abstractions, where a function (method) may be either a constructor, a modifier or an observer. A constructor returns a new object of the class from scratch (i.e., without taking the object as an input parameter). A modifier alters an existing class instance (i.e., it changes the state of one or more of the data attributes in the instance). An observer inspects the object and returns a value characterizing one or more of its state attributes. We do not assume the traditional premise of [17] that states that observer functions do not cause side effects on the state. This is because we want to apply our technique to any program, which may be written by third-party software producers that may not follow the observer purity discipline. Let us introduce the leading example that we use to describe the inference methodology developed in this paper: a KERNELC implementation of an abstract datatype for representing doubly-linked lists. Since the whole example includes a total of 13 methods, due to space restrictions we have chosen to comment on just one modifier and five observer methods (of which 2 are both modifiers and observers). Example 1 In the KERNELCprogram of Figure 1, we represent a doubly-linked list as a data structure (struct List) that contains some content (field data), a pointer to the previous element in the list (field prev), and another pointer to the succesive element in the list (field next). A call append(list,d) to the append function proceeds as follows: first, a new node new_node is allocated in memory; it is filled with the value dand its next pointer is initialized to NULL since it will become the last item in the list. Next, the function checks that the provided list list is not NULL, in which case it binds the next pointer of the final element of the list to the newly created node, and the prev pointer of the new node to the final node of list, then returns the pointer to the whole resulting list. Otherwise, when the input list list is null, then the prev pointer of new_node is initialized to NULL and the resulting full-fledged list that consists of one single element is simply returned. The observer function length traverses the list by visiting every node in order to count the number of elements in the list. The observer function head returns the data field of the first node of the list; last delivers the data field of the last node of the list, which is done by first invoking reverse(list) to #include <stdlib.h> struct List { void* data; struct List* next; struct List* prev; }; struct List* append(struct List* list, void* d) { struct List* new_node; struct List* final; new_node = (struct List*) malloc(sizeof( struct List)); new_node->data = d; new_node->next = NULL; if (list != NULL) { final = list; if (final != NULL) { while (final->next != NULL) final = final->next; } final->next = new_node; new_node->prev = final; return list; } else { new_node->prev = NULL; list = new_node; return list; } } int length(struct List* list) { int len; len = 0; while (list != NULL) { len = len + 1; list = list->next; } return len; } struct List* reverse(struct List* list) { struct List* final; final = NULL; while (list != NULL) { final = list; list = final->next; final->next = final->prev; final->prev = list; } return final; } void* head(struct List* list) { if (list != NULL) { while (list->prev != NULL) list = list->prev; } return list->data; } struct List* last(struct List* list) { struct List* reversed; reversed = reverse(list); return head(reversed); } int find(struct List* list, void* d) { int found; found = 0; while (list != NULL && !(found)) { if (list->data == d) found = 1; else list = list->next; } return found; } struct List* init(struct List* list) { struct List* aux; if (list != NULL) { if (list->next != NULL) { aux = list->next; while (aux->next->next != NULL) aux = aux->next; aux->next = NULL; } else list = NULL; return list; } Figure 1: KERNELC implementation of a doubly-linked list. compute a mirrored version of the parameter list and then accessing the data field of its first node. The function init(list) returns the same list after removing the last item of the list. Finally, the observer find looks for the provided dvalue in the list, and returns 1(which stands for true) if the dvalue is found; otherwise, the value 0(which stands for false) is returned. From the program code of Example 1, for each modifier function m, we aim to synthesize an axiomatic specification that consists of a set of implication formulas t1⇒t2, where t1and t2are conjunctions of equations of the form l=r. The left-hand side lof each equation can be either • a call to an observer function and then rrepresents the return value of that call; • the keyword ret, and then rrepresents the value returned by the modifier function mbeing observed. Informally, the statements on the left-hand and right-hand sides of the symbol ⇒are respectively satisfied before and after the execution of a function call to m. We adopt the standard primed notation for representing variable values after the execution. Example 2 Consider again the program of Example 1. The specification for the (modifier) function append that inserts an element dat the end of the list list is shown in Figure 2. The specification       length(list) = 0∧ reverse(list) = NULL ∧ find(list,d) = 0∧ init(list) = NULL ∧ last(list) = NULL       ⇒         length(list0) = 1∧ reverse(list0) = list ∧ find(list0,d) = 1∧ init(list0) = NULL ∧ last(list0) = d∧ ret =list0         length(list) = x∧ length(list)>0⇒    length(list0) = x+1∧ find(list0,d) = 1∧ last(list0) = d∧ ret =list0     Figure 2: Expected specification for the append(list,d) function call. consists of two implications stating the conditions that are satisfied before and after the execution of a symbolic function call append(list,d). The first formula can be read as follows: if, before executing append(list,d), the result of running length(list) is equal to 0, a call to find(list,d) returns 0 (since no value can be found in an empty list) and the results of executing reverse(list),init(list), and last(list) are all NULL (i.e., the list is empty), then, after executing append(list,d), the length of the augmented list is 1, the reversed list coincides with the list itself, the value dcan now be found in the list, the init segment of the list is NULL, the last element is the inserted value and the call returns the pointer to the (augmented) list. The second formula represents the general case: given a list with an arbitrary (positive) size x, the call append(list,d) causes the length to be increased by 1, the inserted value is found in the list, in particular it is returned by the last observer, and the (augmented) list is returned. Since the append function does not restrict the insertion to the cases in which the dvalue is still not inside the list, we cannot assume find to return 0 before running the modifier function append. Note that any implication formula in the specification may contain multiple facts (in the pre- or postcondition) that refer to function calls that are assumed to be run independently under the same initial conditions. This avoids making any assumptions about function purity or side-effects. 4 Symbolic Execution in the KFramework Symbolic execution consists of executing programs with symbolic values instead of concrete values. It proceeds like standard execution except that, when a function or routine is called, symbolic values are assigned to the actual parameters of the call and computed values become symbolic expressions that record all operations being applied. When symbolic execution reaches a conditional control flow statement, every possible execution path from this execution point must be explored. In order to keep track of the explored execution paths, symbolic execution also records the assumed (symbolic) conditions on the program inputs that determine each execution path in the so-called path conditions (one per possible branch), which are empty at the beginning of the execution. A path condition consists of the set of constraints that the arguments of a given function must satisfy in order for a concrete execution of the function to follow the considered path. Without loss of generality, we assume that the symbolically executed functions access no global variables; they could be easily modeled by passing them as additional function arguments. Example 3 Consider again the append function of Example 1. Assume that the input values for the actual parameters list and dare the symbolic pointer list and the symbolic value ?d, respectively. Then, when the symbolic execution reaches the first if statement in the code, it explores the two paths arising from considering both the satisfaction and non-satisfaction of the guard in the conditional branching statement. The path condition of the first branch is updated with the constraint list 6=NULL, whereas list =NULL is added to the path condition in the second branch. To summarize, symbolic execution can be represented as a tree-like structure where each branch corresponds to a possible execution path and has an associated path condition. The successful paths are those leading to a final (symbolic) configuration that encloses a satisfiable path constraint and that typically stores a (symbolic) computed result. For the symbolic execution of KERNELC programs, we must pay attention to pointer dereference and initialization. In C, a structured datatype (struct) is an aggregate type that is used to comprise a nonempty set of sequentially allocated member objects2, called fields, each of which has a name and a type. When a struct value is created, C uses the address of its first field to refer to the whole structure. In order to access a specific field fof the given structure type, C computes f’s address by adding an offset (the sum of the sizes of each preceding field in the definition) to the address of the whole structure. In our symbolic setting, the pointer arithmetics and memory layout machinery are abstracted by 1) using symbolic variables as addresses, and 2) mapping each structure object into a single element of the heap cell that groups all object fields (and associated values). A specific field is then accessed by combining the identifiers of both the structure object and the field name. Example 4 Consider the structure type List of Example 1. The following configuration records a list variable lwith: 1) the integer 7 in its data field; 2) a reference (pointer) named first_node as the value of its prev field; and 3) a reference (pointer) third_node as the value of its next field: . . . hl7→ lienvh··· l7→ (data 7→ tv(int,7),prev 7→ first_node,next 7→ third_node)···iheap . . . cfg In order to access a field of the list l(e.g., its data field), the corresponding index is computed by juxtaposing the identifier of the data field to the pointer l, thus mimicking how the concrete access would be done in C(i.e., l->data). 2An object in C is a region of data storage in the execution environment. [8] C. Csallner, N. Tillmann & Y. Smaragdakis (2008): DySy: Dynamic Symbolic Execution for Invariant Inference. In: Proc. 30th Int’l Conf. on Software Engineering (ICSE), ACM, pp. 281–290. 1 [9] C. Ellison & G. Ro¸su (2012): An Executable Formal Semantics of C with Applications. In: Proc. of the 39th Symp. on Principles of Programming Languages (POPL), ACM, pp. 533–544. 4 [10] M. D. Ernst, J. H. Perkins, P. J. Guo, S. McCamant, C. Pacheco, M. S. Tschantz & C. Xiao (2007): The Daikon System for Dynamic Detection of Likely Invariants.Sci. Comput. Program. 69(1-3), pp. 35–45. 1 [11] C. Ghezzi, A. Mocci & M. Monga (2009): Synthesizing Intensional Behavior Models by Graph Transformation. In: Proc. 3st Int’l Conf. on Software Engineering (ICSE), IEEE, pp. 430–440. 1 [12] D. Giannakopoulou & C. S. Pasareanu (2009): Interface Generation and Compositional Verification in Java- Pathfinder. In: Proc. 12th In’l Conf. on Fundamental Approaches to Software Engineering (FASE),LNCS 5503, Springer, pp. 94–108. 1 [13] S. Hangal & M. S. Lam (2002): Tracking down Software Bugs using Automatic Anomaly Detection. In: Proc. 22rd Int’l Conf. on Software Engineering (ICSE), ACM, pp. 291–301. 1 [14] J. Henkel & A. Diwan (2003): Discovering Algebraic Specifications from Java Classes. In: Proc. of European Conf. on Object-Oriented Programming (ECOOP), pp. 431–456. 1 [15] S. Khurshid, C. S. Pasareanu & W. Visser (2003): Generalized Symbolic Execution for Model Checking and Testing. In: Proc. of the 9th Int’l Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), pp. 553–568. 4 [16] J. C. King (1976): Symbolic execution and program testing.Commun. ACM 19(7), pp. 385–394. 1 [17] B. Liskov & J. Guttag (1986): Abstraction and specification in program development. MIT Press. 3 [18] L. M. de Moura & B. Nikolaj (2008): Z3: An Efficient SMT Solver. In: 14th Int’l Conf. on Tools and Algorithms for the Construction and Analysis of Systems (TACAS), pp. 337–340. 1,1,4.1 [19] C. S. Pasareanu & W. Visser (2009): A Survey of new Trends in Symbolic Execution for Software Testing and Analysis.International Journal on Software Tools for Technology Transfer 11(4), pp. 339–353. 1 [20] G. Ro¸su (2015): From Rewriting Logic, to Programming Language Semantics, to Program Verification. In: Logic, Rewriting, and Concurrency - Festschrift Symp. in Honor of José Meseguer, LNCS, Springer. To appear. 1,1,2 [21] G. Ro¸su, W. Schulte & T.-F. Serbanuta (2009): Runtime Verification of C Memory Safety. In: Runtime Verification (RV),LNCS 5779, pp. 132–152. 1 [22] G. Ro¸su & T.-F. Serbanuta (2010): An Overview of the KSemantic Framework.J. Log. Algebr. Program. 79(6), pp. 397–434. 2 [23] G. Ro¸su & A. Stefanescu (2011): Matching Logic: A New Program Verification Approach. In: Proc. of the 33rd Int’l Conf. on Software Engineering, ICSE 2011, ACM, pp. 868–871. 1 [24] M. Taghdiri & D.Jackson (2007): Inferring Specifications to Detect Errors in Code.Autom. Softw. Eng. 14(1), pp. 87–121. 1 [25] N. Tillmann, F. Chen & W. Schulte (2006): Discovering Likely Method Specifications. In: Proc. 8th Int’l Conf. on Formal Engineering Methods (ICFEM),LNCS 4260, Springer, pp. 717–736. 1 [26] J. Whaley, M. C. Martin & M. S. Lam (2002): Automatic extraction of object-oriented component interfaces. In: Proc. of the Int’l Symp. on Software Testing and Analysis (ISSTA), pp. 218–228. 1