Closure properties of RE, Rec Recall that a language L is - - - PowerPoint PPT Presentation

closure properties of re rec
SMART_READER_LITE
LIVE PREVIEW

Closure properties of RE, Rec Recall that a language L is - - - PowerPoint PPT Presentation

[Section 10.1] Closure properties of RE, Rec Recall that a language L is - recursively enumerable (RE) if there exists a TM for L, - recursive (Rec) if there exists a TM for L which halts on every input (i.e. also on strings not from L). Is the


slide-1
SLIDE 1

Closure properties of RE, Rec

Recall that a language L is

  • recursively enumerable (RE) if there exists a TM for L,
  • recursive (Rec) if there exists a TM for L which halts on

every input (i.e. also on strings not from L). Is the class RE closed under union ? And intersection ? Is the class Rec closed under union ? And intersection ? What can we say about complement ?

[Section 10.1]

slide-2
SLIDE 2

Closure properties of RE, Rec

Lemma : RE languages are closed under union. Lemma : RE languages are closed under intersection.

[Section 10.1]

slide-3
SLIDE 3

Closure properties of RE, Rec

Lemma : Recursive languages are closed under union. Lemma : Recursive languages are closed under intersection.

[Section 10.1]

slide-4
SLIDE 4

Closure properties of RE, Rec

Lemma : Recursive languages are closed under complement. Lemma : RE languages are not closed under complement.

[Section 10.1]

slide-5
SLIDE 5

Closure properties of RE, Rec

Thm : L and L’ are RE iff L is recursive.

[Section 10.1]

slide-6
SLIDE 6

The Chomsky Hierarchy

Noam Chomsky studied grammars as potential models for natural languages. He classified grammars according to these four types:

  • Type 0 Grammars: Unrestricted Grammars

(generate RE languages)

  • Type 1 Grammars: Context-sensitive (monotone) Grammars

(generate context-sensitive languages)

  • Type 2 Grammars: Context-free Grammars

(generate context-free languages)

  • Type 3 Grammars: Regular Grammars

(generate regular languages)

[Section 10.4]

slide-7
SLIDE 7

Unrestricted Grammars (Type 0)

Def: An unrestricted grammar is a 4-tuple G=(V,Σ,S,P) where

  • V is a finite set of variables
  • Σ is a finite set of terminal symbols
  • S ∈ Σ is the start symbol
  • P is a finite set of productions of the form α → β where

α ∈ (V ∪ Σ)+ and β ∈ (V ∪ Σ)* (V and Σ are assumed to be disjoint)

[Section 10.3]

slide-8
SLIDE 8

Unrestricted Grammars (Type 0)

Example: Give an unrestricted grammar for { akbkck | k ≥ 0 }

[Section 10.3]

slide-9
SLIDE 9

Unrestricted Grammars (Type 0)

Example: Give an unrestricted grammar for { aj | j = 2k, k ≥ 0 }

[Section 10.3]

slide-10
SLIDE 10

Context-sensitive Gram. (Type 1)

Def: A type 0 grammar G=(V,Σ,S,P) is context-sensitive if for every production rule α → β in P, |α|≤|β|. Which of our examples of type 0 grammars are context- sensitive ?

[Section 10.3]

slide-11
SLIDE 11

Context-sensitive Gram. (Type 1)

Def: A type 0 grammar G=(V,Σ,S,P) is context-sensitive if for every production rule α → β in P, |α|≤|β|. Lemma: Every context-free language which does not contain Λ is context-sensitive.

[Section 10.3]

slide-12
SLIDE 12

Context-sensitive Gram. (Type 1)

Def: A type 0 grammar G=(V,Σ,S,P) is context-sensitive if for every production rule α → β in P, |α|≤|β|. Lemma: Every context-free language which does not contain Λ is context-sensitive. Def: A linear-bounded automaton A is a TM which never rewrites a blank to a non-blank symbol. Lemma: A language L is context-sensitive iff there exists a linear-bounded automaton accepting L.

[Section 10.3]

slide-13
SLIDE 13

Regular Grammars (Type 3)

Def: A type 0 grammar G=(V,Σ,S,P) is regular if every production rule in P is of the form A → σB or A → σ, where A,B ∈ V and σ ∈ Σ. Lemma: A language L is regular iff there exists a regular grammar for L-{Λ}.

[Section 6.3]