Skip to content

Remove duplicated code; fix stack CSSR history loss (3/5) - #19

Closed
Autoplectic wants to merge 1 commit into
sofic-missing-constructionsfrom
sofic-dedup
Closed

Autoplectic wants to merge 1 commit into
sofic-missing-constructionsfrom
sofic-dedup

Conversation

@Autoplectic

@Autoplectic Autoplectic commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Stacked on #18.

  • generators/matrices.py: one home for joint matrices and start-vector policies; shared word enumeration and entropy.
  • Shared suffix scan and significance tests for CSSR, transCSSR, stack CSSR.
  • One NFA simulation, one bounded oracle base, VPA membership on the normalized form.
  • TikZ labels reuse shared formatting (fixes four LaTeX bugs).
  • Duplicate example processes merged.
  • Fix: stack CSSR determinization dropped histories, producing zero-mass states.

Made with Cursor

…amples; fix stack CSSR history loss

- generators/matrices.py is the one home for symbol-labeled joint matrices,
  stationary/limit laws, and start vectors (model vs stationary policy); shared
  word enumeration and entropy helpers; StochasticModel.reverse flattened.
- CSSR family: shared suffix scan (_suffix_counts.py) and significance tests
  (_morph_tests.py) for process CSSR, transCSSR, and stack CSSR; dead helpers
  (_cssr_homogenize and others) removed. The two G-tests were already identical
  (scipy applies the same Yates correction); now documented.
- Automata: one run_nfa, one bounded equivalence-oracle base, shared word
  iteration, removed intersect/concatenate/star aliases, VPA membership simulates
  the normalized form used by the constructions.
- Viz: TikZ labels reuse the shared edge spec and probability formatter; fixes
  uncompilable \midcall / \uparrowA, escaped \times, and escaped sympy LaTeX.
- Examples: nine duplicate process pairs now share one implementation; one
  stationary helper; same-name/different-process pairs cross-referenced.
- Stack CSSR: determinization replaced a split state with its largest bucket,
  dropping histories that never emitted the splitting symbol (stale mappings and
  zero-mass states that crashed validation); they now stay, and states with no
  edge into the kept set are pruned.

Co-authored-by: Cursor <cursoragent@cursor.com>
@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