-
Notifications
You must be signed in to change notification settings - Fork 17
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
Create Nft with inverted levels (tapes) #485
Conversation
I merged the PR so we can quickly iterate on transducers. The reviews can come later. |
Hi, I don't think we are in a such hurry to merge everything. I have at least one thing: rename please |
This is incompatible with the original idea that the base data structure is just an automaton with levels. The fact that is precisely models a transducer if you squint hard enough is basically just a happy accident with this idea. We never use the word Of course, we can discuss if this is a good approach, or not. But as of now, it is the only approach possible to stay in line with in the codebase. |
I am not talking about the internal representation. It is definitely ok to use levels in the internal representation of undelying autoton structure. But in the top-level API you provide should not imo use level. You provide API for working with transducers. At least for the common operations the naming conventions should be compatible with the rest of the automata world. |
That I can understand. The problem is that there is no internal representation in Mata. The whole Mata is made in such a way that everything is public and one can access (nearly) any member variable or method. That means that if we have the high-level API (shared among the automata models) using |
Ok, I see. In the light of this, from architecture point of view it is a bit unfortunate that the base class for level automata coincides with transducers. Anyway, I fine with a creation of alias level=tape for transducers in my head. |
This PR introduces:
Nft::invert_levels
with tests:Nft::invert_levels
creates an Nft where the 1st tape becomes the n-th, the 2nd becomes the (n-1)-th, and so on.(a,b)----a---->(c,d)----b---->(e,f)
will become(b,a)----a---->(d,c)----b---->(f,e)
StatePost::get_successors
andDelta::get_successors
Delta::post
in the future.Delta::get_transitions_between
:state_from
tostate_to
Levels::count
:std::count
Nft::num_of_states_with_level
:count