3. It is a self- operating machineand a moving
mechanical device made in imitation of
living things.
An automata is an abstract
model of a digital computer .
A machinewhich performsa range of
functions according to a predetermined set
of coded instructions.
real world examples:computer,ATM and
hugo(robot)
4. Automata theory is the study of abstract machines and automata,
as well as the computational problems that can be solved using
them.
A SIMPLE COMPUTER :
INPUT : switch
OUTPUT : light bulb
ACTIONS : flip
switch STATES
: on,off
5. H O W A N A U T O M A T A C A N B E D E S I G N E D :
Transition diagram
Transition table
Transition functions
Bulb is "ON"if and if there was an
Odd number of flips
6. There are four types of automata :
Finite state machine (simple)
Push-down automata
(moderate) Turing
machine(complex)
Linear bound machine (
restricted form of turing machine)
7.
8. The main idea of suggested approach is to construct computer programs
the same waythe automation of technological processes
Automata-based programming is a programming paradigm in which the
program or part of it is thought of a Machine or any formal automation . Each
automaton can take one "step"at a time, and the execution of the program is
broken downinto individual steps. The steps communicate with each other by
changing the value of a variable, representing the "state."The control flow of the
program is determined by the variable value.
Examples :telecommunication systems,
10. Finite State Machine is a mathematical model of
computation that models a sequential logic. FSM
consists of a finite number of states, transition
functions, input alphabets, a start state and end
state(s).
11. Finite State Machine for a Traffic Signal is
designed and rendered .Green is the start/initial
state, which upon receiving a trigger moves to
Yellow, which in turn, upon receiving a trigger,
transitions to Red. The Red then circles back to
Green and the loop
continues.An FSM must be in exactly one of the
finite states at any given point in time and then in
response to an input, it receives, the machine
transitions to another state. The transition rules
are defined for
12. While building FMS's , wemodel and
implement State and Transition
Functions.States could be modeled as Python
Coroutines that run an
infinite loop within which they accept the input,
decides the transition and updates the current
state of the FSM. The transition function could
be as simple as a bunch of if and elif statements
and in a more complex systemit could be a
decision function.
To dive into low-level details, webuild an FSM
for the regular expression ab*c, which means
if the given string matches the regexthen the
machine should end at the end state, only
13. We model the state "q2"as
def _create_q2():
while True:
# Wait till the input is received.
# once received store the input in `char`
char =yield
# depending on what wereceived as the
input
# change the current state of the fsm
if char =='b':
# on receiving `b`thestate moves to `q2`
current_state=q2
else:
elif char =='c':
# on receiving c̀`thestatemoves to q̀3`
current_state =q3
# on receiving any other input, break
the loop
# so that next time when someone sends
any input to
# the coroutine it raises StopIteration
break
14. The FSM class for the regular expression
ab*c
class FSM:
def init (self):
# initializing states
self.start = self._create_start()
self.q1= self._create_q1()
self.q2 = self._create_q2()
self.q3 = self._create_q3()
# setting current state of the system
self.current_state = self.start
# stopped flag to denote that iteration is stopped due to bad
# input against which transition was not defined.
self.stopped = False
def send(self, char):
"""The function sends the curretn input to thecurrent state
It captures the StopIteration exception and marks the stopped flag.
"""
try:
self.current_state.send(char)
except StopIteration:
def does_match(self):
"""The function at any point in time returns if till the current
input the string matches the given regular expression.
It does so by comparing the current state with the end state `q3.`
It also checks for s`topped`flag which sees that due to bad input the iteration of FSM had to
be stopped.
"""
if self.stopped:
return False
return self.current_state==self.q3
...
21. In DFA, for each input symbol, one can determine the
state to which the machine will move. Hence, it is called
Deterministic Automaton. As it has a finite number of
states, the machine is called Deterministic Finite Machine
or Deterministic Finite Automaton.
22. LANGUAGE OF DFA
The language of a DFA is the set of all strings ,starting from q0 and following
the transitions as the string is read left to right, will reach some accepting
state.
23. language = { all strings containing 11
}
M accepts 11
M accepts 110
M accepts 0110
so on.....
25. 1 0 1
0 0 1
Initial state
Initial state Not Final state
Final state
A B
B
A
B
C
C
C
0
0
0
1
1
1
26. A DFA can berepresented by a 5-tuple (Q,∑,δ,q0,F) where −
Q is a finiteset of states.
∑is a finiteset of symbols called thealphabet.
δ is thetransition function where δ:Q ×∑→ Q
q0 is the initial state from where any input is processed(q0 ∈
Q). F is a set of final state/states of Q (F ⊆ Q).