Author: Daniela Petrişan Institution: Université Paris Cité, IRIF, France Event: EPIT’25, Aussois Date: 20 May 2025 Source: Petrişan EPIT’25 Slides
References
- T. Colcombet and D. Petrişan, Automata minimization: a functorial approach. Log. Methods Comput. Sci., 16(1), 2020
- T. Colcombet, D. Petrisan, R. Stabile, Learning Automata and Transducers: A Categorical Approach. CSL 2021
- J. E. Pin (Ed.) Handbook of Automata Theory, EMS Press, 2021
- Further reading: Q. Aristote, S. van Gool, D. Petrişan, M. Shirmohammadi, Learning Weighted Automata over Number Rings, Concretely and Categorically. LICS 2025 (arXiv:2504.16596)
Tutorial Overview
This tutorial focuses on the interplay between category theory and automata theory. The categorical approach aims to:
- Provide a unifying framework for modelling various forms of automata.
- Obtain generic algorithms for learning.
- Highlight the link between automata learning and minimization.
Automata with Effects: A Categorical View
We can redefine various automata types by specifying a set of states Q and functions/arrows in a suitable category. The general structure involves an initial map, transition maps for each alphabet symbol, and a final map.
-
Complete Deterministic Finite Automata (cDFA)
- Given a set Q, an initial state , transition functions for , and a final state map (where 2 is a two-element set for accept/reject).
- Category: Set (sets and total functions).
- Diagram: .
-
Deterministic Finite Automata (DFA) (possibly incomplete)
- Given a set Q, an initial state (or ), transition functions (partial functions), and a final state map (partial map to {accept}).
- Category: Set• (sets and partial functions).
- Diagram: (final map is to a singleton if only concerned with acceptance, often depicted as or where is a terminal object with a partial map).
-
Nondeterministic Finite Automata (NFA)
- Given a set Q, initial states (map ), transition relations , and final states (map or ).
- Category: Rel (sets and relations).
- Diagram: (where arrows are relations; initial and final ).
-
Weighted Automata (WA) over a Semiring R
- States Q form a basis for a free R-module .
- Initial vector , transition matrices (linear maps) , and final vector .
- Category: FreeModR (R-modules and linear maps).
- Diagram: (Often initial is or and final is ).
linear map
i
: for entering initial state- transitions: give a matrix (linear transformation) =
- linear map
fin
for weight of leaving the final state
-
Sequential Transducers (input alphabet A, output alphabet B)
- States Q, initial state with initial output (or ).
- Transitions for each .
- Final outputs .
- An arrow is a function .
1: for undefined states, B* for accepting words
- Category: T (Kleisli category for ).
related to the standard notion of Monad
- Diagram: (arrows are or ).
We haven’t seen composition: why matters? for automata: accepting words
Automata | Category | Objects | Morphisms |
---|---|---|---|
complete DFAs | Sets | sets | functions |
DFAs | Set_{\cdot} | sets | partial functions |
NFA | Rel | sets | relations |
WAs over R | FreeMod_R | R-modules | linear maps |
subsequential transducers | … | … | … (we can construct, Kleisli category) |
General Form: (C, I, O)-automata
- These are automata where initial (I), state (Q), and final (O) objects live in a category .
- Diagram: .
I
is considered as some initial objectO
is considered as some final object
Word Automata as Functors
- Word automata on can be seen as functors .
- The input category is freely generated by objects
states
and arrowsin: initial_object_placeholder \to states
,out: states \to final_object_placeholder
, and for each . - A functor provides:
- An object in .
- An initial arrow (where I = \mathcal{A}(\text{initial_object_placeholder})).
- A final arrow (where F = \mathcal{A}(\text{final_object_placeholder})).
- Transition arrows for each .
- The language accepted by is a map , where for , .
this gives the standard notion for acceptance of words on all the above examples e.g.: for DFA,
|I| = 1
,|O| = 2
,Set(1, 2) ~~ 2
, so either accpept or reject, every word is mapped to some morphism from intial to final
- An automaton accepts a language (itself a functor , where is an observation subcategory of ) if a specific diagram commutes.
- is the category of automata accepting .
Automata isomorphism ~~ natural transformation
Output Categories and Monads
The output categories seen so far (Set, Set•, Rel, Vec, T) are often Kleisli categories for monads T: Set Set, specifying some effect:
- Set: Identity monad.
- Set• (partial functions): Maybe monad (option monad ).
- Rel: Powerset monad () for non-determinism.
- T (sequential transducers): Monad of partial free actions of ().
What in common? Answer. They are categories of free algebras (aka Kleisli categories) for monads specifying some effect: • the identity monad • the Maybe monad (aka option) • the powerset monad – non-determinism • the monad of partial free actions of _B_∗
PL perspective now!
Changing Output Categories via Adjunctions
Adjuction - For relating two categories in some way when they are not isomorphic
- Adjunction Recap: with means natural isomorphisms .
- yields .
- yields .
- Example 1 (Set vs Set•): .
- , .
option monad:
- Example 2 (Set vs Rel): .
- , .
powerset monad
- These are adjunctions between Set and , with identity on objects and .
Lifting Adjunctions
- If languages and are “the same” under adjunction, there’s a relationship between and .
Recall the map interpretation of language acceptance here
-
Completing DFAs: The completion of a DFA is a right adjoint to the inclusion of complete DFAs into DFAs (adjunction between Set• and Set).
-
Determinization of NFAs: Determinization (powerset construction) is a right adjoint to the inclusion of DFAs into NFAs (adjunction between Set and Rel).
- Corollary 2. Initial automata are “free” in Kleisli-valued automata.
Automata Minimization: Categorical Perspective
Classical DFA Minimization
- Left Quotient: For , .
aka language derivatives
- Myhill-Nerode Equivalence: .
Two words are equivalent if they have the same left quotient
- Myhill-Nerode Theorem: L is regular finitely many left quotients has finite index.
- Proof idea:
- If accepts L, then accepts .
- Nerode Automaton: States are , initial state is , final states are , .
- Proof idea:
- Minimization Process for a DFA :
- Remove unreachable states .
- Merge states accepting the same language (indistinguishable) .
Minimization of -Automata
What is the notion of minimal?
- A -automaton is minimal if it “divides” any other -automaton accepting the same language.
A DFA is minimal when it divides any other automaton accepting the same language. Here divides=«is a quotient of a sub-automaton of»
- “quotient” — “surjection for sets”
- “subobject” — “injection for sets”
- “Divides” means “is a quotient of a sub-automaton of”.
- This requires notions of “quotient” (surjection-like) and “subobject” (injection-like), i.e., a factorization system in .
- (epimorphisms/quotients), (monomorphisms/subobjects).
- Every morphism factors as with .
- Factorization is unique up to isomorphism (functorial).
Three Ingredients for Categorical Minimization
For a language , a minimal automaton exists if (the category of automata accepting ) has:
- An initial object .
- Exists if has copowers (related to reachability).
- For Set-DFAs: states , (maps to ), , (is ?).
- A final object .
- Exists if has powers (related to observability).
- For Set-DFAs: states (all possible languages), (maps to ), , (is ?).
- A factorization system in . Then is obtained from the unique morphism by factoring as .
- For DFAs, is . The factorization yields the Nerode automaton as .
- This framework applies to R-weighted automata and sequential transducers (yielding Choffrut’s minimal transducer).
- divides any automaton for : , and maps to .
Automata Learning: The Algorithm Categorically
- Goal: Learn a regular language L.
- Interaction: Learner asks Teacher:
- Membership queries: ”?“.
- Equivalence queries: “Does hypothesis automaton accept ?” If no, Teacher gives a counter-example.
- Algorithm maintains a pair of finite sets of words , starting with .
- : potential states (prefixes).
- : test words (suffixes) used for equivalence.
- T-equivalence (): .
- Observation Table Conditions:
- Closedness: . If not, add to .
- Consistency: . If not, find distinguishing and , add to .
- When is closed and consistent, a hypothesis automaton can be built.
Revisited Categorically
- Learner has access to a fragment of the language (boolean outcomes).
- This can be represented by a (Q,T)-biautomaton.
- Diagram: (conceptual, are state objects derived from ).
- Closure and consistency are encoded via the minimal (Q,T)-biautomaton.
- The minimal (Q,T)-biautomaton is .
- is surjective is closed.
- is injective is consistent.
- If is an isomorphism, the two state objects are merged to form .
- This yields a generic FunL* algorithm applicable to various automata types (DFAs, weighted automata over fields, sequential transducers).
FunL* Algorithm Sketch
- Initialize , .
- Repeat:
- While of the minimal (Q,T)-biautomaton is not an isomorphism (i.e., not closed or not consistent):
- If not closed ( ), enlarge (add for some ).
- If not consistent ( ), enlarge (add for some that breaks consistency).
- Build hypothesis . Ask equivalence query.
- If Teacher answers NO with counterexample : Add and its prefixes to .
- While of the minimal (Q,T)-biautomaton is not an isomorphism (i.e., not closed or not consistent):
- Until Teacher answers YES. Return .
Perspectives
- Explore conditions on a monad T such that has properties for minimization/learning.
Problem with free algebras (not ideal): doesn’t have good factorizations / products
move to larger categories:
- Move to Eilenberg-Moore algebras (e.g., join-semilattices for Rel-valued automata) if is not suitable.
- Extend to tree automata.
- Weighted automata over number rings.
- Learning nominal automata (building on work on automata in toposes).