Slicing Concurrent Constraint Programs

Moreno Falaschi, Maurizio Gabbrielli, Carlos Olarte, Catuscia Palamidessi

Introduction

Concurrent Constraint Programming (CCP) provides a robust framework for modeling systems where multiple agents interact by adding ("telling") or checking ("asking") information within a shared "store" of constraints. While elegant for modeling complex parallel interactions, debugging CCP is notoriously difficult. The inherent parallelism and the monotonic accumulation of information in the store often result in massive execution traces where the cause of a bug is buried under a mountain of irrelevant data. This paper introduces the first formal framework for dynamic program slicing in CCP, offering a systematic way to prune these traces and isolate the specific code responsible for a given behavior.

The Problem: Information Overload in Debugging

In a typical CCP execution, many agents run simultaneously, and the store grows as more constraints are added. When an error occurs—such as a variable reaching an incorrect value or a system entering an inconsistent state—developers are often left with a trace containing thousands of operations. Existing debuggers for CCP are frequently "approximate," pointing to general areas of code but failing to establish a precise chain of causality. Developers find themselves "lost" in traces, unable to distinguish between the code that caused a bug and the code that simply happened to be executing at the same time.

The Dynamic Slicing Framework

The authors propose a three-step dynamic slicing approach to address this complexity:

  1. Collecting Semantics: The standard operational semantics of CCP are modified to create a "collecting semantics." Unlike standard execution, which views the store as a single logical result, this version assigns unique identifiers to every process and treats the store as a set of individual atomic constraints. This allows the system to track exactly which process "told" which specific piece of information.
  2. Marking the Store: The user identifies a "symptom" in the final state of a failed execution (the slicing criterion). By "marking" specific constraints as the starting point, the user tells the tool what part of the output they are interested in.
  3. The Slicing Algorithm: A backward slicing algorithm starts from the marked constraints and works backward through the execution history. If a process did not contribute to a marked constraint—or to the "ask" guard of a process that did—it is replaced with a dummy symbol (•). This effectively hides irrelevant code while maintaining the original structure of the trace.

This logic is further extended to Timed CCP (tcc), a variant used for systems that evolve over discrete time intervals, such as reactive controllers or music sequencers.

Key Insights: Atoms and Causality

A central insight of this research is that for slicing to be effective, the constraint store cannot be treated as a single logical blob. By breaking the store down into "atoms," the slicer can surgically remove individual pieces of information. Furthermore, the algorithm doesn't just track what was added to the store; it tracks causality through "ask" operations. If Process A only executed because Process B satisfied a specific constraint, then Process B is causally linked to Process A’s output. The use of the • symbol allows the sliced trace to remain human-readable by preserving the temporal and structural context of the original program.

Evaluation and Results

The authors evaluated their framework using a prototypical implementation in Maude, a high-level language for formal specification, and tested it against real-world modeling scenarios:

  • Multimedia Interacting Systems: In a model of rhythmic patterns in Central African Republic music, the slicer successfully identified synchronization errors between "beat" and "stop" signals by hiding all irrelevant rhythmic cycles.
  • Biochemical Systems: In a model of the P53/Mdm2 DNA-damage repair mechanism, the tool identified two bugs in the original specification by isolating the specific biological interactions that led to the error.

Mathematically, the authors proved that their slicing algorithm is sound, meaning it is guaranteed never to remove code that actually contributed to the observed symptom.

Limitations and Future Work

While the current framework supports standard and timed CCP, it does not yet extend to other variants like Linear CCP (where constraints can be consumed) or Spatial/Epistemic CCP. Additionally, the quality of the slice currently depends on the user's ability to select an appropriate slicing criterion. Future work aims to integrate an assertion language based on temporal logic, which would allow the tool to automatically detect invariant violations and generate slices without manual intervention.

Summary updated

BibTeX
@inproceedings{falaschi2016slicing,
  author = {Moreno Falaschi and Maurizio Gabbrielli and Carlos Olarte and Catuscia Palamidessi},
  title = {{Slicing Concurrent Constraint Programs}},
  booktitle = {Lopstr},
  year = {2016},
  doi = {10.1007/978-3-319-63139-4\_5},
}
Figure