Presentation is loading. Please wait.

Presentation is loading. Please wait.

Prof. Busch - LSU1 Pushdown Automata PDAs. Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States.

Similar presentations


Presentation on theme: "Prof. Busch - LSU1 Pushdown Automata PDAs. Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States."— Presentation transcript:

1 Prof. Busch - LSU1 Pushdown Automata PDAs

2 Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States

3 Prof. Busch - LSU3 Initial Stack Symbol Stack bottomspecial symbol stack head top Appears at time 0

4 Prof. Busch - LSU4 The States Input symbol Pop symbol Push symbol

5 Prof. Busch - LSU5 top input stack Replace

6 Prof. Busch - LSU6 Push top input stack

7 Prof. Busch - LSU7 Pop top input stack

8 Prof. Busch - LSU8 No Change top input stack

9 Prof. Busch - LSU9 Non-Determinism PDAs are non-deterministic Allowed non-deterministic transitions

10 Prof. Busch - LSU10 Example PDA PDA :

11 Prof. Busch - LSU11 Basic Idea: 1.Push the a’s on the stack 2. Match the b’s on input with a’s on stack 3. Match found

12 Prof. Busch - LSU12 Execution Example: Input current state Time 0 Stack

13 Prof. Busch - LSU13 Input Time 1 Stack

14 Prof. Busch - LSU14 Input Stack Time 2

15 Prof. Busch - LSU15 Input Stack Time 3

16 Prof. Busch - LSU16 Input Stack Time 4

17 Prof. Busch - LSU17 Input Stack Time 5

18 Prof. Busch - LSU18 Input Stack Time 6

19 Prof. Busch - LSU19 Input Stack Time 7

20 Prof. Busch - LSU20 Input Time 8 accept Stack

21 Prof. Busch - LSU21 A string is accepted if there is a computation such that: All the input is consumed AND The last state is an accepting state we do not care about the stack contents at the end of the accepting computation

22 Prof. Busch - LSU22 Rejection Example: Input current state Time 0 Stack

23 Prof. Busch - LSU23 Rejection Example: Input current state Time 1 Stack

24 Prof. Busch - LSU24 Rejection Example: Input current state Time 2 Stack

25 Prof. Busch - LSU25 Rejection Example: Input current state Time 3 Stack

26 Prof. Busch - LSU26 Rejection Example: Input current state Time 4 Stack

27 Prof. Busch - LSU27 Rejection Example: Input current state Time 4 Stack reject

28 Prof. Busch - LSU28 The string is rejected by the PDA There is no accepting computation for

29 Prof. Busch - LSU29 Another PDA example PDA :

30 Prof. Busch - LSU30 Basic Idea: 1.Push v on stack 2. Guess middle of input 3. Match on input with v on stack 4. Match found

31 Prof. Busch - LSU31 Execution Example: Input Time 0 Stack

32 Prof. Busch - LSU32 Input Time 1 Stack

33 Prof. Busch - LSU33 Input Time 2 Stack

34 Prof. Busch - LSU34 Input Time 3 Stack Guess the middle of string

35 Prof. Busch - LSU35 Input Time 4 Stack

36 Prof. Busch - LSU36 Input Time 5 Stack

37 Prof. Busch - LSU37 Input Time 6 Stack accept

38 Prof. Busch - LSU38 Rejection Example: Input Time 0 Stack

39 Prof. Busch - LSU39 Input Time 1 Stack

40 Prof. Busch - LSU40 Input Time 2 Stack

41 Prof. Busch - LSU41 Input Time 3 Stack Guess the middle of string

42 Prof. Busch - LSU42 Input Time 4 Stack

43 Prof. Busch - LSU43 Input Time 5 Stack There is no possible transition. Input is not consumed

44 Prof. Busch - LSU44 Another computation on same string: Input Time 0 Stack

45 Prof. Busch - LSU45 Input Time 1 Stack

46 Prof. Busch - LSU46 Input Time 2 Stack

47 Prof. Busch - LSU47 Input Time 3 Stack

48 Prof. Busch - LSU48 Input Time 4 Stack

49 Prof. Busch - LSU49 Input Time 5 Stack No accept state is reached

50 Prof. Busch - LSU50 There is no computation that accepts string

51 Prof. Busch - LSU51 Pushing & Popping Strings Input symbol Push string Pop string

52 Prof. Busch - LSU52 top input stack Replace push string Example: pop string top

53 Prof. Busch - LSU53 pop push Equivalent transitions

54 Prof. Busch - LSU54 Another PDA example PDA

55 Prof. Busch - LSU55 Time 0 Input current state Stack Execution Example:

56 Prof. Busch - LSU56 Time 1 Input Stack

57 Prof. Busch - LSU57 Time 3 Input Stack

58 Prof. Busch - LSU58 Time 4 Input Stack

59 Prof. Busch - LSU59 Time 5 Input Stack

60 Prof. Busch - LSU60 Time 6 Input Stack

61 Prof. Busch - LSU61 Time 7 Input Stack

62 Prof. Busch - LSU62 Time 8 Input Stack accept

63 Prof. Busch - LSU63 Formalities for PDAs

64 Prof. Busch - LSU64 Transition function:

65 Prof. Busch - LSU65 Transition function:

66 Prof. Busch - LSU66 Formal Definition Pushdown Automaton (PDA) States Input alphabet Stack alphabet Transition function Accept states Stack start symbol Initial state

67 Prof. Busch - LSU67 Instantaneous Description Current state Remaining input Current stack contents

68 Prof. Busch - LSU68 Input Stack Time 4: Example:Instantaneous Description

69 Prof. Busch - LSU69 Input Stack Time 5: Example:Instantaneous Description

70 Prof. Busch - LSU70 We write: Time 4 Time 5

71 Prof. Busch - LSU71 A computation:

72 Prof. Busch - LSU72 For convenience we write:

73 Prof. Busch - LSU73 Language of PDA Language accepted by PDA : Initial state Accept state

74 Prof. Busch - LSU74 Example: PDA :

75 Prof. Busch - LSU75 PDA :

76 Prof. Busch - LSU76 PDA : Therefore:


Download ppt "Prof. Busch - LSU1 Pushdown Automata PDAs. Prof. Busch - LSU2 Pushdown Automaton -- PDA Input String Stack States."

Similar presentations


Ads by Google