-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
const { DeterministicFiniteAutomaton } = require('fauton');
const startsWithBC = new DeterministicFiniteAutomaton(
(inputString) => inputString.startsWith('bc'),
{
alphabets: ['a', 'b'],
transitions: {
A: ['A'],
B: [null, 'B'],
},
}
);The DFA accepts 2 alphabets a and b but in the transition map for state A, it only indicates where to go when we encounter the symbol a but not for b. This should not be the case for dfa. Even in the 2nd state B, it's gonna transition to null state for symbol a, which is also a violation for DFA. Every state must have an array of state strings that have an equal length as that of the alphabets to ensure we cover all cases. An error should be thrown in this regard
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working