Learning DFAs from Positive Examples Only via Word Counting
Benjamin Bordais, Daniel Neider
Abstract
Learning finite automata from positive examples has recently gained attention as a powerful approach for understanding, explaining, analyzing, and verifying black-box systems. The motivation for focusing solely on positive examples arises from the practical limitation that we can only observe what a system is capable of (positive examples) but not what it cannot do (negative examples). Unlike the classical problem of passive DFA learning with both positive and negative examples, which has been known to be NP-complete since the 1970s, the topic of learning DFAs exclusively from positive examples remains poorly understood. This paper introduces a novel perspective on this problem by leveraging the concept of counting the number of accepted words up to a carefully determined length. Our contributions are twofold. First, we prove that computing the minimal number of words up to this length accepted by DFAs of a given size that accept all positive examples is NP-complete, establishing that learning from positive examples alone is computationally demanding. Second, we propose a new learning algorithm with a better asymptotic runtime than the best-known bound for existing algorithms. While our experimental evaluation reveals that this algorithm under-performs state-of-the-art methods, it demonstrates significant potential as a preprocessing step to enhance existing approaches.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Builds on2
- Interpretable Sequence Classification via Discrete OptimizationMaayan Shvo, Andrew C. Li, Rodrigo Toro Icarte, Sheila A. McIlraithAAAI 2021 · 29 citations
- Learning Interpretable Temporal Properties from Positive Examples OnlyRajarshi Roy, Jean-Raphaël Gaglione, Nasim Baharisangari, Daniel Neider et al.AAAI 2023 · 21 citations
Related papers
- Learning Deterministic One-Counter Automata in Polynomial TimePrince Mathew, Vincent Penelle, A. V. SreejithLICS 2025 · 1 citation
- DFAMiner: Mining Minimal Separating DFAs from Labelled SamplesDaniele Dell'Erba, Yong Li, Sven ScheweFM 2024 · 4 citations
- An L# Based Algorithm for Active Learning of Minimal Separating AutomataJasper Laumen, Leonne Snel, Frits W. VaandragerCAV 2026
- NADA: Neural Acceptance-Driven Approximate Specification MiningWeilin Luo, Tingchen Han, Junming Qiu, Hai Wan et al.ISSTA 2025 · 1 citation
- Minimal History-Deterministic Co-Büchi Automata: Congruences and Passive LearningChristof Löding, Igor WalukiewiczLICS 2025 · 3 citations
