Welcome to Scribd, the world's digital library. Read, publish, and share books and documents. See more
Download
Standard view
Full view
of .
Save to My Library
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
fComputation

fComputation

Ratings:

4.0

(1)
|Views: 873|Likes:
Published by anon-988778

More info:

Published by: anon-988778 on Oct 31, 2008
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

07/03/2009

pdf

text

original

 
Fundamental Concepts
Languages
o
A language is a subset of the set of all possible strings formed from a given set of symbols.
o
There must be a membership criterion for determining whether a particular stringin in the set.
Grammars
o
A grammar is a formal system for accepting or rejecting strings.
o
A grammar may be used as the membership criterion for a language.
Automata
o
An automaton is a simplified, formalized model of a computer.
o
An automaton may be used to compute the membership function for a language.
o
Automata can also compute other kinds of things.
Deterministic Finite Automata
DFAs are:
Deterministic--there is no element of choice
Finite--only a finite number of states and arcs
Acceptors--produce only a yes/no answer A DFA is drawn as a graph, with each
 state
represented by a circle.One designated state is the
 start state
.Some states (possibly including the start state) can be designated as
 final states
.Arcs between states represent
 state transitions
-- each such arc is labeled with the symbol thattriggers the transition.
 
Example DFA
Example input string:
1 0 0 1 1 1 0 0
 
Operation
Start with the "current state" set to the start state and a "read head" at thebeginning of the input string;
while there are still characters in the string:
o
Read the next character and advance the read head;
o
From the current state, follow the arc that is labeled with the character just read; the state that the arc points to becomes the next currentstate;
When all characters have been read,
accept 
the string if the current state is afinal state, otherwise
reject 
the string.Sample trace: q0
1
q1
0
q3
0
q1
1
q0
1
q1
1
q0
0
q2
0
q0Since q0 is a final state, the string is accepted.
Formal Definition of a DFA
A
deterministic finite acceptor 
or 
dfa
is a quintuple:M = (Q, , , q0, F)where
Q is a finite set of 
 states,
 
is a finite set of symbols, the
input alphabet,
 
: Q Q is a
transition function,
 
q0 Q is the
initial state,
 
 
F Q is a set of 
 final states.
  Note: The fact that is a function implies that every vertex has an outgoing arc for each member of .We can also define an
extended transition function
as: Q Q.If a DFA M = (Q, , , q0, F) is used as a membership criterion, then the set of strings accepted by M is a language. That is,L(M) = {w : (q0, w) F}.
Languages that can be defined by dfas are called
regular languages.
Nondeterministic Finite Automata
A finite-state automaton can be
nondeterministic
in either or both of two ways:A state may have two or more arcs emanating from it labeled with the same symbol. When thesymbol occurs in the input, either arc may be followed.A state may have one or more arcs emanating from itlabeled with (the empty string) . These arcs mayoptionally be followed without looking at the input or consuming an input symbol.Due to nondeterminism, the same string may cause an nfa to end up in one of several differentstates, some of which may be final while others are not. The string is accepted if 
any
possibleending state is a final state.

You're Reading a Free Preview

Download
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->