-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix to_state_setup() with unreachable states #62
base: master
Are you sure you want to change the base?
Conversation
Hi, good catch, thank you! In other words, if a state is unreachable, it might as well not exist. Will fix tomorrow |
Hm, I get your point, but in my opinion, ignoring the unreachable state is more confusing... For example, since A possible (admittedly contrived) usecase could be, creating a model with only states (no transitions yet), copying it, and then adding different transitions to both models. If the copy-operation removed unreachable states, this would not be possible. Also, there might be learning algorithms, which (perhaps on accident) produce unreachable states - then ignoring these states during copy might hide the bug sometimes (if copy() is used) but not other times... |
I will see still, need to sleep it over :p I would still consider all of these in some way or another improper handling of states. |
@MaxiSchwindler |
Not during natural use of AALpy, no, but during use of the PMSAT-Inference algorithm - which uses Partial Max-SAT-solving to learn an automaton with exactly the given number of states... So there it can happen that the returned hypothesis has unreachable states (and it makes some sense not to do pruning directly in that algorithm, otherwise you'd e.g. request an automaton with 5 states but receive one with 4). |
...but I don't think that algorithm is the best argument for keeping the unreachable states on copy(). I'd still simply argue that "copy()" should mean "exact copy", regardless of anything else. If there is an unreachable state in the original, it would make sense to me for it to be also in the copy. |
The method
to_state_setup()
of multiple automata types (DFA, Mealy, Moore) fails when the automaton contains an unreachable state (i.e. the state's prefix isNone
- not an empty tuple!). This also means that we cannot copy such an automaton if it contains an unreachable state, sincecopy()
usesto_state_setup()
: