Dynamic Backward Slicing of Rewriting Logic Computations

Dynamic Backward Slicing of Rewriting Logic Computations
Notice: This research summary and analysis were automatically generated using AI technology. For absolute accuracy, please refer to the [Original Paper Viewer] below or the Original ArXiv Source.

Trace slicing is a widely used technique for execution trace analysis that is effectively used in program debugging, analysis and comprehension. In this paper, we present a backward trace slicing technique that can be used for the analysis of Rewriting Logic theories. Our trace slicing technique allows us to systematically trace back rewrite sequences modulo equational axioms (such as associativity and commutativity) by means of an algorithm that dynamically simplifies the traces by detecting control and data dependencies, and dropping useless data that do not influence the final result. Our methodology is particularly suitable for analyzing complex, textually-large system computations such as those delivered as counter-example traces by Maude model-checkers.


💡 Research Summary

The paper introduces a backward trace‑slicing technique specifically designed for Rewriting Logic (RL) computations, addressing the challenges posed by large execution traces generated by tools such as the Maude model checker. RL combines a term rewriting system (TRS) with an equational theory that may contain associative, commutative, and other axioms, making trace analysis particularly difficult when rewrite steps are performed modulo these equations. The authors propose a dynamic labeling and tracing framework that records, for each rewrite step, a label on every symbol of the term. Labels are drawn from a set of atomic symbols and are concatenated to form composite labels; the label of a redex propagates to all symbols of its contractum. This labeling, inspired by Klop’s approach, enables a precise mapping of symbols across rewrite steps, distinguishing “needed” symbols (those that influence the final result) from “non‑needed” ones.

The slicing algorithm proceeds in three phases. First, it traverses the entire forward execution trace, applying the labeling scheme to each rewrite step while respecting AC (and other) equational axioms via modular matching. Second, given a user‑specified slice criterion—typically a set of positions in the final term—the algorithm walks backward through the labeled trace. At each step it retains only those symbols whose labels are subsets of the labels of the subsequent step, thereby preserving the data‑flow dependencies that are essential for the criterion. Third, it reconstructs a reduced trace consisting solely of the retained symbols and the rewrite rules that generated them. The result is a compact sub‑trace that still explains how the criterion was produced.

The authors formalize the technique for two classes of rewrite theories. An “elementary” theory has no equational axioms (B = ∅) and all rules are left‑linear and non‑collapsing. For this class the slicing relies purely on standard rewriting. The second class, termed “extended,” admits AC axioms, non‑linear and collapsing rules, and built‑in operators. The labeling rules are extended to handle these features, ensuring that the backward dependency analysis remains sound even when the rewrite step involves matching modulo AC or when variables appear multiple times.

A prototype implementation in Maude was built to evaluate the approach. The authors applied it to counter‑example traces produced by Web‑TLR, a web‑application model‑checking tool based on RL. Typical traces were about 75 KB for a model of 1.5 KB (a 5 000 % size ratio). After slicing, the traces shrank to less than 5 % of their original size, often around 3–4 KB, while the slicing time remained linear in the original trace length (tens of milliseconds). Memory overhead was modest. The reduced traces were far more readable, allowing developers to pinpoint the source of a property violation quickly, thereby dramatically cutting debugging effort.

Compared with prior work on trace slicing, which largely focuses on sequential programs or ignores equational axioms, this paper’s contribution is threefold: (1) a dynamic labeling scheme that captures symbol flow across rewrite steps modulo AC; (2) a formal backward‑dependency analysis that works for both elementary and extended RL theories; (3) an empirical demonstration that the technique scales to real‑world, large‑scale RL traces. The authors also provide formal proofs (in an appendix) of the correctness of the labeling and slicing procedures.

In conclusion, the paper delivers a practical, theoretically grounded method for reducing and understanding RL execution traces. It opens avenues for further research, such as optimizing label management, integrating the slicer into interactive debugging environments, and extending the approach to other formal frameworks like process algebras. The work represents a significant step toward making RL‑based verification tools more usable for developers and researchers dealing with complex, concurrent systems.


Comments & Academic Discussion

Loading comments...

Leave a Comment