1.05k likes | 1.1k Vues
Non-Deterministic Finite Automata. Nondeterministic Finite Automaton (NFA). Alphabet =. Alphabet =. Two choices. Alphabet =. Two choices. No transition. No transition. First Choice. First Choice. First Choice. All input is consumed. “accept”. Second Choice. Second Choice.
E N D
Nondeterministic Finite Automaton (NFA) Alphabet =
Alphabet = Two choices
Alphabet = Two choices No transition No transition
First Choice All input is consumed “accept”
Second Choice Input cannot be consumed Automaton Halts “reject”
An NFA accepts a string: if there is a computation of the NFA that accepts the string i.e., all the input string is processed and the automaton is in an accepting state
is accepted by the NFA: “accept” “reject” because this computation accepts this computation is ignored
First Choice “reject”
Second Choice “reject”
First Choice Input cannot be consumed “reject” Automaton halts
Second Choice Input cannot be consumed Automaton halts “reject”
An NFA rejects a string: if there is no computation of the NFA that accepts the string. For each computation: • All the input is consumed and the • automaton is in a non final state OR • The input cannot be consumed
is rejected by the NFA: “reject” “reject” All possible computations lead to rejection
is rejected by the NFA: “reject” “reject” All possible computations lead to rejection
all input is consumed “accept” String is accepted
Input cannot be consumed Automaton halts “reject” String is rejected
Language accepted (redundant state)
Remarks: • The symbol never appears on the • input tape • Simple automata:
NFAs are interesting because we can • express languages easier than DFAs NFA DFA