comp.lang.ada
 help / color / mirror / Atom feed
From: news.byu.edu!hamblin.math.byu.edu!sol.ctr.columbia.edu!The-Star.honeywell .com!saifr00.cfsat.honeywell.com!schall@gatech.edu  (Loren Schall)
Subject: Is a generic finite state machine engine reasonable?
Date: 22 Oct 92 02:26:25 GMT	[thread overview]
Message-ID: <1992Oct22.022625.13802@saifr00.cfsat.honeywell.com> (raw)

I originally asked this question in comp.programming, but I think I'm
really looking for a more specific solution.

>Hello Netters, a colleague of mine brought me an interesting question
>and I knew that you would have some useful input.
>
>We're involved with a large realtime application that includes several
>pieces which could reasonably be implemented as finite state machines.
>Is it possible and reasonable to implement a "generic" finite state
>engine?  Please reply via e-mail and I'll summarize and re-post.  If
>you think this is an inapropriate place for this discussion, tell me
>where the right place is.
>
>I'm envisioning a (static) initialization step where the specific
>machine is defined (inputs, transitions, and outputs) and an
>invocation process taking an input and producing an output (the
>actual state transition being internal and invisible).
>
>The main objective we're looking for is ease of maintenance.  We
>believe that it would be easier to maintain several state machine
>descriptions and one implementation, than several different state
>machine implementations.
>
>Does anyone know of any appropiate references or examples (Ada, C,
>or C++ would be must useful).
>
>Thanks, in advance, for any help you can offer.

I'm not very familiar will OOP.  Isn't there some way to implement this
in Ada (instanciate and call)?  This would become part of an existing
project that is moving from Pascal to Ada.

comp.programming replies:

#Look into LEX. 
#I am sure you will be able to write a good utility using LEX to serve
#all your needs involving finite state machines.

I hadn't really thought about lex/flex.  I was hoping to avoid a two step
process.  Most of the programmers that would be using this are unfamiliar
with Unix (and its ideas).

*You may infer a general code-mapping algorithm that compiles DFA's
*directly into code, instead of into an abstract DFA implemented on top
*of the code layer, from the pesudo-code example below.
  [example deleted]

=In this years conference on Compiler Construction a paper by L.O.
=Larsen describes how one can generate an efficient specific finite
=state machine from a generic one by partially evaluating the generic
=machine with respect to a definition. The paper is in Springer-Verlag
=LNCS 641.

(I haven't checked out this paper, yet.)  I was kind'a thinking of
using "an abstract DFA implemented on top of the code".  Is this the
wrong approach?  Let me expand on my original idea.  What I'm really
looking for is an easy way to implement The Specification.  Several
place in our System Specification, state tables or state diagrams are
used to describe the expected response(s).  It would be most
convenient if these could be (almost) directly translated to code.

Am I making any sense?  Is this kind of thing possible or do I have to
look at making a translator (state machine description -> Ada)?  It is
a requirement that we use Ada, so nothing but Ada code can be concidered
the *offical* source.

I eagerly await any suggesting you might have to offer.

Loren
schall@swtech.cfsat.honeywell.com (Loren Schall)

             reply	other threads:[~1992-10-22  2:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-22  2:26 Loren Schall [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-10-22 20:53 Is a generic finite state machine engine reasonable? John Goodsen
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox