ISoLA & AISoLA 2026

International Symposium on Leveraging Applications of Formal Methods, Verification, and Validation • Kos, Greece

Talk

Synthesizing Graphical DSLs via LLM-Driven Token Inference and Grammar Induction

Time: Saturday, 24.10

Room: Room 3

Authors: Daniel Sami Mitwalli, Markus Frohme

Abstract: Language engineering for graphical domain-specific languages (DSLs) typically requires resource-intensive manual effort to turn textual files into models for graphical DSLs. This paper presents an approach to automatically generate and provide a graphical DSL specification for a set of structured textual source files within an Integrated Modeling Environment (IME) dynamically at runtime. This is done via an LLM-powered pipeline that automatically transforms a set of concrete source files into a fully functional graphical DSL by combining automated grammar induction and LLM-inferred symbolic alphabets with the concepts of custom codecs and live metamodeling, allowing the framework to dynamically change and adapt the resulting graphical DSL responsively to the set of files at runtime. The methodology follows a two-stage process: First, a local Large Language Model (LLM) infers symbolic tokens and domain detection on the raw source files, which are used to provide symbolic traces to grammatical inference algorithms (such as passive automata learning) for inducing a structured grammar, semantically enriched grammar. Second, this grammar is used to generate a metamodel for the IME. Additionally, a provided custom codec enables an isomorphic mapping between the textual Abstract Syntax Tree (AST) of the grammar and the internal graph-based model representation (nodes, edges, and containers) provided by the IME. The result is a seamless alignment between text grammars and their corresponding graphical DSLs with zero manual coding of the codec or metamodel. This research provides the conceptual pipeline for automating the transition from text to visual modeling, alongside an implementation using an SPA Passive Learner to induce a Lark grammar. This is demonstrated through an exemplary implementation that provides a symbolic alphabet (inferred via a local LLM using dedicated system prompts), a custom codec, and a generator for the specification of the resulting graphical DSL for the Cinco Editor. By bridging grammar induction and graph-based modeling, this pipeline enables the rapid deployment of graphical domain-specific languages for structured text files and provides sophisticated templates for further language engineering of the resulting graphical DSLs.