Open odats opened 4 years ago
Something like this:
def from_table_to_transition_function(table):
transition_function = {i : {0:s[0], 1:s[1]} for i, s in enumerate(table)}
return transition_function
def get_random_dfa(number_of_states = 6, alphabet_size = 2):
dfa_table = np.random.randint(number_of_states, size=(number_of_states, alphabet_size))
transition_function = from_table_to_transition_function(dfa_table)
dfa = SimpleDFA.from_transitions(0, {number_of_states-1}, transition_function)
return dfa
Hi @odats , thank you for the feature request, and thank you very much for your interest in the library. We will surely keep in mind this request, although in the short term the focus of the library will be more on better APIs, other concrete implementations of the main interfaces, and implementation of transducers.
I train Neural Network to recognize DFA given accept / not accept strings. It would be nice to have a method that samples random DFA with maximum size N and K strings that are accepted and K strings that are not accepted by this automaton.