1 Non-Deterministic Finite Automata
2 Alphabet = Nondeterministic Finite Automaton (NFA)
3 Two choices Alphabet =
4 No transition Two choices No transition Alphabet =
5 First Choice
6
7
8 “accept” First Choice All input is consumed
9 Second Choice
10 Second Choice
11 Second Choice No transition: the automaton hangs
12 Second Choice “reject” Input cannot be consumed
13 An NFA accepts a string: when there is a computation of the NFA that accepts the string all the input is consumed and the automaton is in an accepting state There is a computation:
14 Example is accepted by the NFA: “accept” “reject” because this computation accepts
15 Rejection example
16 First Choice
17 First Choice “reject”
18 Second Choice
19 Second Choice
20 Second Choice “reject”
21 An NFA rejects a string: when there is no computation of the NFA that accepts the string. All the input is consumed and the automaton is in a non final state The input cannot be consumed OR For each computation:
22 Example is rejected by the NFA: “reject” All possible computations lead to rejection
23 Rejection example
24 First Choice
25 First Choice No transition: the automaton hangs
26 “reject” First Choice Input cannot be consumed
27 Second Choice
28 Second Choice
29 Second Choice No transition: the automaton hangs
30 Second Choice “reject” Input cannot be consumed
31 is rejected by the NFA: “reject” All possible computations lead to rejection
32 Language accepted:
33 Lambda Transitions
34
35
36 (read head does not move)
37
38 “accept” String is accepted all input is consumed
39 Rejection Example
40
41 (read head doesn’t move)
42 No transition: the automaton hangs
43 “reject” String is rejected Input cannot be consumed
44 Language accepted:
45 Another NFA Example
46
47
48
49 “accept”
50 Another String
51
52
53
54
55
56
57 “accept”
58 Language accepted
59 Another NFA Example
60 Language accepted (redundant state)
61 Remarks: The symbol never appears on the input tape Simple automata:
62 NFA FA NFAs are interesting because we can express languages easier than FAs
63 Formal Definition of NFAs Set of states, i.e. Input aplhabet, i.e. Transition function Initial state Accepting states
64 Transition Function
65
66
67
68 Extended Transition Function
69
70
71 Formally : there is a walk from to with label
72 The Language of an NFA
73
74
75
76
77 Formally The language accepted by NFA is: where and there is some (accepting state)
78