Matrix Graph Grammars with Application Conditions
In the Matrix approach to graph transformation we represent simple digraphs and rules with Boolean matrices and vectors, and the rewriting is expressed using Boolean operators only. In previous works, we developed analysis techniques enabling the study of the applicability of rule sequences, their independence, state reachability and the minimal graph able to fire a sequence. In the present paper we improve our framework in two ways. First, we make explicit (in the form of a Boolean matrix) some negative implicit information in rules. This matrix (called nihilation matrix) contains the elements that, if present, forbid the application of the rule (i.e. potential dangling edges, or newly added edges, which cannot be already present in the simple digraph). Second, we introduce a novel notion of application condition, which combines graph diagrams together with monadic second order logic. This allows for more flexibility and expressivity than previous approaches, as well as more concise conditions in certain cases. We demonstrate that these application conditions can be embedded into rules (i.e. in the left hand side and the nihilation matrix), and show that the applicability of a rule with arbitrary application conditions is equivalent to the applicability of a sequence of plain rules without application conditions. Therefore, the analysis of the former is equivalent to the analysis of the latter, showing that in our framework no additional results are needed for the study of application conditions. Moreover, all analysis techniques of [21, 22] for the study of sequences can be applied to application conditions.
💡 Research Summary
The paper advances the Matrix Graph Grammars (MGG) framework, which represents simple directed graphs and transformation rules using Boolean matrices and vectors, by introducing two complementary extensions that enhance both expressive power and analytical tractability.
The first extension is the nihilation matrix. In the original MGG formulation, a rule’s left‑hand side (LHS) captures the positive pattern that must be present in the host graph, while any negative constraints (e.g., dangling edges that would arise after deletions or edges that must not already exist because the rule adds them) are implicit. The nihilation matrix makes these constraints explicit: it is a Boolean adjacency matrix whose 1‑entries denote edges that, if present in the host graph, forbid the rule’s application. These forbidden edges consist of (i) potential dangling edges incident to nodes that the rule deletes, and (ii) edges that the rule intends to add (which cannot already exist in a simple digraph). The paper shows that the nihilation matrix can be automatically derived from the rule’s deletion vector e_V, addition matrix r_E, and a “dangling‑edge” matrix D = e_V ⊗ e_V^T, using the formula N_E = r_E ∨ (¬e_E ∧ D). Moreover, Proposition 2.2 proves that after applying the rule, the inverse rule’s nihilation matrix correctly captures the new forbidden edges, guaranteeing consistency across successive transformations.
The second extension concerns Application Conditions (ACs). Traditional algebraic approaches (DPO, SPO) attach ACs as fixed graph patterns together with existential or universal quantifiers. This limits flexibility and forces separate analysis techniques for each AC variant. The authors propose a more general notion: an AC is a pair consisting of (a) a graph diagram—a collection of typed simple digraphs linked by partial morphisms—and (b) a Monadic Second‑Order Logic (MSOL) formula that quantifies over nodes, edges, and sets thereof. This combination allows the expression of arbitrarily complex structural constraints (e.g., “every node of type A has at least one outgoing edge to a node of type B”) while remaining concise.
Crucially, the paper demonstrates that any rule equipped with arbitrary ACs can be embedded into a plain MGG rule (i.e., a rule without explicit ACs) by:
- Adding the positive part of the AC to the LHS (expanding the pattern that must be matched).
- Translating the negative part of the AC into the nihilation matrix.
The resulting rule, together with its nihilation matrix, behaves exactly like the original rule‑plus‑AC. The authors formalize this embedding in Section 4 and prove in Section 5 that the applicability of the original rule is equivalent to the applicability of a sequence of plain rules derived from the embedded version. Consequently, all existing MGG analysis techniques—sequential independence, parallel independence, critical pair analysis, reachability, minimal triggering graph computation—remain applicable without modification.
The paper also situates its contributions relative to prior work. While DPO/SPO frameworks require separate handling of negative application conditions (NACs) and often rely on categorical constructions, MGG’s Boolean‑matrix foundation enables purely algebraic manipulation, which is naturally suited to high‑performance implementations (e.g., GPU‑accelerated Boolean matrix operations). By integrating ACs into the matrix representation, the authors avoid the combinatorial explosion typical of pattern‑matching based AC handling.
The structure of the paper is as follows:
- Section 2 reviews the basic MGG concepts (graph representation, compatibility, typing, morphisms, rule static and dynamic formulations, and the completion operation). It introduces the nihilation matrix, provides its formal definition, and derives it via Proposition 2.1.
- Section 3 defines the generalized AC model, explaining how graph diagrams and MSOL formulas are combined to capture both positive and negative constraints.
- Section 4 details the embedding process: how to augment the LHS with positive diagram components, how to compute the corresponding nihilation matrix for negative components, and illustrates the method with concrete examples.
- Section 5 establishes the equivalence theorem: any rule with ACs can be replaced by a finite set of plain rules whose sequential composition reproduces the original semantics. This section also discusses how the equivalence enables reuse of the analysis tools developed in earlier MGG papers (
Comments & Academic Discussion
Loading comments...
Leave a Comment