Repository navigation
Property and metamorphic test suite (2/4) - #24
Merged
Merged
Conversation
Adds tests/test_properties_*.py: shifts, generators, inference, automata (DFA/NFA, Büchi, Wheeler, VPA/NWA, transducers, learners), serialization, viz and examples, checked against brute-force oracles and invariants. Fixes found by the suite: Fischer cover on reducible shifts, Parry measure transient states, TikZ newlines, from_hmm beyond 26 causal states, word_probability below 1e-15, backward(normalize=True) final row, complete() reusing an accepting trap after complement. reverse_is_finite is documented as mixed-state finiteness; experimental reverse_epsilon_machine_is_finite decides the recurrent question, and reversal warns on numeric truncation. YAML uses libyaml's C loader/dumper when available. Co-authored-by: Cursor <cursoragent@cursor.com>
Two closed joint classes matched the forward/reverse marginals and tied on the anatomy gap up to round-off; exact float comparison picked the wrong one on x86-64 (E = 1.0 instead of the brute-force 1.5), failing CI on Linux and Windows. Co-authored-by: Cursor <cursoragent@cursor.com>
The test matrix installed only the test extra, so every sympy-dependent test was skipped. Install symbolic across the matrix, and keep a single Ubuntu job without it so optional-dependency guards stay covered. Co-authored-by: Cursor <cursoragent@cursor.com>
Autoplectic
added a commit
that referenced
this pull request
Oct 7, 2026
Property and metamorphic test suite (2/4, landing #24 on main)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #23 (base
sofic-correctness-2); retarget tomainonce #23 merges.Tests
tests/test_properties_*.py— property and metamorphic tests built on thesofic.testingstrategies andtests/oracles.py:Fixes the suite found
EpsilonMachine.from_hmmhandles more than 26 causal states.word_probabilityno longer returns 0 below 1e-15;conditional_word_probabilityno longer divides by zero there.backward(normalize=True)normalizes the final row.complete()no longer reuses an accepting trap left by a complement (double complement returned the wrong language).reverse_is_finitedecides finiteness of the reverse mixed states, which is sufficient but not necessary for a finite reverse ε-machine (alternating biased coins fails it with a 2-state reverse machine). New experimentalreverse_epsilon_machine_is_finite()implements a merge-reachability criterion;from_time_reversed/to_bidirectionalwarn when numeric belief merging returns a truncation of an infinite reverse machine.markov_order/is_definitedocument that they assume a minimal presentation.Gates
pytest -n 8: 1780 passed, 15 skipped.ruff check/ruff format --checkclean. Freshsphinx-build -Wclean.