Sei sulla pagina 1di 69

1

P R O J

E C T R E P O R T
C O N V E R S

I O N O F N O N D E T E R M I N I S T I C F I N I

T E A U T O M A T A T O

D E T E R M I N I S

T I C F I N I T E A U T O M A T A

S u b m i

t t e d t o M r s . A r p i t a N a g

S u b m i

t t e d b y D e b a b r a t o R o y

S o u r a

v B a s a k

S a n j u c t a s a r k a r

S a u r a v M a z u m d e r

G r o u p

1 1 -

Certificate of Approval
This is to certify that the project entitled NFA TO DFA CONVERSION has been carried out by MCA 5th semester students. It is understood that by this approval the undersigned do not necessarily endorse any of the statements made or opinion expressed therein but approves it only for the purpose for which it is submitted.
Name Roll No. Reg. No.

D e b a b r a t a R o y

0 9 1 0 2 0 1 0 0 0 8 0 9 1 0 2 0 5 1 0 0

1 3 S o u r a v B a s a k

0 9 1 0 2 0 1 0 0 3 1 0 9 1 0 2 0 5 1 0

0 3 6 S a n j u c t a S a r k a r

0 9 1 0 2 0 1 0 0 2 4 0 9 1 0 2

0 5 1 0 0 2 9 S a u r a v M a z u m d e r

0 9 1 0 2 0 1 0 0 2 7 0

9 1 0 2 0 5 1 0 0 3 2

Head of the Department M r . I n d r a j i t B h a t t a c h a

Project Guide

r y a

M r s . A r p i t a N a g

1 8

I N D

E X

2 0

A C K N O W L E D G E M E N T
Sincere gratitude & thanks are expressed towards our project guide, Prof. Arpita Nag without whose guidance, this piece of synopsis of the project would not have been completed. We would confer our gratefulness to her for her constant encouragement & profound interest in our project, & the entire Computer Engineering Department of the institute for allowing us to proceed with the project. We would extend our

thanks to the institute as a whole, for helping us make this synopsis a success. Finally, we would like to thank Mr.Indrajit Bhattacharya(HOD) for allowing us to select the project for our fifth semester. With profound regards Debabrata Roy Sourav Basak Sanjucta Sarkar Saurav Mazumder

- 22

Introduction

The types of finite automata we will deal with are:

DFA (deterministic finite automata) NFA (nondeterministic finite automata)

The conversion is implemented in Java. The source code for the applet is listed at the end of this document. A bibliography is also included.

All mathematical symbols and regular expressions are written in monospace.

REQUIREMENT SPECIFICATION

Microsoft WORD will be required to write all the documentation involved in the development of the system. a. FEDORA O.S. as Operating & Maintenance Environment. b. Intel Pentium 4 Processor. c. 512 MB RAM (min). d. HDD with minimum 5 GB space available.

SCHEDULING
Scheduling the project task is an important project planning activity. It involves deciding which task would be taken up when.

Milestone Timeline name (in weeks) Identification of 1st week the need Feasibility Study Requirement Analysis Design Coding Testing Implementation Evaluation 2nd week 3rd week 8th week 13th week 14th week 17th week 18th week

PERT CHART
PERT (project Evaluation and Review Technique) is an event oriented network because in the analysis of network emphasis is given on the important stages on completion of tack rather than the activities requires to be performed to reach a particular event.
Feasibility Study
1 week 1 week

Identification of the need

Requirement analysis
1 week

Design
5 weeks

Coding
5 weeks

Testing
1 week 1 week

Finish

Evaluation

Implementation
3 weeks

GANTT CHART
Gantt chart is a project planning tool that can be used to represent the timing of tasks required to complete a project.
Task Code Identification of need Feasibility Study Requirement Analysis Design Coding Testing Implementation Duration 1 week 1 week 1 week 5 weeks 5 weeks 1 week 3 week Dependencies Identification of need Feasibility Study Requirement Analysis Design Coding Testing

