Reference no: EM133406912
Question 1: Implement SSC
Create an implementation of subset construction (with lazy evaluation) to convert an NFA to a DFA. The states of the DFA look like this: "{p,q}". You take the states of the NFA in alphabetical order, separated by commas and surrounded by braces.
First test your code on some examples from the course. If you time out on INGinious, you probably made a mistake on the second test.
You implement it so that the following test code works:
#include "NFA.h"
using namespace
std;
int main() {
NFA nfa("input-sscl.json");
nfa.toDFAO.print();
return 0;
with as input
"type": "NFA", "alphabet": (
"states": (
{
"name": "0", "starting": true, "accepting": false
"name": "1", "starting": false, "accepting": true
"name": "2", "starting": false, "accepting": false
"name": "3", "starting": false, accepting": false
"name": "4", "starting": false, accepting": false
"transitions": (
{
"from": "0",
"input": "c"
"from": "0",
"input": "c"
"from": "1", "to": "4", "input": "c"
"from": "2", "to": "1", "input": "c"
"from": "3", "to": "2", "input": "c"
"from": "4", "to": "2", "input": "c"
You just send in the necessary classes, without main and without input file this time. If this first question is not correct, you cannot get any points for this assignment.