void Supremal_Cont_Sub_Lang(char *ifile1, char *ifile2, char *ifile3, char *ifile4, int threefiles, int fourfiles, FILE *f10)
{
        FILE *f1, *f2, *f3, *f4, *f5;
        FSM fsm1, fsm2, fsm3, fsm4;
        char varfname[MAX_LENGTH];
        
        /* To determine the supremal controllable sublanguage */
        
        if(!(threefiles || fourfiles))
        {
                ifile1 = "../data/supcon_plant.data";
                ifile2 = "../data/supcon_spec.data";
                ifile3 = "../data/supcon_plant.data_events";
                ifile4 = "../data/supcon.results";
        }
        else if(threefiles){ /*set up default file*/
                strcpy(ifile4, ifile3); /*move result filename to ifile4*/
                strcpy(varfname, ifile1);
                strcat(varfname, "_events");
                ifile3 = varfname;
        }
        f1 = fopen(ifile1, "r");
        f2 = fopen(ifile2, "r");
        f3 = fopen(ifile3, "r");
        f4 = fopen(ifile4, "w");
        
        po_extract_events(f3); /*get cont. info from cont/mask info, creates clist.tmp*/
        f5 = fopen("clist0.tmp", "r"); /*info in clist.tmp*/   
        
        fsm_read(f1, &fsm1);
        fsm_read(f2, &fsm2);
        fsm_trim_sup_cont_sublang(&fsm1, &fsm2, &fsm3, f5);
        fsm_print(f4, &fsm3);
                                                
        fclose(f1);
        fclose(f2);
        fclose(f3);
        fclose(f4);
        fclose(f5);

        po_remove_event_temp_files();
        fsm_delete(&fsm1);
        fsm_delete(&fsm2);
        fsm_delete(&fsm3);

        fprintf(f10, "Supermal controllable fsm 1 as input file 1:\n\t");
        fprintf(f10, " %s \n", ifile1);
        fprintf(f10, "and fsm 2 as input file 2:\n\t %s \n", ifile2);
        fprintf(f10, "Output supremal controllable fsm output file:\n\t");
        fprintf(f10, " %s \n\n\n", ifile4);

        /*end k*/
}

