Skip to content
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

Check that for dfa all states must be present in transition map #2

Open
Devorein opened this issue Nov 13, 2021 · 0 comments
Open

Check that for dfa all states must be present in transition map #2

Devorein opened this issue Nov 13, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@Devorein
Copy link
Owner

Devorein commented Nov 13, 2021

const { DeterministicFiniteAutomaton } = require('fauton');

const startsWithBC = new DeterministicFiniteAutomaton(
	(inputString) => inputString.startsWith('bc'),
	{
		alphabets: ['a', 'b'],
		states: ['A', 'B', 'C'],
		transitions: {
			A: ['B', 'A'],
			B: ['A', 'B'],
		},
	}
);

Transition for state 'C' is not present, but no error is thrown. Ideally, the user should provide all the states in the transition map, but if not an error should be generated as that's the condition of a dfa.

@Devorein Devorein self-assigned this Nov 13, 2021
@Devorein Devorein added the bug Something isn't working label Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant