..FILE:del_eqv.cpp.hwp#include #include #include #include #include #define MAX 10 // 받아들일 상태의 최대수#define BUFFER_SIZE 30 / 한 line의 크기typedef struct state_table{ //it read state table from input fileint no; // State numberchar ps; // Present Statechar ns[2]; // Next Statechar po[3]; // Present Output}State;typedef struct imp_chart{ // making up implication chart, it is usedchar eqv[2][2]; // states inscripted in a lattice of impchar iseqv; // to make sure whether it is equiv or not}Chart;State *state[15]; // 받아들인 각 상태의 포인터int state_num; // 받아들인 상태의 수int moore_or_mealy; // line당 받아들인 입력값을 개수로 type 판단FILE *result; // result write/* init_input 함수는 main으로부터 파일 이름을 전달받아..... state[i]포인터 변수에 각 상태를연결한다 */void init_input(char *source_fname){FILE *source; // data 입력을 위한 파일int s_count = 0; // 상태 카운트char buffer[BUFFER_SIZE]; // fgets로 라인을 읽어들이기 위한 버퍼if((source = fopen(source_fname,"r")) == NULL){printf("nWrong filename! Try again.");exit(1);}--------------------------------------------------------close(source);}void print_state_num(void) // 입력받은 상태의 크기와 type를 출력{result = fopen("result.txt","w");fprintf(result,"*state_type : %s | *state_num : %dn",(moore_or_mealy == 4) ? "Moore" : "Mealy" , state_num);}void check_term(char *term){if(term[0] == term[1])term[0] = term[1] = '