Presentation is loading. Please wait.

Presentation is loading. Please wait.

Theory of Languages and Automata

Similar presentations


Presentation on theme: "Theory of Languages and Automata"— Presentation transcript:

1 Theory of Languages and Automata
By: Mojtaba Khezrian

2 Review Alphabetic ……. {0,1} String ….. x=‘101010’
Length of String ….. |x| Language Union Intersection Concat

3 Review

4 G =(V,T,P,S) V= nonFinal symbol T= Alphabetic P= Rules
Grammar G =(V,T,P,S) V= nonFinal symbol T= Alphabetic P= Rules S= Starting symbol

5 Language of Grammar

6 Language of Grammar

7 Language of Grammar

8 Language of Grammar

9 How to Write Grammar? First split the language to small parts then write the grammar of them. Finally join all of them.

10 1: Split like: A A A …. A A is the symbol of even length
How to Write Grammar? 1: Split like: A A A …. A A is the symbol of even length

11 How to Write Grammar? 2: Split like: X A A is the symbol of even length X is the symbol of aa or ab or bb or ba

12 How to Write Grammar? 3: Split like: A B A,B is the symbol of even length

13 How to Write Grammar? 4: Split like: A X A is the symbol of even length X is the symbol of aa or ab or bb or ba

14 How to Write Grammar? Split like: X A A is the symbol of even length X is the symbol of a or b

15 How to Write Grammar? 1: Split like: b…a and a…b

16 How to Write Grammar? 2: Split like: b…a… and a…b…

17 How to Write Grammar? 3: Split like: AB

18 How to Write Grammar? 3: Split it to two languages: L1 and L2 L1: n,m are even L2: n,m are odd

19 How to Write Grammar?

20 Type of Grammar Type-3 Grammar (Regular Grammar)
Type-2 Grammar (Context free Grammar) Type-1 Grammar (Context Sensitive Grammar) Type-0 Grammar

21 Type-3 Grammar (Regular Grammar)
If it would be right-linear: Or left-linear:

22 Type-3 Grammar (Regular Grammar)

23 Type-2 Grammar (Context Free Grammar)

24 Type-1 Grammar (Context Sensetive Grammar)

25 Type-1 Grammar (Context Sensitive Grammar)

26 Type-0 Grammar

27 Type-0 Grammar

28 Type of Language Type-3 Language (Regular Language)
Type-2 Language (Context Free Language) Type-1 Language (Context Sensitive Language) Type-0 Language

29 Type of Language Type-3 If there is a type-3 grammar for it
Type-2 If there is a type-2 grammar and no type-3 grammar for it Type-1 If there is a type-1 grammar and no type-3 and type-2 grammar for it Type-0 If there is a type-0 grammar and no type-3 and type-2 and type-1 grammar for it

30 Type of Language

31 Type of Automata Automata for type-3 language (Finite Automata)
Automata for type-2 language (Push-down Automata) Automata for type-1 language (Linear Bounded Automata) Automata for type-0 language (Turing Machine)

32 Type of Automata

33 Finite Machine

34 Finite Machine Accept: If at the end of string, machine is stated in one of final states. Reject: If at the end of string, machine is stated in one of non-final states or before end of string it’ll be stoped.

35 Finite Machine

36 Finite Machine

37 Example

38 Language of a Finite machine
If A is the set of all strings that machine M accepts, we say that A is the language of machine M and write: L(M) = A. M recognizes A M accepts A.

39 Finite Machine

40 Finite Machine

41 Finite Machine

42 Example


Download ppt "Theory of Languages and Automata"

Similar presentations


Ads by Google