NILE: Formalizing Natural-Language Descriptions of Formal Languages

Tristan Kneisel, Marko Schmellenkamp, Fabian Vehlken, Thomas Zeume
2/23/2026
cs.FLcs.CLcs.LO

No confident code implementation found for this paper.

Abstract

This paper explores how natural-language descriptions of formal languages can be compared to their formal representations and how semantic differences can be explained. This is motivated from educational scenarios where learners describe a formal language (presented, e.g., by a finite state automaton, regular expression, pushdown automaton, context-free grammar or in set notation) in natural language, and an educational support system has to (1) judge whether the natural-language description accurately describes the formal language, and to (2) provide explanations why descriptions are not accurate. To address this question, we introduce a representation language for formal languages, Nile, which is designed so that Nile expressions can mirror the syntactic structure of natural-language descriptions of formal languages. Nile is sufficiently expressive to cover a broad variety of formal languages, including all regular languages and fragments of context-free languages typically used in educational contexts. Generating Nile expressions that are syntactically close to natural-language descriptions then allows to provide explanations for inaccuracies in the descriptions algorithmically. In experiments on an educational data set, we show that LLMs can translate natural-language descriptions into equivalent, syntactically close Nile expressions with high accuracy - allowing to algorithmically provide explanations for incorrect natural-language descriptions. Our experiments also show that while natural-language descriptions can also be translated into regular expressions (but not context-free grammars), the expressions are often not syntactically close and thus not suitable for providing explanations.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{kneisel2026nile,
  title  = {NILE: Formalizing Natural-Language Descriptions of Formal Languages},
  author = {Tristan Kneisel and Marko Schmellenkamp and Fabian Vehlken and Thomas Zeume},
  year   = {2026},
  eprint = {2602.19743},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2602.19743v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2602.19743.svg)](https://codeofpaper.com/paper/2602.19743)

Discussion