Full text
Slicing Slices An Incremental Backward Trace Slicing Methodology for RWL Computations Master’s Thesis Presented by: Julia Sapi˜na Sanchis Supervisors: Mar´ıa Alpuente Frasnedo Francisco Frechina Navarro
Valencia – July 10th, 2013.
Abstract Execution traces are an important source of information for program understanding and debugging. However, they have as an important drawback that they are commonly huge and complex, making their manual analysis unfeasible. In this master’s thesis, we develop a trace slicing technique for rewriting logic computations together with its corresponding implementation in the iJulienne graphical tool. Such technique gives support to the analysis of complex, textually-large system computations in rewriting logic, which is a general framework efficiently implemented in the Maude language. Given a Maude execution trace Tand a slicing criterion for the trace (i.e., a piece of information that we want to observe in the final computation state), we traverse Tfrom back to front and the backward dependence of the observed information is incrementally computed at each execution step. At the end of the traversal, a simplified trace slice is obtained by filtering out all the irrelevant data that do not impact on the data of interest. By simplifying the trace, the iJulienne tool, which implements the proposed trace slicing technique, favors better inspection and debugging activities. iJulienne is also endowed with a trace querying mechanism that increases flexibility and reduction power and allows program runs to be examined at the appropriate level of abstraction. Keywords: trace slicing, rewriting logic, debugging, Maude. iii
Resumen Las trazas de ejecuci´on son una importante fuente de informaci´on para el entendimiento y depuraci´on de los programas. Sin embargo, poseen el importante inconveniente de ser habitualmente enormes y complejas, haciendo inviable su an´alisis manual. En esta tesis de m´aster se ha desarrollado una t´ecnica de fragmentaci´on de trazas para computaciones en l´ogica de reescritura junto con su correspondiente implementaci´on en la herramienta gr´afica iJulienne. Dicha t´ecnica da soporte al an´alisis de extensas y complejas computaciones en l´ogica de reescritura, que es un marco formal muy general eficientemente implementado en el lenguaje Maude. Dada una traza de ejecuci´on de Maude Ty un criterio de fragmentaci´on para la traza (es decir, un fragmento de informaci´on que se desea observar en el estado final de la computaci´on), nuestra t´ecnica recorre Tde atr´as hacia adelante a la vez que calcula la dependencia hacia atr´as de la informaci´on observada de forma incremental en cada paso de ejecuci´on. Al final del recorrido se obtiene una traza fragmentada simplificada al filtrar toda la informaci´on irrelevante que no afecta a los datos de inter´es. Al simplificar la traza, la herramienta iJulienne, que implementa la t´ecnica de fragmentado propuesta, favorece un mejor an´alisis y depuraci´on de las trazas manipuladas. iJulienne est´a adem´as dotada de un mecanismo de consulta de la traza que incrementa la flexibilidad y poder de reducci´on y permite examinar las ejecuciones de programas en el nivel apropiado de abstracci´on. Palabras clave: fragmentaci´on de trazas, l´ogica de reescritura, depuraci´on, Maude. v
Resum Les traces d’execuci´o s´on una important font d’informaci´o per a l’enteniment i depuraci´o dels programes. No obstant aix`o, posseeixen l’important inconvenient de ser habitualment enormes i complexes, fent inviable la seua an`alisi manual. En aquesta tesi de m`aster s’ha desenvolupat una t`ecnica de fragmentaci´o de traces per computacions en l`ogica de reescriptura juntament amb la seua corresponent implementaci´o en l’eina gr`afica iJulienne. L’esmentada t`ecnica d´ona suport a l’an`alisi de complexes i extenses computacions en l`ogica de reescriptura, que ´es un marc formal molt general eficientment implementat en el llenguatge Maude. Donada una tra¸ca d’execuci´o de Maude Ti un criteri de fragmentaci´o per la tra¸ca (´es a dir, un fragment d’informaci´o que es vol observar en l’estat final de la computaci´o), la nostra t`ecnica es recorre Tde darrere cap endavant al mateix temps que ses calcula la depend`encia cap enrere de la informaci´o observada es calcula de forma incremental en cada pas d’execuci´o. Al final del recorregut s’obt´e una tra¸ca fragmentada simplificada en filtrar tota la informaci´o irrellevant que no afecta les dades d’inter`es. En simplificar la tra¸ca, l’eina iJulienne, que implementa la t`ecnica de fragmentaci´o proposta, afavoreix una millor an`alisi i depuraci´o de les traces manipulades. L’eina iJulienne est`a a m´es dotada d’un mecanisme de consulta de la tra¸ca que incrementa la flexibilitat i poder de reducci´o i permet examinar les execucions de programes en el nivell apropiat d’abstracci´o. Paraules clau: fragmentaci´o de traces, l`ogica de reescriptura, depuraci´o, Maude. vii
Contents Page Introduction 1 Preliminaries 9 1 Backward Trace Slicing for Conditional Rewrite Theories 15 1.1 Term slices and term slice concretizations . . . . . . . . . . . . 15 1.2 Backward Slicing for Execution Traces . . . . . . . . . . . . . 17 1.3 The function slice-step ...................... 20 1.4 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . 25 2 Slicing-based Trace Analysis of Rewriting Logic Specifications with iJulienne 27 2.1 Incremental Trace Slicing . . . . . . . . . . . . . . . . . . . . . 27 2.2 The iJulienne Online Trace Analyzer . . . . . . . . . . . . . 30 2.2.1 Features and Characteristics of iJulienne ....... 30 2.2.2 The System Architecture of iJulienne ......... 31 2.2.3 Trace Querying . . . . . . . . . . . . . . . . . . . . . . 32 2.2.4 Program Slicing . . . . . . . . . . . . . . . . . . . . . . 37 2.3 iJulienne atwork........................ 38 2.3.1 Debugging the Blocks World Example . . . . . . . . . 39 2.3.2 Analyzing a Webmail Application . . . . . . . . . . . . 42 2.4 Experimental Evaluation . . . . . . . . . . . . . . . . . . . . . 45 Conclusions and future work 49 ix
Introduction 4 Related Work Tracing techniques have been extensively used in the past in functional debugging [CRW00]. Hat [CRW00] is an interactive debugging system that enables a computation to be explored backwards, starting from the program output or an error message (with which the computation aborted). Backward tracing in Hat is carried out by navigating a redex trail (i.e., a graphlike data structure that records dependencies among function calls), whereas the tracing technique described in this thesis does not require handling any supplementary data structure. In recent years, the debugging and optimization techniques based on RWL have received growing attention. There exist very few approaches that address the problem of tracing rewrite sequences in term rewrite systems [ABER11, BKdV00, FT94, BKdV03], and all of them apply to unconditional systems. The techniques in [ABER11, BKdV00, BKdV03] rely on a labeling relation on symbols that allows data content to be traced back within the computation; this is achieved in [FT94] by formalizing a notion of dynamic dependence among symbols by means of contexts. In [BKdV00, BKdV03], non-left linear and collapsing rules are not considered or are dealt using adhoc strategies, while our approach requires no special treatment of such rules. Furthermore, only [ABER11] describes a tracing methodology for rewrite theories with rules, equations, sorts, and algebraic axioms. However, the only trace slicing technique that gives support to the analysis of RWL computations is [ABER11]. Given an execution trace T, [ABER11] generates a trace slice of Tw.r.t. a set of symbols of interest (target symbols) that appear in a given state of T. Unfortunately, the technique in [ABER11] is only applicable to unconditional RWL theories, and hence it cannot be employed when the source program includes conditional equations and/or rules since it would deliver incorrect and/or incomplete trace slices. The following example illustrates why conditions cannot be disregarded by the slicing process, which is what motivated [ABFR12a, ABFR12b] and gave rise to our last work [ABFS13b]. Example A Consider the Maude specification of the function _mod_ in Figure 1, which computes the reminder of the division of two natural numbers, and the associated execution trace 4 mod 5 →4. Assume that we are interested in observing the origins of the target symbol 4that appears in the final state.
Introduction 5 If we disregard the condition Y>Xof the first conditional equation, the slicing technique of [ABER11] computes the trace slice 4 mod • → 4, which is not correct since there exists concrete instances of 4 mod •that cannot be rewritten to 4using the first rule (e.g., 4 mod 3 94). mod M is inc NAT . var X : Nat . var Y : NzNat . op _mod_ : Nat NzNat -> Nat . ceqXmodY=XifY>X. ceq X mod Y = (X - Y) mod Y ifY<=X. endm Figure 1: The mod operator By contrast, the methodology of [ABFR12a, ABFS13b] produces the correct trace slice 4 mod 5 →4, since both arguments of mod are required to prove the rewrite step that introduces the symbol 4in the final state. Regarding slicing tools, among the first developed [HKF95] was Spyder [ADS93], which combined several techniques in order to assist the user in the debugging task. The slicing part of Spyder [Agr91], which was only capable to compute backward slices, was based on graph reachability and dependence graphs algorithms applied on the instrumented version of the original code being debugged [HKF95]. More recently, a source-level tracer for the functional programming language Haskell [HHJW07], has been developed in the Hat system [CRW00],. Hat grants the user access to exhaustive information about the observed computation by first executing the program to be debugged and storing the resulting trace in a file. Then, several slicing-based viewing tools (e.g., Hat-trail, Hat-explore,Hat-detect) can be used to explore the stored trace. Similarly to Spyder, this task is carried out by navigating a graph-like, supplementary data structure. HaSlicer [RB06] is a prototype of a slicer for functional programs written also in Haskell that is used for the identification of possible coherent components from (functional) monolithic legacy code. Both backward and forward dependency slicing are covered by HaSlicer, which is proposed as a support tool for the software architect to manually improve program understanding,
Introduction 6 and automatically discover software components. The latter is particularly useful as an architecture understanding technique in earlier phases of a reengineering process. Mercury [HCS+96] is a functional logic language that extends Haskell with logical capabilities and has his own slicing-based debugging tool, the Mercury declarative debugger [Mac05]. This debugger records an annotated trace that serves as source for constructing an EDT (evaluation dependence tree) that is searched by the main slicing algorithm implemented in the tool. To the best of our knowledge, Julienne [ABFR12b] was the first trace slicing tool for Maude, which has been greatly improved in the iJulienne [ABFS13b] system, the new and improved implementation with incremental slicing capabilities presented in this thesis. In contrast to Spyder and HaSlicer,iJulienne is based on trace slicing rather than program slicing, and needs much less storage to perform flow-back analysis, as it requires neither the construction of data and control dependency graphs nor the creation and maintenance of the execution history. Contributions This master’s thesis developes the first conditional trace slicing technique for RWL computations [ABFR12a] together with an enhanced trace slicing methodology called incremental slicing and its corresponding implementation [ABFS13b]. The proposed methodology is fully general and can be applied for debugging as well as for optimizing any RWL-based tool that manipulates conditional RWL computations such as those delivered as counterexample traces by the Maude model-checker [BM12]. The contributions of this master’s thesis can be summarized as follows: We have developed a novel and enhanced incremental trace slicing technique that we implemented in our tool iJulienne [ABFS13b]. We present iJulienne, which is the first a slicing-based trace analysis tool that assists the user in the comprehension and debugging of RWL theories that are encoded in Maude. iJulienne is built on top of a trace slicer that implements the backward conditional trace slicing algorithm described in [ABER11, ABFR12a]. Roughly speaking, the trace slicing mechanism included in iJulienne rolls back the program execution (making all the rewrite and equational simplification steps
Introduction 7 explicit) while tracking back only and all data in the trace that are needed to accomplish the selected slicing criterion, that is, the data that contribute to producing the set of target symbols that occur in the observed state of the trace. In other words, the trace slicer takes as input a Maude execution trace Tand a slicing criterion Sand yields as output a trace slice T?in which the pieces of information that are not antecedents of the selected target symbols in Sare simply discarded from T. The core trace slicer included within iJulienne is a totally redesigned implementation of the slicing technique in [ABER11, ABFR12a] that supersedes and greatly improves the preliminary system presented in [ABFR12b]. The original algorithm implemented in [ABFR12b] was developed under the assumption that the user examines and slices the entire trace w.r.t. the fixed slicing criterion one time, in a nonincremental way. In contrast, the slicing criterion in iJulienne can be dynamically changed, which allows the user a step-wise focus on the information that the user wants to observe at any rewrite step. The main features provided by the trace analyzer iJulienne are listed below. (a) iJulienne is equipped with an incremental backward trace slicing algorithm that supports step-wise refinements of the trace slice and achieves huge reductions in the size of the trace. Starting from a Maude execution trace T, a slicing criterion Scan be attached to any given state of the trace and the computed trace slice T?can be repeatedly refined by applying backward trace slicing w.r.t. increasingly restrictive versions of S. (b) The system supports a cogent form of dynamic program slicing [KL88] as follows. Given a Maude program Mand a trace slice T? for M,iJulienne is able to infer the minimal fragment of M(i.e., the program slice) that is needed to reproduce T?. This is done by uncovering statement dependences among computationally related parts of the program via backward trace slicing. This feature greatly facilitates the debugging of faulty Maude programs, since the user can generate a sequence of increasingly smaller program slices that gradually shrinks the area that contains the buggy piece of code.
Introduction 8 (c) iJulienne is endowed with a powerful and intuitive Web user interface that allows the slicing criteria to be easily defined by either highlighting the chosen target symbols or by applying a user-defined filtering pattern. A browsing facility is also provided that enables forward and backward navigation through the trace (and the trace slice) and allows the user to examine all the information that is involved within each state transition (and its corresponding sliced counterpart) for debugging and comprehension purposes. The user interface can be tuned to provide distinct abstract views of the trace that aim at supporting different program comprehension levels. For instance, this includes hiding or displaying the auxiliary transformations that are used by Maude to handle associative and commutative operators. Plan of the thesis Following some preliminaries, the backward slicing technique presented in [ABFR12a, ABFR12b] is recalled in Chapter 1. In Chapter 2, we present iJulienne [ABFS13b], our online trace analyzer that implements the proposed slicing technique and we discuss the most relevant technical details together with some benchmarks that assess the practicality of the tool. Two different sessions working with the tool are illustrated also in this chapter. Finally, some conclusions and directions for future work are presented in the last chapter.
Preliminaries Let us recall some important notions that are relevant to this work. We assume some basic knowledge of term rewriting [BKdV03] and Rewriting Logic [Mes92]. Some familiarity with the Maude language [CDE+11] is also required. We consider an order-sorted signature Σ, with a finite poset of sorts (S, <) that models the usual subsort relation [CDE+11]. We assume an S-sorted family V={Vs}s∈Sof disjoint variable sets. τ(Σ,V)sand τ(Σ)sare the sets of terms and ground terms of sort s, respectively. We write τ(Σ,V) and τ(Σ) for the corresponding term algebras. The set of variables that occur in a term tis denoted by Var(t). In order to simplify the presentation, we often disregard sorts when no confusion can arise. Aposition win a term tis represented by a sequence of natural numbers that addresses a subterm of t(Λ denotes the empty sequence, i.e., the root position). By notation w1.w2, we denote the concatenation of positions (sequences) w1and w2. Positions are ordered by the prefix ordering, that is, given the positions w1and w2,w1≤w2if there exists a position xsuch that w1.x =w2. Given a set of positions P, the prefix closure of Pis the set ¯ P={u|u≤p∧p∈P}. Given a term t, we let Pos(t) denote the set of positions of t. By t|w, we denote the subterm of tat position w, and by t[s]w, we denote the result of replacing the subterm t|wby the term s. A substitution σis a mapping from variables to terms {X1/t1, . . . , Xn/tn} such that Xiσ=tifor i= 1, . . . , n (with Xi6=xjif i6=j), and Xσ =Xfor all other variables X. Given a substitution σ={X1/t1, . . . , Xn/tn}, the domain 9
Preliminaries 10 of σis the set Dom(σ) = {X1, . . . , Xn}. For any substitution σand set of variables V,σ|`Vdenotes the substitution obtained from σby restricting its domain to V(i.e., σ|`V(X) = Xσ if X∈V, otherwise σ|`V(X) = X). Given two terms sand t, a substitution σis a matcher of tin s, if sσ =t. By matchs(t), we denote the function that returns a matcher of tin sif such a matcher exists, otherwise matchs(t) returns fail. An equational condition bis an equation t=t0with t, t0∈τ(Σ,V). This includes both, ordinary equations and abbreviated boolean equations b=true, with b∈τ(Σ,V) of sort Bool. A matching condition is a pair p:= e with e, p ∈τ(Σ,V). A rewrite expression is a pair e⇒p, with e, p ∈τ(Σ,V). Aconditional equation is an expression of the form λ=ρif C, where λ, σ ∈τ(Σ,V), and Cis a (possibly empty) sequence c1∧. . . ∧cn, where each ciis either an equational condition, or a matching condition. When the condition Cis empty, we simply write λ=ρ. A conditional equation λ=ρif c1∧. . . ∧cnis admissible, iff (i) Var(ρ)⊆ Var(λ)∪Sn i=1 Var(ci), and (ii) for each ci,Var(ci)⊆ Var(λ)∪Si−1 j=1 Var(cj) if ciis an equational condition, and Var(e)⊆ Var(λ)∪Si−1 j=1 Var(cj) if ciis a matching condition p:= e. Aconditional rule is an expression of the form λ→ρif C, where λ, σ ∈ τ(Σ,V), and Cis a (possibly empty) sequence c1∧. . . ∧cn, where each ci is an equational condition, a matching condition, or a rewrite expression. When the condition Cis empty, we simply write λ→ρ. A conditional rule λ→ρif c1∧. . . ∧cnis admissible iff it fulfils the exact analogous of the admissibility constraints (i) and (ii) for the equational conditions and the matching conditions, plus the following additional constraint: for each rewrite expression ciin Cof the form e⇒p,Var(e)⊆ Var(λ)∪Si−1 j=1 Var(cj). The set of variables that occur in a (conditional) rule/equation r is denoted by Var(r). Note that admissible equations and rules can contain extra-variables (i.e., variables that appear in the right-hand side or in the condition of a rule/equation but do not occur in the corresponding left-hand side). The admissibility requirements ensure that all the extra-variables will become instantiated whenever an admissible rule/equation is applied.
Preliminaries 11 Conditional Rewriting Modulo Equational Theories An order-sorted equational theory is a pair E= (Σ,∆∪B), where Σ is an order-sorted signature, ∆ is a collection of (oriented) admissible, conditional equations, and Bis a collection of unconditional equational axioms (e.g., associativity, commutativity, and unity) that can be associated with any binary operator of Σ. The equational theory Einduces a congruence relation on the term algebra T(Σ,V), which is denoted by =E. A conditional rewrite theory (or simply, rewrite theory) is a triple R= (Σ,∆∪B, R), where (Σ,∆∪B) is an order-sorted equational theory, and Ris a set of admissible conditional rules1. Example B The following Maude rewrite theory defines a simple banking system. It includes three conditional rules: credit,debit, and transfer. mod BANK is inc INT . sorts Account Msg State Id . subsorts Account Msg < State . var Id Id1 Id2 : Id . var bal bal1 bal2 newBal newBal1 newBal2 M : Nat . op empty-state : -> State . op _;_ : State State -> State [assoc comm id: empty-state] . op <_|_> : Id Nat -> Account [ctor] . ops credit debit : Id Nat -> Msg [ctor] . op transfer : Id Id Nat -> Msg [ctor] . crl [credit] : <Id|bal>;credit(Id,M) => <Id|newBal> if newBal := bal + M . crl [debit] : <Id|bal>;debit(Id,M) => <Id|newBal> if bal >= M /\ newBal := bal - M . crl [transfer] : <Id1|bal1>;<Id2|bal2>;transfer(Id1,Id2,M) => <Id1|newBal1>;<Id2|newBal2> if <Id1|bal1>;debit(Id1,M) => <Id1|newBal1> /\ <Id2|bal2>;credit(Id2,M) => <Id2|newBal2> . endm 1Equational specifications in Maude can be theories in membership equational logic, which may include conditional membership axioms not addressed in this paper.
Preliminaries 12 The rule credit contains a matching condition newBal := bal + M. The rule debit contains an equational condition bal >= M and a matching condition newBal := bal - M. Finally, the rule transfer has a rule condition that contains two rewrite expressions: <Id1|bal1> ; debit(Id1,M) => <Id1|newBal1> and <Id2|bal2> ; credit(Id2,M) => <Id2|newBal2>. Given a conditional rewrite theory (Σ, E, R), with E= ∆ ∪B, the conditional rewriting modulo Erelation (in symbols, →R/E) can be defined by lifting the usual conditional rewrite relation on terms [Klo92] to the E- congruence classes [t]Eon the term algebra τ(Σ,V) that are induced by =E[BM06], that is, [t]Eis the class of all terms that are equal to tmodulo E. Unfortunately, →R/E is in general undecidable, since a rewrite step t→R/E t0 involves searching through the possibly infinite equivalence classes [t]Eand [t0]E. The conditional slicing technique formalized in this work is formulated by considering the precise way in which Maude proves the conditional rewriting steps (see Section 5.2 in [CDE+11]). Actually, the Maude interpreter implements conditional rewriting modulo Eby means of two much simpler relations, namely →∆,B and →R,B, that allow rules and equations to be intermixed in the rewriting process by simply using an algorithm of matching modulo B. We define →R∪∆,B as →R,B ∪ →∆,B. Roughly speaking, the relation →∆,B uses the equations of ∆ (oriented from left to right) as simplification rules: thus, for any term t, by repeatedly applying the equations as simplification rules, we eventually reach a term t↓∆to which no further equations can be applied. The term t↓∆is called a canonical form of t w.r.t. ∆. On the other hand, the relation →R,B implements rewriting with the rules of R, which might be non-terminating and non-confluent, whereas ∆ is required to be terminating and Church-Rosser modulo Bin order to guarantee the existence and unicity (modulo B) of a canonical form w.r.t. ∆ for any term [CDE+11]. Formally, →R,B and →∆,B are defined as follows. Given a rewrite rule r= (λ→ρif C)∈R(resp., an equation e= (λ=ρif C)∈∆), a substitution σ, a term t, and a position wof t,tr,σ,w →R,B t0(resp., te,σ,w →∆,B t0) iff λσ =Bt|w,t0=t[ρσ]w, and Cevaluates to true w.r.t σ. When no confusion can arise, we simply write t→R,B t0(resp. t→∆,Bt0) instead of tr,σ,w →R,B t0 (resp. te,σ,w →∆,B t0). Note that the evaluation of a condition Cis typically a recursive process,
Preliminaries 13 since it may involve further (conditional) rewrites in order to normalize C to true. Specifically, an equational condition eevaluates to true w.r.t. σ if eσ ↓∆=Btrue; a matching equation p:= tevaluates to true w.r.t. σif pσ =Btσ↓∆; a rewrite expression t⇒pevaluates to true w.r.t. σif there exists a rewrite sequence tσ →∗ R∪∆,B u, such that u=Bpσ2. Although rewrite expressions and matching/equational conditions can be intermixed in any order, we assume that their satisfaction is attempted sequentially from left to right, as in Maude. Under appropriate conditions on the rewrite theory, a rewrite step modulo Eon a term tcan be implemented without loss of completeness by applying the following rewrite strategy [DM10]: (i) reduce tw.r.t. →∆,B until the canonical form t↓∆is reached; (ii) rewrite t↓∆w.r.t. →R,B. An execution trace Tin the rewrite theory (Σ,∆∪B, R) is a rewrite sequence s0→∗ ∆,B s0↓∆→R,B s1→∗ ∆,B s1↓∆. . . that interleaves →∆,B rewrite steps and →R,B steps following the strategy mentioned above. Given an execution trace T, it is always possible to expand Tin an instrumented trace T0in which every application of the matching modulo Balgorithm is mimicked by the explicit application of a suitable equational axiom, which is also oriented as a rewrite rule [ABER11]. This way, any given instrumented execution trace consists of a sequence of (standard) rewrites using the conditional equations (→∆), conditional rules (→R), and axioms (→B). Example C Consider the rewrite theory in Example B together with the following execution trace T:credit(A,2+3);<A|10> →∆,B credit(A,5);<A|10> →R,B <A|15>. Thus, the corresponding instrumented execution trace is given by expanding the commutative “step” applied to the term credit(A,2+3);<A|10> using the implicit rule (X;Y→Y;X) in Bthat models the commutativity axiom for the (juxtaposition) operator ; : credit(A,2+3);<A|10> →∆ credit(A,5);<A|10> →B<A|10>;credit(A,5) →R<A|15> 2Technically, to properly evaluate a rewrite expression t⇒por a matching condition p:= t, the term pis required to be a ∆-pattern —i.e., a term psuch that, for every substitution σ, if xσ is a canonical form w.r.t. ∆ for every x∈Dom(σ), then pσ is also a canonical form w.r.t. ∆.
Backward Trace Slicing for Conditional Rewrite Theories 20 1.3 The function slice-step The function slice-step, which is outlined in Figure 1.1, takes as input three parameters, namely, a rewrite step µ:sr,σ,w →t(with r=λ→ρif C2), a term slice t•of t, and a compatibility condition B• prev; and delivers the term slice s•and a new compatibility condition B•. Within the algorithm slice-step, we use an auxiliary operator h|σ1, σ2|i that refines (overrides) a substitution σ1 with a substitution σ2, where both σ1and σ2may contain •-variables. The main idea behind h| ,|i is that, for the slicing of the step µ, all variables in the applied rewrite rule rare na¨ıvely assumed to be initially bound to irrelevant data •, and the bindings are incrementally refined as we (partially) solve the conditions of r. function slice-step(sr,σ,w →t, t•, B• prev) 1.if w6∈ MPos(t•) 2.then 3. s•=t• 4. B•=B• prev 5.else 6. θ ={x/fresh•|x∈V ar(r)} 7. ρ•=slice(ρ, MPos(t• |w)) 8. ψρ=h|θ, matchρ•θ(t• |w)|i 9.for i=ndownto 1do 10.(ψi, B• i) = process-condition(ci, σ, h|ψρ, ψn...ψi+1|i) 11.od 12. s•=t•[λh|ψρ, ψn...ψ1|i]w 13. B•= (B• prev ∧B• n... ∧B• 1)(ψ1ψ2. . . ψn) 14.fi 15.return (s•, B•) Figure 1.1: Backward step slicing function. 2Since equations and axioms are both interpreted as rewrite rules in our formulation, we often abuse the notation λ→ρif Cto denote rules as well as (oriented) equations and axioms.
Backward Trace Slicing for Conditional Rewrite Theories 21 Definition 1.3.1 (refinement) Let σ1and σ2be two substitutions. The refinement of σ1w.r.t. σ2is defined by the operator h| ,|i as follows: h|σ1, σ2|i = σ|`Dom(σ1),where xσ = xσ2if x∈Dom(σ1)∩Dom(σ2) xσ1σ2if x∈Dom(σ1)\Dom(σ2)∧σ26=fail xσ1otherwise Note that h|σ1, σ2|i differs from the (standard) instantiation of σ1with σ2. We write h|σ1, . . . , σn|i as a compact denotation for h|h| . . . h|σ1, σ2|i, . . . , σn−1|i, σn|i. Example 1.3.2 Let σ1={x/•1, y/•2}and σ2={x/a, •2/g(•3), z/5}be two substitutions. Thus, h|σ1, σ2|i ={x/a, y/g(•3)}. Roughly speaking, the function slice-step works as follows. When the rewrite step µoccurs at a position wthat is not a meaningful position of t• (in symbols, w6∈ MPos(t•)), trivially µdoes not contribute to producing the meaningful symbols of t•. Therefore, the function returns s•=t•, with the input compatibility condition B• prev. Example 1.3.3 Consider the Maude specification of Example B and the following rewrite step µ:(<a|30>;debit(a,5));credit(a,3) debit →<a|25>;credit(a,3). Let •1;credit(a,3) be a term slice of <a|25>;credit(a,3). Since the rewrite step µoccurs at position 1 6ıMPos(•1;credit(a,3)), the term <a|25> introduced by µin <a|25>;credit(a,3) is completely ignored in •1;credit(a,3). Hence, the computed term slice for (<a|30>;debit(a,5)); credit(a,3) is the very same •1;credit(a,3). On the other hand, when w∈ MPos(t•), the computation of s•and B•involves a more in-depth analysis of the rewrite step, which is based on an inductive refinement process that is obtained by recursively processing the conditions of the applied rule. More specifically, we initially define the substitution θ={x/fresh•|x∈V ar(r)}that binds each variable in rto a fresh •-variable. This corresponds to assuming that all the information in µ, which is introduced by the substitution σ, can be marked as irrelevant. Then, θis incrementally refined using the following two-step procedure.
Backward Trace Slicing for Conditional Rewrite Theories 22 function process-condition(c, σ, θ) 1.case cof 2.(p:= t)∨(t⇒p): 3.if (tσ =pσ) 4.then return ({}, true)fi 5. Q =MPos(pθ) 6.[t•→∗p•, B•] = backward-slicing(tσ →∗pσ, Q) 7. t•0=slice(t, MPos(t•)) 8. ψ =matcht•0θ(t•) 9. e : 10. ψ ={ } 12. B•=eθ 12.end case 13.return (ψ, B•) Figure 1.2: Condition processing function. Step 1. We compute the matcher matchρθ(t• |w), and then generate the refinement ψρof θw.r.t. matchρθ(t• |w) (in symbols, ψρ=h|θ, matchρθ(t• |w)|i). Roughly speaking, the refinement ψρupdates the bindings of θwith the meaningful information extracted from t• |w. Example 1.3.4 Consider the rewrite theory in Example B together with the following rewrite step µdebit :<a|30>;debit(a,5) debit →<a|25> that involves the application of the debit rule whose right-hand side is ρdebit =<Id|newBal>. Let t•=<a|•1>be a term slice of <a|25>. Then, the initially ascertained substitution for µis θ={Id/•2,bal/•3,M/•4, newBal/•5}, and matchρdebitθ(t•) = match<•2|•5>(<a|•1>) = {•2/a, •5/•1}. Thus, the substitution ψρdebit =h|θ, ψρdebit |i ={Id/a,bal/•3, M/•4,newBal/•1}. That is, ψρdebit refines θby replacing the uninformed binding Id/•2,with Id/a. Step 2. Let Cσ =c1σ∧. . . ∧cnσbe the instance of the condition in the rule rthat enables the rewrite step µ. Each (sub)condition ciσ,i=
Backward Trace Slicing for Conditional Rewrite Theories 23 1, . . . , n is processed, in reversed evaluation order, i.e., from cnσto c1σ, by using the auxiliary function process-condition given in Figure 1.2 that generates a pair (ψi, B• i) such that ψiis used to further refine the partially ascertained substitution h|ψρ, ψn, . . . , ψi+1|i computed by incrementally analyzing conditions cnσ, cn−1σ . . . , ci+1σ, and B• iis a boolean condition that is derived from the analysis of the condition ci. When the whole Cσ has been processed, we get the refinement h|ψρ, ψn, . . . , ψ1|i, which basically encodes all the instantiations required to construct the term slice s•from t•. More specifically, s•is obtained from t•by replacing the subterm t• |wwith the left-hand side λof rinstantiated with h|ψρ, ψn, . . . , ψ1|i. Furthermore, B•is built by collecting all the boolean compatibility conditions B• idelivered by process-condition and instantiating them with the composition of the computed refinements ψ1. . . ψn. It is worth noting that processcondition handles rewrite expressions, equational conditions, and matching conditions differently. More specifically, the pair (ψi,Bi) that is returned after processing each condition ciis computed as follows. – Matching conditions. Let cbe a matching condition with the form p:= min the condition of rule r. During the execution of the step µ: sr,σ,w →t, recall that cis evaluated as follows: first, mσ is reduced to its canonical form mσ ↓∆, and then the condition mσ ↓∆=Bpσ is checked. Therefore, the analysis of the matching condition p:= m during the slicing process of µimplies slicing the (internal) execution trace Tint =mσ →∗pσ, which is done by recursively invoking the function backward-slicing for execution trace slicing with respect to the meaningful positions of the term slice pθ of p, where θis a refinement that records the meaningful information computed so far. That is, [m•→∗p•, B•] = backward-slicing(mσ →∗pσ, MPos(pθ)). The result delivered by the function backward-slicing is a trace slice m•→∗ p•with compatibility condition B•. In order to deliver the final outcome for the matching condition p:= m, first the substitution ψ=matchmθ(m•) is computed, which is the substitution needed to refine θ, is computed, and then the pair (ψ, B•) is returned. Example 1.3.5 Consider the the rewrite step µdebit of Example 1.3.4 together with the refined substitution θ={Id/a,bal/•3,M/•4,newBal/•1}. We
Backward Trace Slicing for Conditional Rewrite Theories 24 process the condition newBal := bal - M of debit by considering the internal execution trace Tint =30 −5→25 3. By invoking the function backward-slicing, the trace slice result is [•6→ •6, true]. The final outcome is given by match•7−•8(•6), that is fail. Thus, we conclude that θdoes not need any further refinement. – Rewrite expressions. The case when cis a rewrite expression t⇒pis handled similarly to the case of a matching equation p:= t, with the difference that tcan be reduced by using the rules of Rin addition to the equations and axioms. – Equational conditions. During the execution of the rewrite step µ: sr,σ,w →t, the instance eσ of an equational condition ein the condition of the rule ris just fulfilled or falsified, but it does not bring any instantiation into the output term t. Therefore, when processing eσ, no meaningful information to further refine the partially ascertained substitution θmust be added. However, the equational condition emust be recorded in order to compute the compatibility condition B•for the considered conditional rewrite step. In other words, after processing an equational condition e, we deliver the tuple (ψ, B•), with ψ={ } and B•=eθ. Note that the condition eis instantiated with the updated substitution θ, in order to transfer only the meaningful information of eσ computed so far in e. Example 1.3.6 Consider the refined substitution given in Example 1.3.5 θ={Id/a,bal/•3,M/•4,newBal/•1}together with the rewrite step µdebit of Example 1.3.4 that involves the application of the debit rule. After processing the condition bal >= M of debit, we deliver B•= (•3>=•4). Correctness of our conditional slicing technique is established by the following theorem. The proof can be found in [ABFR12c]. 3Note that the trace 30-5→25 involves an application of the Maude built-in operator “-”. Given a built-in operator op, in order to handle the reduction a op b →cas an ordinary rewrite step, we add the rule a op b ⇒cto the considered rewrite theory.
Backward Trace Slicing for Conditional Rewrite Theories 25 Theorem 1.3.7 (correctness) Let Rbe a rewrite theory. Let T:s0 r1,σ1,w1 → ...rn,σn,wn →snbe an execution trace in the rewrite theory R, with n > 0, and let Osnbe a slicing criterion for T. Then, the pair [s• 0→... →s• n, B• 0] computed by backward-slicing(T,Osn)is a trace slice for T. 1.4 Experimental Evaluation The conditional slicing methodology presented so far has been implemented in Julienne, a prototype tool written in Maude first described in [ABFR12b] and publicly available at http://safe-tools.dsic.upv.es/julienne/. The tool takes in input a slicing criterion and a Maude execution trace, which is a term of sort Trace (generated by means of the the Maude meta-level operator metaSearchPath), and delivers the corresponding trace slice. The prototype have been tested on rather large execution traces, such as the counterexamples generated by the model checker for Web applications Web- TLR [ABER10]. In our experiments, we have considered a Webmail application together with four LTLR properties that have been refuted by Web-TLR. For each refuted property, Web-TLR has produced the corresponding counterexample in the form of a huge, textual execution trace Ti,i= 1, ..., 4, in the range 10 −100Kb that has been used to feed our slicer. Example Original Slicing Sliced % trace trace size criterion trace size reduction Web-TLR.T119114 Web-TLR.T1.O13982 79.17% Web-TLR.T1.O23091 83.83% Web-TLR.T222018 Web-TLR.T2.O12984 86.45% Web-TLR.T2.O22508 88.61% Web-TLR.T338983 Web-TLR.T3.O12045 94.75% Web-TLR.T3.O22778 92.87% Web-TLR.T469491 Web-TLR.T4.O18493 87.78% Web-TLR.T4.O25034 92.76% Table 1.1: Backward trace slicing benchmarks. Table 1.1 shows the size of the original counterexample trace and that of the computed trace slice, both measured as the length of the corresponding string, w.r.t. two slicing criteria, that are detailed in the tool website. The
Backward Trace Slicing for Conditional Rewrite Theories 26 considered criteria allow one to monitor the messages exchanged by a specific Web browser and the Webmail server, as well as to isolate the changes on the data structures of the two interacting entities. The %reduction column in Table 1.1 refers to the percentage of reduction achieved. The results we have obtained are very encouraging, and show an impressive reduction rate (up to ∼95%) in reasonable time (max. 0.9s on a Linux box equipped with an Intel Core 2 Duo 2.26GHz and 4Gb of RAM memory). Actually, sometimes the trace slices are small enough to be easily inspected by the users, who can restrict their attention to the part of the computation that they want to observe.
2 Slicing-based Trace Analysis of Rewriting Logic Specifications with iJulienne In this chapter, we present an incremental slicing methodology specially suitable for the analysis of rewriting logic computations together with its implementation in the iJulienne tool. This methodology is a new extended version of the original slicing technique first proposed in [ABFR12a]. This chapter is organized as follows. Section 2.1 gives the intuition of our incremental backward trace slicing methodology. Section 2.2 presents iJulienne, the slicing-based trace analyzer implementing this new methodology. Section 2.3 shows two different working sessions with iJulienne and finally, Section 2.4 reports some experiments that assess the practicality of our methodology. 2.1 Incremental Trace Slicing The original trace slicing technique of [ABFR12a] intuitively works as shown in Figure 2.1. Given a starting slicing criterion (i.e., a piece of relevant information that we want to observe in the final computation state), the trace is traversed from back to front and the backward dependence of the observed information is incrementally computed at each execution step. The information computed at each step is surely relevant with respect to the slicing criterion. However, this information may not be relevant with respect to the source of error we want to discover, as it may contain extra irrelevant information in this regard. Many factors can influence this excess of 27
Slicing-based Trace Analysis of RWL Specifications with iJulienne 28 Figure 2.1: Backward trace slicing scheme. Figure 2.2: Incremental backward trace slicing scheme. information: an erroneous or overly general slicing criterion, the structure of the data dependence itself, the length of the trace (as the computed relevant information tends to grow at each execution step), etc. In order to reduce to the minimum the excess of irrelevant information with respect to the source of error and therefore achieve better reduction rates, we propose to refine the slicing criterion at each execution step by means of the auxiliary, interactive function refine, which takes as input a slicing criterion and returns an equal or more restrictive one. The proposal, which is informally depicted in Figure 2.2, works as follows. Given an execution trace T:s0→∗snand a slicing criterion Osn⊆ Pos(sn), which refers to those symbols of snthat we want to observe, the main difference between the proposed incremental slicing methodology and the original backward slicing technique is that a refined version of the slicing criterion is established after each execution of the slice-step function. Consider the configuration given in Definition 1.2.3 and the transition system (Conf ,•→) given in Definition 1.2.4. In order to endow incremental capabilities to the original backward trace slicing technique, we modify the slicing calculus as follows.
Slicing-based Trace Analysis of RWL Specifications with iJulienne 29 Definition 2.1.1 Let R= (Σ,∆∪B, R)be a rewrite theory, let T=U→∗ Wbe an execution trace in R, and let V→Wbe a rewrite step. Let B• Wand B• Vbe two boolean conditions, and let W•be a term slice of W. Then, the transition relation •→⊆ Conf ×Conf is the smallest relation that satisfies the following rule: (V•, B• V) = slice-step(V→W, W•0, B• W) ∧W•0 =slice(W, refine(MPos(W•))) hU→∗V→W, W•, B• Wi•→ hU→∗V, V •, B• Vi Roughly speaking, the relation •→ transforms a configuration hU→∗ V→W, W•, B• Wiinto a configuration hU→∗V, V •, B• Viby calling the function slice-step(V→W, W•0, B• W) of Section 1.3, which returns a rewrite step slice for V→W, and by allowing the user to refine the meaningful symbols of W•to calculate W•0as the slice(W, refine(MPos(W•))). More precisely, slice-step computes a suitable term slice V•of Vand a compatibility condition BVthat updates the compatibility condition specified by BW, and refine computes a refined slicing criterion, which is used to slice Wand therefore obtain the new slicing criterion as the meaningful positions of W•0. In the same way as the original definition, the initial configuration hs0→∗ sn, slice(sn,Osn), trueiis transformed until a terminal configuration hs0, s• 0, B• 0iis reached. Then, the computed trace slice is obtained by replacing each term siby the corresponding term slice s• i,i= 0, . . . , n, in the original execution trace s0→∗sn. The algorithm additionally returns the accumulated compatibility condition B• 0attained in the terminal configuration. More formally, the incremental backward trace slicing of an execution trace with respect to a slicing criterion is implemented by the function incremental-backward-slicing, defined as follows. Definition 2.1.2 (Incremental backward trace slicing algorithm) Let R= (Σ,∆∪B, R)be a rewrite theory, and let T:s0→∗snbe an execution trace in R. Let Osnbe a slicing criterion for T. Then, the function incremental-backward-slicing is computed as follows: incremental-backward-slicing(s0→∗sn,Osn) = [s• 0→∗s• n, B• 0] iff there exists a transition sequence in (Conf ,•→) hs0→∗sn, s• n, truei•→ hs0→∗sn−1, s• n−1, B• n−1i•→∗hs0, s• 0, B• 0i where s• n=slice(sn,Osn)
Slicing-based Trace Analysis of RWL Specifications with iJulienne 36 If we want to identify the amounts of money transferred by Alice to another user, we should query the state with the pattern transfer(Alice, ,?), which discards the information related to the receiver and identifies the amounts transferred by Alice. After launching the query, we will identify that Alice has two transfer operations pending, with quantities 15 and 20. Consider now that we want to identify the names of the clients whose balance is 20. Then, we must launch a query using the pattern <? | 20 >, which will identify Bob,Charlie and Daisy as the clients that match the given criterion. Finally, consider that we want to search for the pattern Charlie in order to identify in how many operations is Charlie involved (including its own balance declaration). As a result, the term Charlie will be identified in the following operations: < Charlie | 20 >,transfer(Alice,Charlie,15), transfer(Bob,Charlie,4) and debit(Charlie,50). At this point, one final source of eventual problems has to be addressed, namely ambiguity. Querying patterns may be as ambiguous as programs, specially when making use of wild-cards. In order to disambiguate patterns, the querying language implemented in iJulienne offers the possibility of either automatically infer the proper sort of each wild-card as explained previously, or let the user specify the sort in the same manner that dictates the syntax of Maude, that is, by concatenating wild-card and sort by means of the :character (e.g., ?:Nat) or, in the case of a constant, by wrapping them in parentheses and concatenating the sort by means of a dot (e.g., (cnt).Nat). Example 2.2.3 shows how the disambiguation of a pattern provides widely different querying results. Example 2.2.3 Consider the MINMAX program of Example 2.2.1 and the following state: PAIR(Min(4,1st(PAIR(Min(7,1st(minmax(0))),Max(7,2nd(minmax(0))) ))),Max(4,2nd(minmax(7 ; 0)))) Consider we want to identify those values appearing as single minmax parameters. Then, we may want to perform a query to search for the pattern minmax(?). However, as minmax can hold either a single Nat or a List (of Nat) terms, we discover that the original pattern is somehow ambiguous, as it identifies two appearances of minmax(0) and one of minmax(7 ; 0).
Slicing-based Trace Analysis of RWL Specifications with iJulienne 37 Nevertheless, if we take advantage of the disambiguation facilities that are provided in iJulienne, we may want to perform a query using the pattern minmax(?:Nat), which will indeed recover only the two appearances of minmax(0) we wanted to identify, as they are the only terms that match the disambiguated query. 2.2.4 Program Slicing Additionally to the backward trace slicing capabilities, iJulienne offers the possibility to perform a cogent form of dynamic program slicing. A first, na¨ıve approach to compute a dynamic program slice based on an execution trace would be to add to the program slice all and only those rules/equations that have been applied within the trace. After that, for every rule or equation in the slice, add the operators and variables appearing in them. Finally, for every operator and variable in the slice, we would add the corresponding sorts and sub-sorts. However, this approach is trivial and can be easily improved when we work with trace slices. The difference between a program slice based on execution traces and program a slice based on trace slices is the possibility to consider where the rule or equation was applied. In particular, only rules/equations applied in relevant positions have to be added to the program slice. Example 2.2.4 shows how iJulienne computes efficiently a program slice. Example 2.2.4 Consider the rewrite theory of Example B together with the following trace and its corresponding trace slice. Step RuleName Execution trace Sliced trace 1 'Start < Alice | 50 > ; < Bob | 20 > ; < Charlie | 20 > ; < Daisy | 2 0 > ; credit(Alice,10) ; credit(Daisy,40) ; debit(Charlie,50) ; debit(Daisy,5) ; transfer(Alice,Charlie,15) ; transfer(Alice,Dai sy,20) ; transfer(Bob,C harlie,4) < Alice | * > ; * ; * ; * ; credit(Alice,*) ; * ; * ; * ; * ; * ; * 3 credit < Bob | 20 > ; < Charlie | 20 > ; < Daisy | 20 > ; credit(Dai sy,40) ; debit(Charlie,50) ; debit(Daisy,5) ; transfer(Alice,C h arlie,15) ; transfer(Alice,Daisy,20) ; transfer(Bob,Charlie,4) ; < Alice | 60 > * ; * ; * ; * ; * ; * ; * ; * ; * ; < Alice | * > 6 credit < Alice | 60 > ; < Bob | 20 > ; < Charlie | 20 > ; debit(Charl ie,50) ; debit(Daisy,5) ; transfer(Alice,Charlie,15) ; transfer( Alice,Daisy,20) ; transfer(Bob,Charlie,4) ; < Daisy | 60 > < Alice | * > ; * ; * ; * ; * ; * ; * ; * ; * 9 debit < Alice | 60 > ; < Bob | 20 > ; < Daisy | 60 > ; debit(Daisy, 5) ; transfer(Alice,Charlie,15) ; transfer(Alice,Daisy,20) ; tra nsfer(Bob,Charlie,4) ; < Charlie | - 30 > < Alice | * > ; * ; * ; * ; * ; * ; * ; * 12 debit < Alice | 60 > ; < Bob | 20 > ; < Charlie | - 30 > ; transfer( Alice,Charlie,15) ; transfer(Alice,Daisy,20) ; transfer(Bob,C h arlie,4) ; < Daisy | 55 > < Alice | * > ; * ; * ; * ; * ; * ; *
Slicing-based Trace Analysis of RWL Specifications with iJulienne 38 mod BANK_ERR is inc INT . sorts Account Msg State Id . subsorts Account Msg < State . var Id Id1 Id2 : Id . var bal bal1 bal2 newBal newBal1 newBal2 M : Int . op empty-state : -> State . op Alice : -> Id . op Bob : -> Id . op Charlie : -> Id . op Daisy : -> Id . op _;_ : State State -> State [assoc comm] . op <_|_> : Id Int -> Account [ctor] . ops credit debit : Id Int -> Msg [ctor] . op transfer : Id Id Int -> Msg [ctor] . crl [credit] : credit(Id, M) ; < Id | bal > => < Id | newBal > if newBal := bal + M . crl [debit] : debit(Id, M) ; < Id | bal > => < Id | newBal > if newBal := bal - M . crl [transfer] : transfer(Id1, Id2, M) ; < Id1 | bal1 > ; < Id2 | bal2 > => < Id1 | newBal1 > ; < Id2 | newBal2 > if debit(Id1, M) ; < Id1 | bal1 > => < Id1 | newBal1 > /\ credit(Id2, M) ; < Id2 | bal2 > => < Id2 | newBal2 > . endm Figure 2.4: Dynamic program slice of Example 2.2.4. The na¨ıve program slicing methodology sketched above would point as relevant all the rules/equations3applied along the trace (i.e., credit in steps 3 and 6 and debit in steps 9 and 12), and thus compute the corresponding program slice by calculating all the dependence previously explained. In contrast, our dynamic program slicing based on trace slices considers as relevant only the information derived from those rules/equations applied at the relevant positions of our trace slice (i.e., credit in step 3), and therefore safely ignores the debit rule as well as the application of rule credit in step 6, which would point Daisy as relevant if taken into account, whereas in no way it is related to the relevant information of our trace slice. The resulting program slice is depicted in Figure 2.4. 2.3 iJulienne at work To illustrate how iJulienne works in practice, we show two typical analysis sessions that illustrate how iJulienne works in practice. In the first session, a simple planning system is debugged by intensively exploiting trace and program slicing, while the second session highlights iJulienne analysis 3Flattening and unflattening transformation are not considered for this task.
Slicing-based Trace Analysis of RWL Specifications with iJulienne 39 mod BLOCKS-WORLD is inc INT . sorts Block Prop State . subsort Prop < State . ops a b c : -> Block . op table : Block -> Prop . *** block is on the table op on : Block Block -> Prop . *** first block is on the second block op clear : Block -> Prop . *** block is clear op hold : Block -> Prop . *** robot arm holds the block op empty : -> Prop . *** robot arm is empty op _&_ : State State -> State [assoc comm] . op size : Block -> Nat . vars X Y : Block . eq [sizeA] : size(a) = 1 . eq [sizeB] : size(b) = 2 . eq [sizeC] : size(c) = 3 . rl [pickup] : clear(X) & table(X) => hold(X) . rl [putdown] : hold(X) => empty & clear(X) & table(X) . rl [unstack] : empty & clear(X) & on(X,Y) => hold(X) & clear(Y) . crl [stack] : hold(X) & clear(Y) => empty & clear(X) & on(X,Y) if size(X) < size(Y) . endm Figure 2.5: BLOCKS-WORLD faulty Maude specification. capabilities on a real-size Maude specification that encodes a Webmail application. The considered examples (together with several others) are available at [iJu12] and the described analysis and debugging sessions can be reproduced by accessing iJulienne through its online Web interface. 2.3.1 Debugging the Blocks World Example Blocks World is one of the most famous planning problems in artificial intelligence. We assume that there are some blocks, placed on a table, that can be moved by means of a robot arm; the goal of the robot arm is to produce one or more vertical stacks of blocks. In our specification, which is shown in the Maude module BLOCKS-WORLD of Figure 2.5, we define a Blocks World system with three different kinds of blocks that are defined by means of the operators a,b, and cof sort Block. Different blocks have different sizes that are described by using the unary operator size. We also consider some operators that formalize block and robot arm properties whose intuitive meanings are given in the accompanying program comments. The states of the system are modeled by means of associative and commutative lists of properties of the form prop1&prop2&. . . &propn, which
Slicing-based Trace Analysis of RWL Specifications with iJulienne 40 describe any possible configuration of the blocks on the table as well as the status of the robot arm. The system behavior is formalized by four, simple rewrite rules that control the robot arm. Specifically, the pickup rule describes how the robot arm grabs a block from the table, while the putdown rule corresponds to the inverse move. The stack and unstack rules respectively allow the robot arm to drop one block on top of another block and to remove a block from the top of a stack. Note that the conditional stack rule forbids a given block B1 from being piled onto a block B2if the size of B1is greater than the size of B2. Barely perceptible, the Maude specification of Figure 2.5 fails to provide a correct Blocks World implementation. By using the BLOCKS-WORLD module, it is indeed possible to derive system states that represent erroneous configurations. For instance, the initial state si=empty &clear(a) & table(a) & clear(b) & table(b) & clear(c) & table(c) describes a simple configuration where the robot arm is empty and there are three blocks a,b, and con the table. It can be rewritten in 7 steps to the state sf=empty &empty &table(b) & table(c) & clear(a) & clear(c) & on(a,b) that clearly indicates a system anomaly, since it shows the existence of two empty robot arms! To find the cause of this wrong behavior, we feed iJulienne with the faulty rewrite sequence T=si→∗sf, and we initially slice Tw.r.t. the slicing criterion that observes the two anomalous occurrences of the empty property and the stack on(a,b) in State sf. This task can be easily performed in iJulienne by first highlighting the terms that we want to observe in State sfwith the mouse pointer and then starting the slicing process. iJulienne yields a trace slice that simplifies the original trace by recording only those data that are strictly needed to produce the considered slicing criterion. Also, it automatically computes the corresponding program slice, which consists of the equations defining the size operator together with the pickup and stack rules (see Figure 2.6). This allows us to deduce that the malfunction is located in one or more rules and equations that are included in the program slice. The generated trace slice is then browsed backwards using the iJulienne’s navigation facility in search of a possible explanation for the wrong behav-
Slicing-based Trace Analysis of RWL Specifications with iJulienne 41 Slicing-based Trace Analysis of Rewriting Logic Specifications with iiJULIENNE María Alpuente, Demis Ballis, Francisco Frechina and Julia Sapiña [Abstract] [Examples] [Download] [Benchmarks] [iJULIENNE Online Trace Analyzer] Program Slice mod BLOCKS-WORLD is inc INT . sorts Block Prop State . subsort Prop < State . ops a b c : -> Block . op table : Block -> Prop . *** block is on the table op on : Block Block -> Prop . *** block A is on block B op clear : Block -> Prop . *** block is clear op hold : Block -> Prop . *** robot arm holds the block op empty : -> Prop . *** robot arm is empty op _&_ : State State -> State [assoc comm] . op size : Block -> Nat . vars X Y : Block . eq [sizeA] : size(a) = 1 . eq [sizeB] : size(b) = 2 . eq [sizeC] : size(c) = 3 . rl [pickup] : clear(X) & table(X) => hold(X) . rl [putdown] : hold(X) => empty & clear(X) & table(X) . rl [unstack] : empty & clear(X) & on(X,Y) => hold(X) & clear(Y) . crl [stack] : hold(X) & clear(Y) => empty & clear(X) & on(X,Y) if size(X) < size(Y) . endm Figure 2.6: Program slice computed w.r.t. the slicing criterion empty,empty, on(a,b). ior. During this phase, we focus our attention on State 3 (Figure 2.7), which is inconsistent since it models a robot arm that is holding block aand is empty at the same time. Therefore, we decide to further refine the trace slice by incrementally applying backward trace slicing to State 3 w.r.t. the slicing criterion hold(a). This way we achieve a supplementary reduction of the previous trace slice in which we can easily observe that hold(a) only depends on the clear(a) and table(a) properties (see Figure 2.8). Furthermore, the computed program slice includes the single pickup rule (see Figure 2.9). Thus, we can conclude that: 1. the malfunction is certainly located in the pickup rule (since the computed program slice only contains that rule); 2. the pickup rule does not depend on the status of the robot arm (this is witnessed by the fact that hold(a) only relies on the clear(a) and table(a) properties); 3. by 1 and 2, we can deduce that the pickup rule is incorrect, as it never checks the emptiness of the robot arm before grasping a block. A possible fix of the detected error consists in including the empty property in the left-hand side of the pickup rule, which enforces the robot arm
Slicing-based Trace Analysis of RWL Specifications with iJulienne 42 Slicing-based Trace Analysis of Rewriting Logic Specifications with iiJULIENNE María Alpuente, Demis Ballis, Francisco Frechina and Julia Sapiña [Abstract] [Examples] [Download] [Benchmarks] [iJULIENNE Online Trace Analyzer] Trace Analysis Phase You can mark the relevant data by either: 1) highlighting the symbols in the chosen state, or 2) querying the trace and selecting one of the resulting matching states (the relevant data will be automatically inferred). Show advanced view Hide irrelevant data These are the states of your Trace: States 2-3 of 7 #state These are the states of your Trace Slice: empty & clear(b) & clear(c) & table(b) & table(c) & clear(a) & table(a) empty & clear(b) & clear(c) & table(b) & table(c) & hold(a) empty & * & * & * & clear(a) & clear(b) & table(a) empty & * & * & * & clear(b) & hold(a) Write the pattern for querying the trace !! Figure 2.7: Navigation through the trace slice of the Blocks World example. to always be idle before picking up a block. The corrected version of the rule is hence as follows: rl [pickup] : empty & clear(X) & table(X) => hold(X) . 2.3.2 Analyzing a Webmail Application In this section, we reproduce a typical trace analysis session with iJulienne that operates on a Maude specification of a realistic Webmail application that consists of 10 rewrite rules and 134 equations. The specification models both server-side aspects (e.g., Web script evaluations, database interactions) and browser-side features (e.g., forward/backward navigation, Web page refreshing, window/tab openings). The Web application behavior is formalized by using rewrite rules of the form [label] :WebState ⇒WebState, where WebState is a triple that we represent with the following operator || || : (Browsers ×Message ×Server)→WebState that can be interpreted as a system shot that captures the current configuration of the active browsers (i.e., the browsers currently using the Webmail application) together with the channel through which the browsers and the server communicate via message-passing. An execution trace specifies a sequence of WebState transitions that represents a possible execution of the Webmail application. The session starts by loading the Maude Webmail specification, together with the execution trace to be analyzed, into the iJulienne trace analyzer.
Slicing-based Trace Analysis of RWL Specifications with iJulienne 43 Slicing-based Trace Analysis of Rewriting Logic Specifications with iiJULIENNE María Alpuente, Demis Ballis, Francisco Frechina and Julia Sapiña [Abstract] [Examples] [Download] [Benchmarks] [iJULIENNE Online Trace Analyzer] Trace Analysis Phase You can mark the relevant data by either: 1) highlighting the symbols in the chosen state, or 2) querying the trace and selecting one of the resulting matching states (the relevant data will be automatically inferred). Show advanced view Hide irrelevant data These are the states of your Trace: States 2-3 of 3 #state These are the states of your Trace Slice: empty & clear(b) & clear(c) & table(b) & table(c) & clear(a) & table(a) empty & clear(b) & clear(c) & table(b) & table(c) & hold(a) * & clear(a) & table(a) * & hold(a) Write the pattern for querying the trace !! Figure 2.8: Navigation though the refined trace slice of the Blocks World example. The trace can be directly pasted in the input form or uploaded from a trace file that was written off-line. It can also be dynamically computed by the system (using Maude meta-search capabilities) by introducing the initial and final states of the trace. In Figure 2.10, we directly fed iJulienne with an execution trace that represents a counter-example that was automatically generated by the Maude LTLR model-checker. The considered trace consists of 97 states, each of which has about 5.000 characters. The aim of our analysis is to extract the navigation path of a possible malicious user idA within the Web application from the execution trace. This is particularly hard to perform by hand since the trace is extremely large and system states contain a huge amount of data. Therefore, we decide to slice the trace with iJulienne in order to isolate only the Web interactions related to user idA, getting rid of all the remaining unrelated information. To this end, we define the query B(idA, , ?,,,,,,), which allows us to select all states in the trace that contain a browser data structure that is associated with user idA. Note that only the third argument of the browser data structure, which corresponds to the Web page displayed on the browser, is declared relevant in the query (i.e., it is marked by the card ?). Indeed, we are interested in tracking only the Web pages visited by the user idA. The remaining information (such as script evaluation, and Web interactions with other users) is not pinpointed and, hence, will be systematically removed by the slicing tool (and replaced by the symbol ∗) which
Slicing-based Trace Analysis of RWL Specifications with iJulienne 44 Slicing-based Trace Analysis of Rewriting Logic Specifications with iiJULIENNE María Alpuente, Demis Ballis, Francisco Frechina and Julia Sapiña [Abstract] [Examples] [Download] [Benchmarks] [iJULIENNE Online Trace Analyzer] Program Slice mod BLOCKS-WORLD is inc INT . sorts Block Prop State . subsort Prop < State . ops a b c : -> Block . op table : Block -> Prop . *** block is on the table op on : Block Block -> Prop . *** block A is on block B op clear : Block -> Prop . *** block is clear op hold : Block -> Prop . *** robot arm holds the block op empty : -> Prop . *** robot arm is empty op _&_ : State State -> State [assoc comm] . op size : Block -> Nat . vars X Y : Block . eq [sizeA] : size(a) = 1 . eq [sizeB] : size(b) = 2 . eq [sizeC] : size(c) = 3 . rl [pickup] : clear(X) & table(X) => hold(X) . rl [putdown] : hold(X) => empty & clear(X) & table(X) . rl [unstack] : empty & clear(X) & on(X,Y) => hold(X) & clear(Y) . crl [stack] : hold(X) & clear(Y) => empty & clear(X) & on(X,Y) if size(X) < size(Y) . endm Figure 2.9: Program slice computed w.r.t. the slicing criterion hold(a). Slicing-based Trace Analysis of Rewriting Logic Specifications with iiJULIENNE María Alpuente, Demis Ballis, Francisco Frechina and Julia Sapiña [Abstract] [Examples] [Download] [Benchmarks] [iJULIENNE Online Trace Analyzer] Execution trace Enter the execution trace by providing either: 1) a term of sort Trace (output by Maude), or 2) the first and last state of the trace (to be automatically reconstructed). Maude term of sort Trace: {'`[_`]_`[_`]`[_`]['B['idA.Id,'idw1.Id,''noPage.Qid,'_?_[''Welcome.Qid,'query-empty.Query], 'session-empty.Session,'_:_['_/_[''idEmail.Qid,'"email2".String],'_/_[''pass.Qid,'"secretAlice".String], '_/_[''user.Qid,'"alice".String]],'mes-empty.Message,'history-empty.History,'s_['0.Zero]], 'bra-empty.BrowserActions,'mes-empty.Message,'S['_:_['`(_`,_`,`{_`}`,`{_`}`)[''Admin-Logout.Qid,'updateDB[ 's`(_`)['"adminPage".String],'s`(_`)['"free".String]],'`(_=>_`)['TRUE.Condition,''Home.Qid], 'nav-empty.Navigation],'`(_`,_`,`{_`}`,`{_`}`)[''Administration.Qid,'_;_['_:=_[''adminPage.Qid,'selectDB[ 's`(_`)['"adminPage".String]]],'if_then_else_fi['_=_[''adminPage.Qid,'s`(_`)['"free".String]],'_;_[ 'updateDB['s`(_`)['"adminPage".String],'getSession['s`(_`)['"user".String]]],'setSession['s`(_`)[ '"adminPage".String],'s`(_`)['"free".String]]],'setSession['s`(_`)['"adminPage".String],'s`(_`)[ '"busy".String]]]],'`(_=>_`)['_'==_['s`(_`)['"adminPage".String],'s`(_`)['"busy".String]],''Home.Qid], '`(_->_`)['TRUE.Condition,'_?_[''Admin-Logout.Qid,'query-empty.Query]]],'`(_`,_`,`{_`}`,`{_`}`)[ ''Change-account.Qid,'skip.Script,'cont-empty.Continuation,'`(_->_`)['TRUE.Condition,'_?_[''Home.Qid,'_:_[ '_'=_[''newPass.Qid,'"".String],'_'=_[''newUser.Qid,'"".String]]]]],'`(_`,_`,`{_`}`,`{_`}`)[ ''Email-list.Qid,'_;_['_:=_[''u.Qid,'getSession['s`(_`)['"user".String]]],'_:=_[''es.Qid,'selectDB['_'._[ ''u.Qid,'s`(_`)['"-email".String]]]],'setSession['s`(_`)['"idEmails-found".String],''es.Qid]], 'cont-empty.Continuation,'_:_['`(_->_`)['TRUE.Condition,'_?_[''Home.Qid,'query-empty.Query]],'`(_->_`)[ 'TRUE.Condition,'_?_[''View-email.Qid,'_'=_[''idEmail.Qid,'"".String]]]]],'`(_`,_`,`{_`}`,`{_`}`)[ ''Home.Qid,'_;_['_:=_[''login.Qid,'getSession['s`(_`)['"login".String]]],'if_then_fi['_=_[''login.Qid, 'null.Value],'_;_['_:=_[''u.Qid,'getQuery[''user.Qid]],'_:=_[''p.Qid,'getQuery[''pass.Qid]],'_:=_[''p1.Qid, 'selectDB[''u.Qid]],'if_then_else_fi['_=_[''p.Qid,''p1.Qid],'_;_['_:=_[''r.Qid,'selectDB['_'._[''u.Qid, 's`(_`)['"-role".String]]]],'setSession['s`(_`)['"user".String],''u.Qid],'setSession['s`(_`)[ '"role".String],''r.Qid],'setSession['s`(_`)['"login".String],'s`(_`)['"ok".String]]],'setSession['s`(_`)[ '"login".String],'s`(_`)['"no".String]]]]]],'_:_['`(_=>_`)['_'==_['s`(_`)['"changeLogin".String],'s`(_`)[ '"no".String]],''Change-account.Qid],'`(_=>_`)['_'==_['s`(_`)['"login".String],'s`(_`)['"no".String]], ''Welcome.Qid],'`(_=>_`)['_'==_['s`(_`)['"login".String],'s`(_`)['"ok".String]],''Home.Qid]],'_:_['`(_->_`)[ 'TRUE.Condition,'_?_[''Change-account.Qid,'query-empty.Query]],'`(_->_`)['TRUE.Condition,'_?_[ ''Email-list.Qid,'query-empty.Query]],'`(_->_`)['TRUE.Condition,'_?_[''Logout.Qid,'query-empty.Query]], '`(_->_`)['_'==_['s`(_`)['"role".String],'s`(_`)['"admin".String]],'_?_[''Administration.Qid, 'query-empty.Query]]]],'`(_`,_`,`{_`}`,`{_`}`)[''Logout.Qid,'clearSession.Script,'`(_=>_`)['TRUE.Condition, ''Welcome.Qid],'nav-empty.Navigation],'`(_`,_`,`{_`}`,`{_`}`)[''View-email.Qid,'_;_['_:=_[''u.Qid, 'getSession['s`(_`)['"user".String]]],'_:=_[''id.Qid,'getQuery[''idEmail.Qid]],'_:=_[''e.Qid,'selectDB[ ''id.Qid]],'setSession['s`(_`)['"text-email".String],''e.Qid]],'cont-empty.Continuation,'_:_['`(_->_`)[ 'TRUE.Condition,'_?_[''Email-list.Qid,'query-empty.Query]],'`(_->_`)['TRUE.Condition,'_?_[''Home.Qid, 'query-empty.Query]]]],'`(_`,_`,`{_`}`,`{_`}`)[''Welcome.Qid,'skip.Script,'cont-empty.Continuation, '`(_->_`)['TRUE.Condition,'_?_[''Home.Qid,'_:_['_'=_[''pass.Qid,'"".String],'_'=_[''user.Qid, '"".String]]]]]],'us`(_`,_`)['idA.Id,'session-empty.Session],'mes-empty.Message, 'readymes-empty.ReadyMessage,'__['`(_;_`)['s`(_`)['"adminPage".String],'s`(_`)['"free".String]],'`(_;_`)[ 's`(_`)['"alice".String],'s`(_`)['"secretAlice".String]],'`(_;_`)['s`(_`)['"alice-email".String],'s`(_`)[ '"email1".String]],'`(_;_`)['s`(_`)['"alice-role".String],'s`(_`)['"admin".String]],'`(_;_`)['s`(_`)[ '"bob".String],'s`(_`)['"secretBob".String]],'`(_;_`)['s`(_`)['"bob-email".String],'s`(_`)[ '"email2".String]],'`(_;_`)['s`(_`)['"bob-role".String],'s`(_`)['"admin".String]],'`(_;_`)['s`(_`)[ '"email1".String],'s`(_`)['"text email one".String]],'`(_;_`)['s`(_`)['"email2".String],'s`(_`)[ '"text email two".String]]]]],'WebState,rl '`[_`]_`[_`]`[_`]['_:_['brs:Browser,'B['id:Id,'idw:Id,'np:Qid, '_:_['urls:URL,'_?_['np1:Qid,'q1:Query]],'ss:Session,'z:Sigma,'lms:Message,'h:History,'idlm:Nat]], 'ba:BrowserActions,'ms:Message,'sv:Server] => '`[_`]_`[_`]`[_`]['_:_['brs:Browser,'B['id:Id,'idw:Id, ''PageNameEmpty.Qid,'url-empty.URL,'ss:Session,'z:Sigma,'m['id:Id,'idw:Id,'_?_['np1:Qid,'sigma['z:Sigma, 'q1:Query]],'idlm:Nat],'h:History,'idlm:Nat]],'ba:BrowserActions,'_:_['ms:Message,'m['id:Id,'idw:Id,'_?_[ 'np1:Qid,'sigma['z:Sigma,'q1:Query]],'idlm:Nat]],'sv:Server] [label('ReqIni)] .} {'`[_`]_`[_`]`[_`]['B['idA.Id,'idw1.Id,''PageNameEmpty.Qid,'url-empty.URL,'session-empty.Session,'_:_['_/_[ ''idEmail.Qid,'"email2".String],'_/_[''pass.Qid,'"secretAlice".String],'_/_[''user.Qid,'"alice".String]],'m[ 'idA.Id,'idw1.Id,'_?_[''Welcome.Qid,'query-empty.Query],'s_['0.Zero]],'history-empty.History,'s_['0.Zero]], 'bra-empty.BrowserActions,'m['idA.Id,'idw1.Id,'_?_[''Welcome.Qid,'query-empty.Query],'s_['0.Zero]],'S['_:_[ '`(_`,_`,`{_`}`,`{_`}`)[''Admin-Logout.Qid,'updateDB['s`(_`)['"adminPage".String],'s`(_`)['"free".String]], '`(_=>_`)['TRUE.Condition,''Home.Qid],'nav-empty.Navigation],'`(_`,_`,`{_`}`,`{_`}`)[''Administration.Qid, '_;_['_:=_[''adminPage.Qid,'selectDB['s`(_`)['"adminPage".String]]],'if_then_else_fi['_=_[''adminPage.Qid, 's`(_`)['"free".String]],'_;_['updateDB['s`(_`)['"adminPage".String],'getSession['s`(_`)['"user".String]]], 'setSession['s`(_`)['"adminPage".String],'s`(_`)['"free".String]]],'setSession['s`(_`)['"adminPage".String], 's`(_`)['"busy".String]]]],'`(_=>_`)['_'==_['s`(_`)['"adminPage".String],'s`(_`)['"busy".String]], ''Home.Qid],'`(_->_`)['TRUE.Condition,'_?_[''Admin-Logout.Qid,'query-empty.Query]]],'`(_`,_`,`{_`}`,`{_`}`)[ ''Change-account.Qid,'skip.Script,'cont-empty.Continuation,'`(_->_`)['TRUE.Condition,'_?_[''Home.Qid,'_:_[ '_'=_[''newPass.Qid,'"".String],'_'=_[''newUser.Qid,'"".String]]]]],'`(_`,_`,`{_`}`,`{_`}`)[ ''Email-list.Qid,'_;_['_:=_[''u.Qid,'getSession['s`(_`)['"user".String]]],'_:=_[''es.Qid,'selectDB['_'._[ ''u.Qid,'s`(_`)['"-email".String]]]],'setSession['s`(_`)['"idEmails-found".String],''es.Qid]], 'cont-empty.Continuation,'_:_['`(_->_`)['TRUE.Condition,'_?_[''Home.Qid,'query-empty.Query]],'`(_->_`)[ 'TRUE.Condition,'_?_[''View-email.Qid,'_'=_[''idEmail.Qid,'"".String]]]]],'`(_`,_`,`{_`}`,`{_`}`)[ ''Home.Qid,'_;_['_:=_[''login.Qid,'getSession['s`(_`)['"login".String]]],'if_then_fi['_=_[''login.Qid, 'null.Value],'_;_['_:=_[''u.Qid,'getQuery[''user.Qid]],'_:=_[''p.Qid,'getQuery[''pass.Qid]],'_:=_[''p1.Qid, 'selectDB[''u.Qid]],'if_then_else_fi['_=_[''p.Qid,''p1.Qid],'_;_['_:=_[''r.Qid,'selectDB['_'._[''u.Qid, 's`(_`)['"-role".String]]]],'setSession['s`(_`)['"user".String],''u.Qid],'setSession['s`(_`)[ '"role".String],''r.Qid],'setSession['s`(_`)['"login".String],'s`(_`)['"ok".String]]],'setSession['s`(_`)[ '"login".String],'s`(_`)['"no".String]]]]]],'_:_['`(_=>_`)['_'==_['s`(_`)['"changeLogin".String],'s`(_`)[ '"no".String]],''Change-account.Qid],'`(_=>_`)['_'==_['s`(_`)['"login".String],'s`(_`)['"no".String]], ''Welcome.Qid],'`(_=>_`)['_'==_['s`(_`)['"login".String],'s`(_`)['"ok".String]],''Home.Qid]],'_:_['`(_->_`)[ Figure 2.10: Loading the Webmail execution trace. facilitates comprehension. By running the query, iJulienne computes the outcome shown in Figure 2.11, which delivers the states that satisfy the
Slicing-based Trace Analysis of RWL Specifications with iJulienne 45 query. More concretely, the first 20 states of the trace do match the query, while the remaining 77 states do not include any Web interaction with the user idA and thus do not need to be inspected. Now, since we are interested in observing the whole navigation history of user idA, we select the last state in the trace that matches the query, namely State 20, and we apply backward trace slicing on that state in order to generate a simplified view of the first 20 states of the trace. Note that the slicing criterion is automatically computed by iJulienne by extracting the data matching the query from State 20 (specifically, the target symbols B, idA, and the current browser Web page Welcome). After pressing the Run button, we get a browsable trace slice (see Figure 2.12) where each state of the trace slice is purged of the irrelevant data w.r.t. the slicing criterion, and all the rewrite steps that do not affect the observed data are marked as irrelevant and are simply removed from the slice, which further reduces its size. The reduction rate achieved w.r.t. the original trace reaches an impressive 91%; Specially, 88 of the 97 states were found to be redundant with regard to the selected slicing criterion. This makes the trace slice easy to analyze by hand. Actually, by navigating through the trace slice, it can be immediately observed that the malicious user idA visits the Login page, succeeds to log onto the Webmail system and enters the Webmail Welcome page. 2.4 Experimental Evaluation In order to properly assess the maturity and effectiveness of iJulienne, we have carried out some experiments by testing iJulienne on rather large execution traces, such as the counter-examples delivered by the Maude LTLR model-checker [CDH+07] and several other case studies that are available at the iJulienne Web site [iJu12]. More precisely, we have considered: two runs of a fault-tolerant client-server communication protocol (FTCP) specified in Maude that aim at extracting information related to a specific server and client in a scenario that involves multiple servers and clients. two execution traces generated by Maude-NPA [EMM09], which is an RWL-based analysis tool for cryptographic protocols that takes into
Bibliography 52 of Lecture Notes in Computer Science (LNCS), pages 62–76. Springer-Verlag, 2012. [ABFR12b] M. Alpuente, D. Ballis, F. Frechina, and D. Romero. Julienne: A Trace Slicer for Conditional Rewrite Theories. In Proc. of the 18th International Symposium on Formal Methods (FM 2012), volume 7436 of Lecture Notes in Computer Science (LNCS), pages 28–32. Springer-Verlag, 2012. [ABFR12c] M. Alpuente, D. Ballis, F. Frechina, and D. Romero. Using Conditional Trace Slicing for Improving Maude Programs. Science of Computer Programming, 2012. Under second revision. [ABFS13a] M. Alpuente, D. Ballis, F. Frechina, and J. Sapi˜na. Parametric Exploration of Rewriting Logic Computations. In Proc. of the 5th International Symposium on Symbolic Computation in Software Science (SCSS 2013), volume 15 of EasyChair Proceedings in Computing (EPiC), pages 4–18. EasyChair, 2013. [ABFS13b] M. Alpuente, D. Ballis, F. Frechina, and J. Sapi˜na. Slicing- Based Trace Analysis of Rewriting Logic Specifications with iJulienne. In Proc. of the 22nd European Symposium on Programming (ESOP 2013), volume 7792 of Lecture Notes in Computer Science (LNCS), pages 121–124. Springer-Verlag, 2013. [ABR09] M. Alpuente, D. Ballis, and D. Romero. Specification and Verification of Web Applications in Rewriting Logic. In Proc. of the 16th International Symposium on Formal Methods (FM 2009), volume 5850 of Lecture Notes in Computer Science (LNCS), pages 790–805. Springer-Verlag, 2009. [ADS93] H. Agrawal, R. A. DeMillo, and E. H. Spafford. Debugging with Dynamic Slicing and Backtracking. Software Practice and Experience, 23(6):589–616, 1993. [Agr91] H. Agrawal. Towards Automatic Debugging of Computer Programs. PhD thesis, Purdue University, West Lafayette, IN 47907, September 1991. Ph. D. Thesis. [Ani13] The anima web site, 2013. Available at: http://safe-tools. dsic.upv.es/anima/.
Bibliography 53 [BBF09] M. Baggi, D. Ballis, and M. Falaschi. Quantitative Pathway Logic for Computational Biology. In Proc. of the 7th International Conference on Computational Methods in Systems Biology (CMSB 2009), volume 5688 of Lecture Notes in Computer Science (LNCS), pages 68–82. Springer-Verlag, 2009. [BFF+10] H. Barringer, Y. Falcone, B. Finkbeiner, K. Havelund, I. Lee, G. J. Pace, G. Rosu, O. Sokolsky, and N. Tillmann, editors. Proc. of the 1st International Conference on Runtime Verification (RV 2010), volume 6418 of Lecture Notes in Computer Science (LNCS). Springer-Verlag, 2010. [BKdV00] I. Bethke, J. W. Klop, and R. de Vrijer. Descendants and Origins in Term Rewriting. Information and Computation, 159(1–2):59– 124, 2000. [BKdV03] M. Bezem, J. W. Klop, and R. de Vrijer. Term Rewriting Systems (TeReSe). Cambridge University Press, Cambridge, UK, 2003. [BM06] R. Bruni and J. Meseguer. Semantic Foundations for Generalized Rewrite Theories. Theoretical Computer Science (TCS), 360(1– 3):386–414, 2006. [BM12] K. Bae and J. Meseguer. A Rewriting-Based Model Checker for the Linear Temporal Logic of Rewriting. In Proc. of the 9th International Workshop on Rule-Based Programming (RULE 2008), volume 290 of Electronic Notes in Theoretical Computer Science (ENTCS), pages 19–36. Elsevier Science Publishers Ltd., 2012. [CDE+02] M. Clavel, F. Dur´an, S. Eker, P. Lincoln, N. Mart´ı-Oliet, J. Meseguer, and J. F. Quesada. Maude: Specification and Programming in Rewriting Logic. Theoretical Computer Science (TCS), 285(2):187–243, 2002. [CDE+11] M. Clavel, F. Dur´an, S. Eker, P. Lincoln, N. Mart´ı-Oliet, J. Meseguer, and C. Talcott. Maude Manual (Version 2.6). Technical report, SRI International Computer Science Laboratory, 2011. Available at: http://maude.cs.uiuc.edu/ maude2-manual/.
Bibliography 54 [CDH+07] M. Clavel, F. Dur´an, J. Hendrix, S. Lucas, J. Meseguer, and P. C. ¨ Olveczky. The Maude Formal Tool Environment. In Proc. of the 2nd Algebra and Coalgebra in Computer Science (CALCO 2007), volume 4624 of Lecture Notes in Computer Science (LNCS), pages 173–178. Springer-Verlag, 2007. [CR09] F. Chen and G. Rosu. Parametric Trace Slicing and Monitoring. In Proc. of the 15th International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS 2009), volume 5505 of Lecture Notes in Computer Science (LNCS), pages 246–261. Springer-Verlag, 2009. [CRW00] O. Chitil, C. Runciman, and M. Wallace. Freja, Hat and Hood - A Comparative Evaluation of Three Systems for Tracing and Debugging Lazy Functional Programs. In Proc. of the 12th International Workshop on Implementation of Functional Languages (IFL 2000), volume 2011 of Lecture Notes in Computer Science (LNCS), pages 176–193. Springer-Verlag, 2000. [DM10] F. Dur´an and J. Meseguer. A Maude Coherence Checker Tool for Conditional Order-Sorted Rewrite Theories. In Proc. of the 8th International Workshop on Rewriting Logic and Its Applications (WRLA 2010), volume 6381 of Lecture Notes in Computer Science (LNCS), pages 86–103. Springer-Verlag, 2010. [EMM09] S. Escobar, C. Meadows, and J. Meseguer. Maude-NPA: Cryptographic Protocol Analysis Modulo Equational Properties. In Foundations of Security Analysis and Design V (FOSAD 2007/2008/2009 Tutorial Lectures), volume 5705 of Lecture Notes in Computer Science (LNCS), pages 1–50. Springer- Verlag, 2009. [EMS02] S. Eker, J. Meseguer, and A. Sridharanarayanan. The Maude LTL Model Checker. In Proc. of the 4th International Workshop on Rewriting Logic and its Applications (WRLA 2002), volume 71 of Electronic Notes in Theoretical Computer Science (ENTCS), pages 162–187. Elsevier Science Publishers Ltd., 2002.
Bibliography 55 [EMS03] S. Eker, J. Meseguer, and A. Sridharanarayanan. The Maude LTL Model Checker and Its Implementation. In Proc. of the 10th International SPIN Workshop (SPIN 2003), volume 2648 of Lecture Notes in Computer Science (LNCS), pages 230–234. Springer-Verlag, 2003. [FCMR04] A. Farzan, F. Chen, J. Meseguer, and G. Rosu. Formal Analysis of Java Programs in JavaFAN. In Proc. of the 16th International Conference on Computer Aided Verification (CAV 2004), volume 3114 of Lecture Notes in Computer Science (LNCS), pages 501–505. Springer-Verlag, 2004. [FT94] J. Field and F. Tip. Dynamic Dependence in Term rewriting Systems and its Application to Program Slicing. In Proc. of the 6th International Symposium on Programming Language Implementation and Logic Programming (PLILP 1994), volume 844 of Lecture Notes in Computer Science (LNCS), pages 415–431. Springer-Verlag, 1994. [HCS+96] F. Henderson, T. Conway, Z. Somogyi, D. Jeffery, P. Schachte, S. Taylor, and C. Speirs. The Mercury Language Reference Manual. Technical report, University Of Melbourne, 1996. [HHJW07] P. Hudak, J. Hughes, S. Peyton Jones, and P. Wadler. A History of Haskell: Being Lazy with Class. In Proc. of the 3rd ACM SIGPLAN Conference on History of Programming Languages, HOPL III, pages 12–1–12–55. ACM, 2007. [HKF95] T. Hoffner, M. Kamkar, and P. Fritzson. Evaluation of Program Slicing Tools. In AADEBUG, pages 51–69, 1995. [iJu12] The ijulienne web site, 2012. Available at: http:// safe-tools.dsic.upv.es/iJulienne/. [KL88] B. Korel and J. Laski. Dynamic Program Slicing. Inf. Process. Lett., 29(3):155–163, 1988. [Klo92] J.W. Klop. Term Rewriting Systems. In S. Abramsky, D. Gabbay, and T. Maibaum, editors, Handbook of Logic in Computer Science, volume I, pages 1–112. Oxford University Press, 1992.
Bibliography 56 [Mac05] I. D. MacLarty. Practical Declarative Debugging of Mercury Programs. PhD thesis, University of Melbourne, 2005. Ph. D. Thesis. [Mes90a] J. Meseguer. A Logical Theory of Concurrent Objects. In Proc. of the Conference on Object-Oriented Programming Systems, Languages, and Applications / European Conference on Object-Oriented Programming (OOPSLA/ECOOP 1990), pages 101–115. ACM, 1990. [Mes90b] J. Meseguer. Conditional Rewriting Logic: Deduction, Models and Concurrency. In Proc. of the 2nd International Conditional and Typed Rewriting Systems Workshop (CTRS 1990), volume 516 of Lecture Notes in Computer Science (LNCS), pages 64–91. Springer-Verlag, 1990. [Mes91] J. Meseguer. Rewriting as a Unified Model of Concurrency. SIGPLAN OOPS Messenger, 2(2):86–88, 1991. [Mes92] J. Meseguer. Conditional Rewriting Logic as a Unified Model of Concurrency. Theoretical Computer Science (TCS), 96(1):73– 155, 1992. [Plo04] G. D. Plotkin. A Structural Approach to Operational Semantics. Journal of Logic and Algebraic Programming, 60–61:17–139, 2004. [RB06] N. F. Rodrigues and L. Soares Barbosa. Component Identification Through Program Slicing. Electronic Notes in Theoretical Computer Science (ENTCS), 160:291–304, 2006. [Wei79] M. Weiser. Program Slices: Formal, Psychological, and Practical Investigations of an Automatic Program Abstraction Method. PhD thesis, University of Michigan, Ann Arbor, MI, USA, 1979. AAI8007856. [Wei81] M. Weiser. Program Slicing. In Proc. of the 5th International Conference on Software (ICSE 1981), pages 439–449. IEEE Computer Society Press, 1981.
Bibliography 57 [Wei82] M. Weiser. Programmers Use Slices when Debugging. Communications of the ACM, 25(7):446–452, July 1982. [Wil85] M. Wilkes. Memoirs of a Computer Pioneer. MIT Press Series in the History of Computing. Cambridge, MA: The MIT Press, 1985.