Implementing a simple NFA in C
By Asim Krishna Prasad
Posted on 19/01/15
Tag :
Algorithm
Implemented a NFA (Non-Deterministic finite automaton) simulator in C today. It takes input all the parameters for a NFA-machine and then takes multiple strings to check if they can be accepted by the defined machine.
The implementation came out as an assignment so didn't have much time to refine it but here it is.. a crude form of it.. Implemented as extension of this program.
NOTE : This program is limited to the case where the symbols are only positive integers. The same program can be extended for any type of symbol by changing a few lines of codes. Try it :) .
Checked the code on a few testcases but their might be a bug in the code. If you find any or get a wrong output, mention it in the comments. Thanks :) .
SAMPLE OUTPUT :
Hope it helps :)
Asim Krishna Prasad
COMMENTS :