Application of Finite Automata
Application of Finite Automata
Application of Finite Automata
By prabhakar gouda
gouda
Finite Automata
Contents
0.1 APPLICATION OF FINITE AUTOMATA . . . . . . . . . . . 3
0.1.1 A DFA-based Text Filter in Java . . . . . . . . . . . . 3
The first thing to deal with is the input alphabet. The DFA above uses the
alphabet 0, 1, which is the alphabet of interest for this problem. But the
program will work with a typed input string, so we do not have the luxury
of restricting the alphabet in this way. The program should accept ´011´ (a
representation for the number 3) and reject ´101´ (a representation for the
number 5), but it must also properly reject strings like ´01i´ and ´fred´. The
alphabet for the Java implementation must be the whole set of characters
that can occur in a Java stringthat is, the whole set of values making up the
Java char type. The DFA we actually implement will have four states, like
this:
An object of the Mod3 class represents such a DFA. A Mod3 object has
a current state, which is encoded using the integers 0 through 3. The class
definition begins like this:
/**
A deterministic finite-state automaton that
recognizes strings that are binary representations
/
public class Mod3
/
Constants q0 through q3 represent states, and
a private int holds the current state code.
/
Accept state
An accept state (sometimes referred to as an accepting state) is a state at
which the machine has successfully performed its procedure. It is usually
represented by a double circle.
An example of an accepting state appears on the right in this diagram of
a deterministic finite automaton (DFA) which determines if the binary input
4
contains an even number of 0s.
S1 (which is also the start state) indicates the state at which an even num-
ber of 0s has been input and is therefore defined as an accepting state. This
machine will give a correct end state if the binary number contains an even
cepted by this DFA are epsilon (the empty string), 1, 11, 11..., 00, 010, 1010,
10110 and so on.
0.1.3 Transducers
nal to the outside world (e.g., to other state machines) the situation: ´door
is open´ or ´door is closed´.
Mealy machine
The FSM uses only input actions, i.e., output depends on input and state.
The use of a Mealy FSM leads often to a reduction of the number of states.
The example in figure 4 shows a Mealy FSM implementing the same be-
haviour as in the Moore example (the behaviour depends on the implemented
FSM execution model and will work, e.g., for virtual FSM but not for event
driven FSM). There are two input actions (I:): ´start motor to close the door
if command close arrives´ and ´start motor in the other direction to open the
door if command open arrives´. The ´opening´ and ´closing´ intermediate
states are not shown.
Figure 2: Transducer FSM: Mealy model example
A further distinction is between deterministic (DFA) and non-deterministic
(NDFA, GNFA) automata. In deterministic automata, for each state there is
exactly one transition for each possible input. In non-deterministic automata,
there can be none, one, or more than one transition from a given state for
a given possible input. This distinction is relevant in practice, but not in
theory, as there exists an algorithm which can transform any NDFA into an
equivalent but much more complex DFA.
The FSM with only one state is called a combinatorial FSM and uses only
input actions. This concept is useful in cases where a number of FSM are
required to work together, and where it is convenient to consider a purely
6
combinatorial part as a form of FSM to suit the design tools.
for describing state machines. UML state machines overcome the limitations
of traditional finite state machines while retaining their main benefits. UML
state machines introduce the new concepts of hierarchically nested states
and orthogonal regions, while extending the notion of actions. UML state
machines have the characteristics of both Mealy machines and Moore ma-
chines. They support actions that depend on both the state of the system
and the triggering event, as in Mealy machines, as well as entry and exit ac-
tions, which are associated with states rather than transitions, as in Moore
machines.
Figure 3: UML state machine example (a toaster oven)
called Medvedev FSM. A counter is the simplest form of this kind of FSM.
terfaces will be able to seamlessly roam around, hoping from a network to an-
other (and using different technologies) without losing their IP connection. A
combination of technologies which includes Local Area Networks (WLANs),
Wireless Personal Area Networks (PANs), Cellular Networks (GSM, GPRS,
UTMS) and Community Area Networks (WiMax, 802.11) will provide the
infrastructure needed for this environment. One challenge faced for the de-
signers of this scenario is to minimize the perception of the change in quality
when a handover (the process of changing the point of network attachment)
occurs. Handovers can happen between 2 domains using the same tech-
nology (horizontal handover) or from different technologies (vertical han-
dover). Moreover, the vertical handover is further split in downward (when
the handover allows for a decrease of bandwidth) and upward (when the new
bandwidth is larger). Such a rich environment could bring up a new world
of business possibilities and the proposal described here tries to create the
proper conditions to exploit those innovations. The Service Oriented Han-
dover SOHand platform adds to the handover process the awareness of the
ecosystem in which the event is embedded [14 ]. Uses of the Platform
1. From the network management perspective (the access provider):
It may be interested on grabbing usual information which would be inter-
esting to improve long
l ong term relationship
relationship with
wi th the user;
It may collect information about the handovers of a user and relate them
with positioning information;
It may correlate information about routes and timing of accesses.
2. From the content provider perspective:
It may adapt the delivery of media to specifics of devices, location, timing,
type of user, etc
It can understand the criteria by which the user chooses the access providers;
It can explore the contextual information to add value to the content (ad-
vertisement, linking to 3rd party products, etc);
As the user has the control over the mobility aspects, the access provider
can focus on providing better and more varied services[4];
It can provide brokerage services based on the common information available.
3. From the user perspective:
It can choose the provider
pr ovider based upon several
several criteria:
Best price
Better response
Best matching to his/her requirements
Economy (use a home user-owned WLAN, during a traffic jam)
It can use contextual information to adapt the user device profile of usage:
Power management (CPU, memory, display, network interface)
Lab.
The structure of the Ontology
A service is a facility
facili ty (a video streamer, a voice channel
channel or a game appli-
cation) which a content provider offers, during a session, to a user through
an access provider. One entity can offer both access and content at the same
time. In the course of enjoying a service, the user seamlessly roams through
a net of access providers. Context and Handover information, gathered by
positioning sensors and other sources from the user device or by any other
related service, can be used both by the session to frame Security, Privacy,
QoS and other policies. Positioning information can also be used for the def-
inition route patterns used for one user, which could lead to better pricing
strategies for the user. Some sort ofClasses and relationship
SLA is signed between all the entities involved in order to offer to the user
some parameters by which they can measure his/her Quality of Experience
while using the system Figure 4.
This ontology will allow for:
The creation of a common vocabulary of terms which would easy the de-
sign and reuse in new services in the communications industry, with faster
deployment and exploration in the added value chain;
Definition of complex relationships between the terms which would make
possible to correlate the business processes, exploring new possibilities de-
rived from the positioning and context awareness technologies as well as from
security/privacy
security/privacy policies;
A structured integration of the Access Networks, Subscriber Profiles, Ap-
plications and Data both by a provider, or by a group of providers;
Other ontologies in the IT management domain can be imported, increas-
ing the management boundaries.
Each provider will have its own policies about IT Management. Some of
these policies can be shared between providers to deliver ubiquitous services,
to test SOHand.
The environment has been installed composed by APs from CISCO, 4
PDAs from HP (5550), 2 notebooks, 3 GPSs, 2 Switches 3COM and 4 Desk-
tops. Linux have been used on the notebooks and windows on the PDAs