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