[Paper Review] Automatic Theorem Proving in Walnut
This paper presents Walnut, a software system that implements a mechanical decision procedure for verifying combinatorial properties of automatic words using finite automata and Presburger arithmetic. It enables users to automatically prove theorems about sequences like the Thue-Morse and paperfolding words by encoding logical predicates, leveraging automata for arithmetic and word operations, and providing a command-line interface for evaluation, definition, and automation of proofs.
Automatic structures are structures whose universe and relations can be represented as regular languages. It follows from the standard closure properties of regular languages that the first-order theory of an automatic structure is decidable. While existential quantifiers can be eliminated in linear time by application of a homomorphism, universal quantifiers are commonly eliminated via the identity ∀x.Φ≡¬(∃x.¬Φ). If Φ is represented in the standard way as an NFA, a priori this approach results in a doubly exponential blow-up. However, the recent literature has shown that there are classes of automatic structures for which universal quantifiers can be eliminated by different means without this blow-up by treating them as first-class citizens and not resorting to double complementation. While existing lower bounds for some classes of automatic structures show that a singly exponential blow-up is unavoidable when eliminating a universal quantifier, it is not known whether there may be better approaches that avoid the naïve doubly exponential blow-up, perhaps at least in restricted settings. In this paper, we answer this question negatively and show that there is a family of NFA representing automatic relations for which the minimal NFA recognising the language after eliminating a single universal quantifier is doubly exponential, and deciding whether this language is empty is ExpSpace-complete.
Motivation & Objective
- To provide a practical, accessible tool for researchers to automatically verify combinatorial properties of automatic sequences.
- To extend Presburger arithmetic with support for automatic words through automata-based indexing and calling mechanisms.
- To implement a complete software stack—including parsing, automata construction, and minimization—for mechanical theorem proving in word combinatorics.
- To enable users to define custom number systems, automatic words, and predicates via a domain-specific command language.
- To support extensibility through user-defined automata, number systems, and integration with external tools like Graphviz for visualization.
Proposed method
- Uses finite automata to represent predicates over automatic words, with states encoding logical conditions and transitions encoding word structure.
- Employs cross-product construction to combine automata for subpredicates, enabling logical operations like conjunction and quantification.
- Introduces semantic rules for indexing and calling expressions that extend Presburger arithmetic to handle automatic sequences.
- Implements a command-line interface with high-level commands such as `eval`, `def`, `macro`, `reg`, and `load` for interactive theorem proving.
- Supports user-defined automata via text files with structured syntax for inputs, outputs, and transitions, including wildcards and dead states.
- Leverages Valmari’s minimization algorithm and Graphviz integration for efficient state reduction and visualization of automata.
Experimental results
Research questions
- RQ1How can a decision procedure be systematically implemented to verify properties of automatic words using finite automata?
- RQ2What semantic extensions to Presburger arithmetic are required to support indexing and calling operations on automatic sequences?
- RQ3How can a user-extensible system be designed to support custom number systems, automatic words, and logical predicates?
- RQ4What is the role of automata minimization and regular expression compilation in ensuring performance and correctness?
- RQ5How can the system be made both user-friendly and formally sound for researchers in combinatorics on words?
Key findings
- Walnut successfully automates the verification of complex combinatorial properties of automatic sequences, such as the absence of squares or the existence of certain subwords.
- The system supports the definition of new number systems (e.g., msd, lsd) and automatic words (e.g., Thue-Morse, paperfolding) via user-defined automata files.
- The integration of Valmari’s minimization algorithm significantly reduces automaton size, improving performance and scalability.
- Commands like `eval` and `def` allow users to test and define logical predicates over automatic words, with results returned as boolean automata.
- The system supports conversion of automaton descriptions to visual format via Graphviz, enhancing interpretability and debugging.
- User-defined automata can be loaded via `load` command, enabling reproducible and modular theorem proving workflows.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.