Skip to content

Implement canonical RFSA, prime atomaton, NL*, and concrete VPA constructions (2/5) - #18

Closed
Autoplectic wants to merge 3 commits into
sofic-correctness-fixesfrom
sofic-missing-constructions
Closed

Autoplectic wants to merge 3 commits into
sofic-correctness-fixesfrom
sofic-missing-constructions

Conversation

@Autoplectic

@Autoplectic Autoplectic commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Stacked on #17.

  • Exact canonical RFSA (Denis et al. 2002), maximized prime atomaton (Maarand & Tamm 2022; not atomic in general, so it now subclasses NFA), exact residuals/atoms, faithful NL* (Bollig et al. 2009).
  • VPA: Alur-Madhusudan determinization, concrete union/intersection/complement/difference/concat/star, emptiness/universality/inclusion/equivalence, conversion to single/multiple-entry form. Lazy CompositeVisiblyPushdownAutomaton removed.
  • Canonical VPA raises on non-well-matched languages and no longer accepts pending calls.
  • Property tests compare every construction with brute-force reference semantics.

Made with Cursor

Ryan James and others added 3 commits October 6, 2026 15:38
…toms, and NL*

- ResidualTable decides residual inclusion and union coverage exactly on the
  minimal DFA; canonical_rfsa_from_language builds the Denis-Lemay-Terlutte
  canonical RFSA (was a relabeled minimal DFA).
- Maximized prime atomaton = reverse of the canonical RFSA of the reversed
  language (Maarand & Tamm 2022). It need not be atomic (Tamm 2015), so it now
  subclasses NFA rather than AtomicAutomaton; CanonicalRFSA.dual() and
  MaximizedPrimeAtomaton.dual() reverse between them.
- ResidualFiniteStateAutomaton.validate checks every state accepts a residual.
- prime_residuals, atoms, prime_atoms are exact (were bounded-length checks that
  tested equality instead of union, and returned quotients as atoms).
- Faithful NL* (Bollig et al. 2009) learning the canonical RFSA, a reversed
  learner for the prime atomaton, NL*-style table extraction, and an exact
  AutomatonEquivalenceOracle returning shortest counterexamples.

Co-authored-by: Cursor <cursoragent@cursor.com>
…and a correct canonical VPA

- Normalized VPA form (explicit bottom, guarded returns); documented wildcard
  returns as firing on every stack symbol and on the empty stack with a bottom.
- Alur-Madhusudan determinization; DeterministicVisiblyPushdownAutomaton.from_vpa
  determinizes nondeterministic input instead of raising.
- Concrete union, intersection, complement, difference, concatenation, and
  Kleene star (boundary-bit construction for per-factor empty stacks); the lazy
  CompositeVisiblyPushdownAutomaton and the *_vpa free functions are removed.
- Emptiness via well-matched summary saturation, accepted_word witnesses,
  is_universal, includes, equivalent, and has_unmatched_word.
- to_single_entry / to_multiple_entry convert well-matched VPAs into modular
  form; modular minimize converts automatically when no modules are given.
- CanonicalVisiblyPushdownAutomaton raises NonWellMatchedLanguageError on
  languages with pending calls/returns, and no longer accepts pending calls or
  depends on class representatives (joint top-level/nested congruence).
- NestedWordAutomaton operations delegate through the tagged VPA encoding.
- Property tests check every operation against brute-force reference semantics.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@Autoplectic
Autoplectic force-pushed the sofic-missing-constructions branch from cc544ca to 7ea187a Compare October 6, 2026 21:39
@Autoplectic

Copy link
Copy Markdown
Member Author

Superseded by #22, which contains the same commits as a single PR.

@Autoplectic Autoplectic closed this Oct 6, 2026
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