Graph rewriting language LMNtal formalized and proven equivalent to graph isomorphism

Formalizing a Syntax-Directed Graph Rewriting Language in Rocq

Programming Languages

Summary

Graphs are used to represent complex structures in programming, and rewriting graphs lets programs change and evolve those structures. LMNtal is a programming language that rewrites graphs using syntax rules, helping programmers work with changing graphs more naturally, but until now, its formal mathematical basis was missing. The paper’s authors provide a formal description and proofs for LMNtal’s syntax and behavior in a proof assistant, including a proof that LMNtal’s structural rules match exactly the standard notion of graph equivalence known as graph isomorphism. This work gives a solid foundation for understanding and verifying programs written in LMNtal.

What this means in practice

A theory result. No direct application yet.

Authors

Naoki Yamamoto, Kazunori Ueda

Abstract

Graph rewriting has emerged as a computational paradigm for handling dynamically evolving graph structures, which play an increasingly central role in programming and modeling languages. Whereas most graph rewriting formalisms are based on algebraic graph transformation, LMNtal is a text-based graph rewriting language with syntax-directed semantics, making it accessible to programmers and amenable to standard programming-language techniques; however, a formally certified basis for LMNtal has been missing. In this paper, we formalize the syntax and semantics of LMNtal in the Rocq Proof Assistant, validate the implementation with illustrative examples, and prove several fundamental properties of LMNtal programs, including the admissibility of two structural congruence rules. Building on this formalization, we give the first formal proof that LMNtal's structural congruence coincides with graph isomorphism on the corresponding port graphs, for arbitrary well-formed (not only closed) terms with the same free links and in both directions, depending only on the standard classical-logic axioms of Rocq's standard library.