Evaluation

1 week

Implementation

Weeks 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18

Identification of need

Feasibility Study

AnalysisRequirement

Design

Coding

Testing

Implementation

Evaluation Fig: Gantt Chart

-6

D e f i n i t i o n s

Regular Expression In formal language theory regular expressions consist of strings of symbols from a finite alphabet combinedbyvariousoperators. Incomputingingeneral theycanbeusedtomatchandreplacestrings,butformallythey define regular languages. Regular languages can be roughly defined, somewhat recursively, as any language consisting of a potentiallyinfinitesetofsequencesoffinitesymbolsfromafinite alphabet that can be described by a regular expression or deterministicornondeterministicfiniteautomaton.

Nondeterministic Finite Automaton Like DFA, an NFA (Nondeterministic Finite Automaton) is defined by a quintuple, albeit a slightly different one to DFA. The difference is in the transition function. Whereas DFA have transition functions with exactly one transition for every combination of state and symbol, the NFA transition table can have any number of transitions for each. It can also have a transition from one state to anther for the empty string that is, it can move from one state to another without consuming any input at all. Q={Q,,,q0,F) Q a set of internal states. the alphabet =Q({})Q thetransitionfunction. is theCartesianproduct.

q0Q fQ

istheinitialstate isthesetofacceptingstates

The fact that there can be a number of possible alternative behaviours at any given state may seem counterintuitive at first, given the deterministic nature of computers. It can be very useful however for representing certain regular expressions, such as: (aaaaa)*|(aaaaaaa)*|(aaaaaaaaaaa)* For reasons that should become clear later, this regular expression can be expressed as an NFA with only 21 states but would require 384 states to represent as a DFA.

Deterministic Finite Automaton A Deterministic Finite Automaton, or DFA, is defined (somewhat tersely) by the quintuple: Q={Q,,,q0,F) where

Q isa set of internal states. isthe alphabet for this DFA =QQ thetransitionfunction,atotalfunction.is theCartesianproduct. q0Q istheinitialstate FQ isthesetofacceptingstates What does this mean? Like all automata a DFA read input and performs actions based on this input, their internal state and their sets of rules, also known as the transition function. More specifically it could be imagined to be a Turing Machine that only moves in one direction and can only read but not write. Initially it is in the start state q0 andreadstheleftmostsymboloftheinput tape. It then acts upon the input symbol according to the rules definedforthestartstate.Itthenmovesonecelltotherightonthe tape(ifanyfurthercellsarepresent)andactsaccordingtotherules definedforwhicheverstateitisinafterthefirststep.Itproceedsin thisfashionuntilallthecellsonthetapeareread.Ifatthispoint theautomatonisinastatethatisamemberofthesetofaccepting statestheinputstringitaccepted.Ifnot,theinputstringisrejected. ThetransitionfunctionisthesetorrulesthatdefinehowtheDFA shouldbehaveforanygivenstateandanygivensymbolfromthe alphabet.Thisisworthemphasisingbynotingthatthetransition function foraDFAisatotalfunctiontheremustbeanaction definedforeverycombinationofstateandsymbol.Thetransition functionforanyfiniteautomaton,deterministicorotherwise,can bedisplayedasatablethus:
a 0 1 2 1 1 b 2 c start true false false final false false true

:Statetransitiontableforregularexpressionab*c

Conversion of NFA to DFA

Researchingthisprojecthasshown thattheconversionofNFAtoDFA andbackagainareprocessesthat arewellunderstoodandare implementablewithoutanygreat difficulty.Themosttimeconsuming partoftheprojectwascoding.We checkedwhethertheproblemis feasiblefordevelopment.Thenwe gatheredofthenecessary requirementsandanalyzedthem andmadeathroughdesignofthe synopsis.

Various wikipedia.org articles

SEVERAL AUTOMATA BOOKS

Potrebbero piacerti anche