Formal Languages Finite Automata Finite Automaton Input String

  • Slides: 64
Download presentation
Formal Languages Finite Automata

Formal Languages Finite Automata

Finite Automaton Input String Output Finite Automaton “Accept” or “Reject” 2

Finite Automaton Input String Output Finite Automaton “Accept” or “Reject” 2

Transition Graph initial state transition accepting state 3

Transition Graph initial state transition accepting state 3

Initial Configuration Input String 4

Initial Configuration Input String 4

Reading the Input 5

Reading the Input 5

6

6

7

7

8

8

Input finished accept 9

Input finished accept 9

Rejection 10

Rejection 10

11

11

12

12

13

13

Input finished reject 14

Input finished reject 14

Acceptance or Rejection? 15

Acceptance or Rejection? 15

Initial State 16

Initial State 16

Rejection reject 17

Rejection reject 17

Language? 18

Language? 18

Another Example 19

Another Example 19

20

20

21

21

22

22

Input finished accept 23

Input finished accept 23

Rejection Example 24

Rejection Example 24

25

25

26

26

27

27

Input finished reject 28

Input finished reject 28

Languages Accepted by FAs FA Definition: The language contains all input strings accepted by

Languages Accepted by FAs FA Definition: The language contains all input strings accepted by = { strings that bring to an accepting state} 29

Example: L(M) = ? accept 30

Example: L(M) = ? accept 30

Example accept 31

Example accept 31

Example: L(M) = ? accept 32

Example: L(M) = ? accept 32

Example accept 33

Example accept 33

Example: L(M) = ? accept trap state 34

Example: L(M) = ? accept trap state 34

Example accept trap state 35

Example accept trap state 35

Formal Definition Finite Automaton (FA) : set of states : input alphabet : transition

Formal Definition Finite Automaton (FA) : set of states : input alphabet : transition function : initial state : set of accepting states 36

Input Alphabet 37

Input Alphabet 37

Set of States 38

Set of States 38

Initial State 39

Initial State 39

Set of Accepting States 40

Set of Accepting States 40

Transition Function 41

Transition Function 41

42

42

43

43

44

44

Transition Function 45

Transition Function 45

Extended Transition Function 46

Extended Transition Function 46

47

47

48

48

49

49

Observation: if there is a walk from with label then to 50

Observation: if there is a walk from with label then to 50

Example: There is a walk from with label to 51

Example: There is a walk from with label to 51

Recursive Definition 52

Recursive Definition 52

53

53

Language Accepted by FAs For a FA Language accepted by : 54

Language Accepted by FAs For a FA Language accepted by : 54

Observation Language rejected by : 55

Observation Language rejected by : 55

L(M) ? accept 56

L(M) ? accept 56

Example = { all strings with prefix } accept 57

Example = { all strings with prefix } accept 57

L(M)? 58

L(M)? 58

Example = { all strings without substring } 59

Example = { all strings without substring } 59

L(M) ? 60

L(M) ? 60

Example 61

Example 61

Regular Languages Definition: A language is regular if there is FA such that Observation:

Regular Languages Definition: A language is regular if there is FA such that Observation: All languages accepted by FAs form the family of regular languages 62

Examples of regular languages: { all strings with prefix } { all strings without

Examples of regular languages: { all strings with prefix } { all strings without substring } There exist automata that accept these Languages (see previous slides). 63

There exist languages which are not Regular: Example: There is no FA that accepts

There exist languages which are not Regular: Example: There is no FA that accepts such a language (we will prove this later in the class) 64