Esempio n. 1
0
def Useful_States(StateList,Accepted):
    Useful_List = []
    Useful_List = Useful_List + Accepted
    for state in StateList:
        next_state = reach_Automata(StateList,state)
        for Acptstate in Accepted:
            if Acptstate in next_state:
                Useful_List.append(state.StateName)
    return Useful_List
Esempio n. 2
0
def check_Empty(StateList,Accepted,Initial):

    if(Accepted == []):
        return "Language accepts empty language"
    else:
        flag = 0
        for state in Initial:
            if(StateList[state].Final==1):
                return "Language accepts epsilon"
                exit(0)
        for state in StateList:
            if state.Initial == 1:
                next_States = reach_Automata(StateList,state)
                flag = check(next_States,Accepted)
                if(flag==1):
                    return "Automata accepts some language"

        return "Automata has empty language"