Presentation is loading. Please wait.

Presentation is loading. Please wait.

1.2 Three Basic Concepts 1.2.1 Languages start variables 1.2.2 Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist.

Similar presentations


Presentation on theme: "1.2 Three Basic Concepts 1.2.1 Languages start variables 1.2.2 Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist."— Presentation transcript:

1

2 1.2 Three Basic Concepts 1.2.1 Languages

3

4 start variables 1.2.2 Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist of a noun phrase followed by a predicate”. We can write this grammar as follows: Furthermore, we have From this grammar, we can produce the sentence like “a boy runs”. variables productions We assume V and T are nonempty and disjoint terminal symbols

5 Production rules are the heart of a grammar. We let them be of the form * *

6 * *

7

8 Chapter 2 Finite Automata Control unit … Input file... Storage Output Automata Deterministic automata: each move is uniquely determined. Nondeterministic automata: the moves are not uniquely determined. An automata is called an accepter if its output response is limited to “yes” or “no”. An automata is called a transducer if it is capable of producing strings of symbols as output. Current configuration ( current state,input and storage ) Next configuration ( Next state,input and storage ) MOVE ( using Transition function)

9 2.1 Deterministic Finite Accepters Deterministic accepters and transition graphs Definition 2.1 A deterministic finite accepter or dfa is defined by the quintuple Control unit (transition function δ) … Input file Initial state Control unit (transition function δ) … Input file State

10 Control unit (transition function δ) … Input file Initial state Control unit (transition function δ) … Input file State Control unit (transition function δ) … Input file State

11 Transition graphs Example 2.1 The above transition graph represents the dfa It accepts 01, 101,0111,11001,…. But not 00, 100,1100,…. Initial vertex Final vertex Transition function: 0 0 1 1 1 0

12 Definition 2.1 A deterministic finite accepter or dfa is

13 Example 2.2 Consider the dfa in the following transition graph. Solution: Trap state Example 2.3 Find a dfa that recognizes the set of all strings on a b a,b a b b Trap state Solution:

14 Example 2.4 Find a dfa that recognizes the set of all strings on {0,1}, except those containing the substring 001. 0 1 1 0 0 1 0,1 000 001 0 1 1 0 0 1 0,1 or

15 Definition 2.3 A language L is called regular if and only if there exists some deterministic finite accepter M such that L = L(M). Example 2.5 Show that language L={awa: w is regular. a a a 0 q b b a,b b Example 2.6 Let L be the language in Example 2.5. Show that is regular. 0 q a a a b b a,b b a a a b b


Download ppt "1.2 Three Basic Concepts 1.2.1 Languages start variables 1.2.2 Grammars Let us see a grammar for English. Typically, we are told “a sentence can Consist."

Similar presentations


Ads by Google