Hierarchical Port Hypergraphs: Two Decades Toward a Unifying Structure for Declarative Languages
Declarative languages take diverse forms with respect to data structures and control structures. They encompass a broad range of notions and paradigms, ranging from higher-order terms with binders to concurrent processes with various forms of communication.
A natural but challenging question is whether many, if not all, of these frameworks can be unified within a simple yet expressive formalism, rather than merely combined into a larger formalism. Graphs and graph rewriting provide a promising framework, since higher-order terms can be represented as tree structures augmented with edges encoding binding structures, while networks of processes can be represented as graph nodes and edges representing processes and their interconnection, respectively.
This perspective motivated us to design and implement LMNtal, a graph rewriting language for modeling and programming. LMNtal was conceived as an attempt to unify constraint-based concurrency (a.k.a. concurrent constraint programming) and Constraint Handling Rules, two extensions of concurrent logic programming, within a simple setting consisting of relations and zero-assignment logical variables that connect relations (i.e., without function/constant symbols). This ‘degeneration’ naturally allows computation to be interpreted in terms of graphs and graph rewriting. Here, graphs are more accurately described as port graphs (when each variable connects exactly two ports of graph nodes) or port hypergraphs (when each variable may connect more than two ports), to distinguish them from ordinary graphs in graph theory.
Programming languages for graphs remain largely under-explored, presumably because graphs have poor affinity with standard PL-style inductive definitions. LMNtal addresses this issue by allowing graphs to be represented as terms modulo structural congruence, which serves as a PL counterpart of graph isomorphism.
| slides (FLOPS2026-v1b.pdf) | 1.46MiB |