Presentation is loading. Please wait.

Presentation is loading. Please wait.

Regular Grammar.

Similar presentations


Presentation on theme: "Regular Grammar."— Presentation transcript:

1 Regular Grammar

2 Formal Languages

3 DEFINITION OF A GRAMMAR

4 Example

5 Ex1: Ex2:

6

7 Example

8

9 Example

10

11

12

13

14 CHOMSKY CLASSIFICATION OF LANGUAGES
In the definition of a grammar are the sets of symbols and So if we want to classify grammars. We have to do it only by considering the form of productions. Chomsky classified the grammars into four types in terms of productions (types 0-3). A type 0 grammar is any phrase structure grammar without any restrictions. (All the grammars we have considered are type 0 grammars.)

15

16

17

18 LANGUAGES AND THEIR RELATION
In this section we discuss the relation between the classes of languages that we have defined under the Chomsky classification.

19

20

21

22 Some Definitions:- Any set represented by regular expression is called Regular Set. The class of Regular sets over ∑ is Regular Language over the terminal set ∑. Grammar for Regular Expression is Regular Grammar.

23 Converting Regular Expression to Regular Grammar:-
Then we construct Grammar as :- Example 1 :-

24

25

26 Converting Regular Grammar to Regular Expression and Transition System:-
Then we construct a transition system :-

27 Example :-

28 Example:

29 Linear grammars The Linear Grammars are either left or right:
Right Linear Grammars: Rules of the forms A → ε A → a A → aB A,B: variables and a: terminal Left Linear Grammars: Rules of the forms A → ε A → a A → Ba A,B: variables and a: terminal


Download ppt "Regular Grammar."

Similar presentations


Ads by Google