Skip to content

Gsm v2 - #111

Open
emuskardin wants to merge 63 commits into
masterfrom
gsm-v2
Open

Gsm v2#111
emuskardin wants to merge 63 commits into
masterfrom
gsm-v2

Conversation

@emuskardin

@emuskardin emuskardin commented Sep 9, 2026

Copy link
Copy Markdown
Member

TODO

add_labeled_sequence aggregates intermediate steps under unknown_output (DataHandler.py:100-110) and, when a later sequence resolves that output, only remaps transitions — the handler data is left alone. So count-based handlers on labeled_sequences split counts across two keys:

labeled: {'a': {<unknown_output>: 1, False: 1}}   vs   io_traces: {'a': {False: 2}}

shadow_pta keeps a stale unknown_output key the same way. Fixing it properly needs a "output resolved" hook on DataHandler (the remap is handler-specific), which is more than a minimal change, so I left it: it's captured as @unittest.expectedFailure in test_gsm_data_handler.py:46 with the cause in a comment. It flips to an unexpected success once fixed.
- GsmAlgorithms.py mealy sentinel leak: run_EDSM(..., automaton_type='mealy') on data that isn't prefix-closed (violates the documented precondition) doesn't raise — it silently produces a MealyMachine with unknown_output's sentinel object as a real transition's output. Low priority since it's already documented as unsupported, but corrupting silently instead of raising seems worth a guard.

Ensure, also in tests / run exaustive that I have added, that DFA and Moore learning works also with non-prefix closed data

zwergziege and others added 30 commits September 29, 2025 17:58
@emuskardin
emuskardin requested review from zwergziege and removed request for zwergziege September 9, 2026 17:00
Comment thread aalpy/learning_algs/general_passive/GeneralizedStateMerging.py
return list(score_iterable)
scores = list(score_iterable)
for special in (SpecialScores.ImmediateReject, SpecialScores.NoScore):
if any(score is special for score in scores):

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can understand why you want a conservative default. An issue I see with having a single NoScore result in NoScore is that it makes non-early scores meaningless if any of the score calculations returns NoScore, but they shouldn't do that anyways. This is probably just an indication that NoScore should be a proper sentinel and init_merge and early verdict computation should be split.

Comment thread aalpy/learning_algs/general_passive/AssociatedData.py

# any other cached candidate that speculatively touched this node (e.g. while resolving an
# unknown output through it) is now unsound to reuse: applying it would silently overwrite
# the just-promoted (now real, independently-decided) state with a stale speculative copy.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if i'm not mistaken, no such overwriting can happen, since promoting does not change the node. there is an issue though that the promotion changes what should be counted as blue node after the partition is applied, but it should be possible to compute that

@zwergziege

Copy link
Copy Markdown
Collaborator

regarding 1: since having counts for non-prefix-closed deterministic data is not all that useful, i suggest simply raising an exception if unknown_output is encountered in the data handler. if somebody really needs it, they can implement it themselves.

regarding 2: i think this behavior is perfectly fine. the classic RPNI version also does not raise on None outputs. a warning maybe.

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.

3 participants