Growth of Functions - PowerPoint PPT Presentation

About This Presentation
Title:

Growth of Functions

Description:

Chapter 8 Properties of CFL 8.2: Closure Properties for CFL (1) A set is closed under some operation if performing that operation on members of the set always ... – PowerPoint PPT presentation

Number of Views:52
Avg rating:3.0/5.0
Slides: 8
Provided by: HPProBo
Category:
Tags: functions | growth

less

Transcript and Presenter's Notes

Title: Growth of Functions


1
Chapter 8 Properties of CFL
2
8.2 Closure Properties for CFL (1)
  • A set is closed under some operation if
    performing that operation on members of the set
    always produces a member of that set.
  • Assume that
  • L1, L2 are context-free languages
  • CFG for L1 is G1 (NT1 , ?1, P1, S1
  • CFG for L2 is G2 (NT2 , ?2, P2, S2
  • R is a regular language
  • CFLs are closed under the operations of
  • Union, concatenation, Kleene closure
  • CFLs are not closed under
  • Intersection, complementation

3
8.2 Closure Properties for CFL (2)
  • Union L L1 ? L2
  • G (S ? NT1 ? NT2, ?1 ? ?2,
  • P1 ? P2 ? S ? S1 S2, S)
  • Concatenation L L1L2
  • G (S ? NT1 ? NT2, ?1 ? ?2,
  • P1 ? P2 ? S ? S1S2, S)
  • Closure L L1
  • G (S ? NT1, ?1, P1 ? S ? ? S1S, S)
  • Assumes Non-terminl names distinct in NT1 and
    NT2. Otherwise, can rename consistently.

4
8.2 Closure Properties for CFL (3)
  • Intersection L L1 ? L2
  • L not necessarily context-free.
  • CFLs are not closed under intersection!
  • Cant simulate two stacks by one stack.
  • L1 an bn cm n, m ? 0
  • is CFL
  • L2 an bm cm n, m ? 0
  • is CFL
  • L L1 ? L2 ak bk ck k ? 0
  • is NOT CFL

5
8.2 Closure Properties for CFL (4)
  • __
  • Complementation L L1
  • L not necessarily context-free.
  • CFLs are not closed under complementation!
  • By DeMorgans Law,
  • since union closed,
  • if complementation closed, so is intersection.
    (contradiction)

6
8.2 Closure Properties for CFL (5)
  • Intersection with RL L L1 ? R
  • L is context-free.
  • Intuition Only one stack to simulate, so OK.
  • Example show that L anbn n 0, n ? 100 is
    context-free
  • L1 anbn n 0 is context-free
  • L2 a100b100 is finite, so it is regular
  • __
  • L2 is regular (regular languages closed under
    complementation)
  • __
  • L L1 ? L2 is context-free

7
8.2 Closure Properties for CFL (6)
  • For any context free grammar, we can decide
  • membership (can the grammar generate a given
    string)
  • if it is empty (the grammar does not generate any
    strings)
  • if it is infinite (the grammar generates and
    infinite number of strings)
  • However, there is no algorithm for deciding
    whether two context-free grammars generate the
    same language!
Write a Comment
User Comments (0)
About PowerShow.com