arXiv:2610.06714cs.FLOct 2026

Manuscript Offprint

arXiv:2610.06714

Correcting Deterministic Finite Automata for Didactic Feedback

Maurice Bornett Herwig, Norbert Hundeshagen

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Maurice Bornett Herwig

Software Engineering

University of Kassel

Kassel, Germany

maurice.herwig@uni-kassel.de

Norbert Hundeshagen

Theoretical Computer Science / Formal Methods

University of Kassel

Kassel, Germany

hundeshagen@uni-kassel.de

Motivated by educational applications, we study the problem of computing all corrections that transform a finite automaton into one recognizing a given regular language L. We show that for deterministic finite automata the set of all corrections can be finitely characterized as a regular tree language. The construction is based on a tree encoding of all deterministic finite automata recognizing L, which is extended to correction trees that make individual corrections and their induced edit-operations explicit. Leveraging the closure properties of regular tree languages, we introduce so-called filters for selecting corrections satisfying didactic constraints, enabling the derivation of individualized feedback from student submissions.

1 Introduction

Abstract machines (e.g. automata) are fundamental modeling concepts in computer science, with well-known applications in various areas such as circuit design, compiler construction, and natural language processing. Finite automata (FA) can be seen as the basic principle in this area and therefore are included in standard curricula in theoretical computer science (e.g. in [10]).

Typically, the understanding of the syntax and semantics of finite automata as well as the development of basic modeling competencies are supported by exercises requiring students to construct certain automata from a given language description. As the concept of FA is generally considered accessible, exercises of the above type can nevertheless be challenging depending on the given language (cf. [16]). Educational software designed to support students in overcoming these challenges is widespread. The underlying techniques of such tools are manifold. They range from simply verifying correctness via, for instance, an equivalence check against a master solution and providing negative feedback in the form of counterexamples (e.g. in [20, 2, 19]), to attempts to determine a student's solution intent in order to enable automated personalized feedback (e.g. in [6, 7, 5]). We contribute to the latter direction by applying the method of error-correction to FA in order to establish a framework that finitely represents all possible corrections of a given student automaton to a target language. The notion of error-correction is well known in formal language theory, where it describes a method of modifying input data via sequences of edit-operations such as insertions, deletions, and replacements in order to obtain a valid object, for instance a word in a given context-free language (cf. [1]) or a tree structure (cf. [22]). From a didactic perspective, such edit-operations can be interpreted as feedback information on the input data (for instance, a solution attempt to an exercise) (cf. [3]). As such, they are used in programming education to provide next-step hints to students (e.g. in [21, 18]). However, while error-correction traditionally aims at a single correction that is optimal with respect to a given metric (e.g., minimizing the number of edit-operations), this approach seems insufficient in a didactic setting, where different students may follow

M. Hospodár et al. (Eds.): 17th International Conference on Automata and Formal Languages (AFL 2026)

EPTCS 451, 2026, pp. 75–89, doi:10.4204/EPTCS.451.6

© M. Bornett Herwig & N. Hundeshagen

This work is licensed under the

Creative Commons Attribution License.

Correcting Deterministic Finite Automata for Didactic Feedback

different solution strategies, that is, different targets a solution attempt may be corrected to. The latter has already been established for context-free languages as the problem of computing all possible ways to correct a given source word into a target context-free language [3, 9]. Here we adapt this problem (called ALLCORRECT) to finite automata in the following form:

given: a source automaton A and a regular target language L,

compute: the set CLAC_L^A of all possibilities to correct A such that the language accepted by A equals L.

To this end, we show that for deterministic FA the problem ALLCORRECT is computable by finitely representing CLAC_L^A as a regular tree language (cf. Section 4). From a theoretical perspective, our construction combines classical techniques from automata and formal language theory in an educational setting. From this didactic point of view, the finite representation of all corrections of deterministic FA provides a formal framework for applications intended to reason about a student's solution intent in the context of automata exercises (cf. Section 5).

The paper is organized as follows. In Section 2 we recall preliminaries on finite automata and finite tree automata. Section 3 establishes a tree encoding of deterministic FA and shows that all trees representing automata form a regular tree language. In Section 4, we prove the main result of the paper, namely that CLAC_L^A is a regular tree language. In Section 5 we show by example how the regular tree language of all corrections can be used for didactic purposes. Finally, in Section 6, we discuss the integration of nondeterministic FA into the presented framework and directions for future work.

References (33)