Skip to content

Distromaton, xor automata, and the universal automaton; their shift presentations - #65

Merged
Autoplectic merged 1 commit into
mainfrom
canonical-nfa-varieties
Nov 16, 2026
Merged

Autoplectic merged 1 commit into
mainfrom
canonical-nfa-varieties

Conversation

@Autoplectic

Copy link
Copy Markdown
Member

Completes the canonical NFAs of two papers and carries them over to shifts and HMMs where that makes sense:

  • Myers, Adámek, Milius & Urbat, Canonical Nondeterministic Automata, CMCS 2014 (doi)
  • Zetzsche, van Heerdt, Sammartino & Silva, Canonical Automata via Distributive Law Homomorphisms, MFPS 2021 (doi)

Both build canonical NFAs by closing the residuals under the operations of an algebra and taking a minimal set of generators as states. sofic already had the canonical RFSA (the papers' jiromaton), the átomaton, and the maximized prime átomaton.

Automata: new module sofic.automata.canonical.closures

From the papers API
Distromaton Distromaton, distromaton_from_language
Minimal xor automaton minimal_xor_automaton, plus a new sofic.automata.xor.XorAutomaton (parity acceptance)
Minimal xor-CABA automaton (new in Zetzsche et al.) xor_caba_automaton(basis="residuals" | "atoms")
Universal automaton (Lombardy–Sakarovitch) UniversalAutomaton
Minimal semilattice / lattice / Boolean / GF(2) DFA minimal_structured_dfa(language, variety)
Intersection-closed languages (Thm 4.4) is_intersection_closed

All constructions are exact. Every closure element is a union of atoms, and the atoms are the states of the minimal DFA of the reversed language, so each language is stored as a set of those states: derivatives are preimages, and union, intersection and symmetric difference are set operations.

XorAutomaton is not a LabeledAutomaton, because that base class's language operations (emptiness, inclusion, union, reverse) assume NFA acceptance. Language operations go through determinize().

Shifts

  • distromaton_presentation and universal_presentation, also available as SoficShift methods.
  • follower_sets_intersection_closed: when it holds, canonical_rfsa_presentation has the fewest states of any presentation (Thm 4.4 plus the fact that a smallest presentation is essential). Brute-force tested against every smaller labeled graph.
  • Canonical presentations now trim the automaton before building the graph. The universal automaton's empty-residual state is accessible and has a loop on every symbol, so without trimming it presents the full shift. The three existing presentations are unaffected.

HMMs

  • Documented, with proof, that canonical_rfsa_hmm (and maximized_prime_atomaton_hmm in reverse time) has the fewest states among generators whose state morphs are mixtures of causal-state morphs. This is the stochastic counterpart of the canonical RFSA's minimality. The argument is new, not from the literature.
  • The minimal xor automaton is cross-referenced as the GF(2) counterpart of minimal_quasi_realization.
  • There is no distromaton or universal-automaton analogue, because mixtures have no meet.

Tests

  • The papers' worked examples: (a+b)*a, with every figure count matching, and (a+b)*b(a+b)^n.
  • The distromaton against Myers et al.'s second construction (the reverse minimal DFA ordered by inclusion), matching in states, transitions, initial and accepting states.
  • The minimal xor automaton's size against the GF(2) rank of a brute-force Hankel matrix.
  • Corollaries 3.21 and 4.6.
  • The full suite passes, the docs build with -W, and ty reports no new diagnostics.

Two errata in the papers

  • Zetzsche et al., Fig. 10: the xor-CABA "basis" {4, 6, 7, 8} is linearly dependent (4 ⊕ 6 ⊕ 8 = 0) in a 3-dimensional space, so the minimal automaton has 3 states.
  • Myers et al., Remark 4.5: the claim that {aa} is not intersection-closed contradicts their Example 4.3, which says every singleton is.

…resentations

Completes the canonical NFAs of Myers, Adamek, Milius & Urbat (CMCS 2014) and
Zetzsche, van Heerdt, Sammartino & Silva (MFPS 2021): Distromaton,
minimal_xor_automaton, xor_caba_automaton, UniversalAutomaton,
minimal_structured_dfa and is_intersection_closed, all exact via the atom
representation (sets of states of the minimal DFA of the reversed language).
Adds XorAutomaton (parity acceptance), distromaton and universal shift
presentations, follower_sets_intersection_closed (certifies the canonical RFSA
presentation is smallest), and the class-minimality of canonical_rfsa_hmm.
@Autoplectic
Autoplectic merged commit 295d9d8 into main Nov 16, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant