different people for three different reasons. It is almost certain that the code
for this critical aspect of the chemical
plant would be problematic in the best
case and catastrophic in the worst. The
specification documents the Lavi avionics group had produced at IAI were
no better. If anything, they were longer
and more complex. Some subcontractors even refused to work from them,
claiming they were incomprehensible,
inconsistent, and incomplete.
This confusion prompted the question: How should an engineering team
specify the behavior of such a complex
reactive system in an intuitively clear yet
mathematically rigorous fashion? This
was what I aimed to try to answer.
statecharts emerging
My initial goal was not to invent a language but to try to recommend, from
the toolset of the software and systems
engineer, appropriate means for saying
what the avionics engineers seemed to
already have in mind. It turned out they
really did understand the system and
could answer many questions about behavior but often hadn’t thought through
things properly because the information wasn’t well-organized in their documents (or heads). I had to spend a lot of
the time getting them to talk; I kept asking questions, prodding them to state
clearly how the aircraft behaves under
certain sets of circumstances. We would
then brainstorm, trying to make sense
of the information that had piled up.
It was clear from the start that the
basic idea of states/modes was fundamental to their way of thinking. (This
insight was consistent with the work of
David Parnas on the avionics of the A- 7
jet fighter. ) The IAI avionics engineers
19
would repeatedly say things like, “When
the aircraft is in air-ground mode and
you press this button, it goes into air-air
mode, but only if the radar is not locked
on a ground target.” This is familiar to
anyone in computer science; what we
have here is really the likes of a finite-state automaton with its state transition mechanism. Nevertheless, having
one big state machine describing what
is going on would be fruitless, not only
because of the exponentially growing
number of states but also because simply listing all possible states and the
transitions leading from one to the other
is unstructured and nonintuitive; it pro-
how should
an engineering
team specify
the behavior
of such a complex
reactive system
in an intuitively
clear yet
mathematically
rigorous fashion?
this was what
i aimed to try
to answer.
vides no means for modularity, hiding
of information, clustering, and separation of concerns and would not work for
highly complex behavior. I was quickly
convinced of the need for a structured
and hierarchical extension of the conventional state machine formalism.
Following my initial attempt to use
temporal-logic-like notation, I resorted
to writing down the state-based behavior textually, in a kind of structured
state-based dialect of “state protocols”
made up on the fly (see the figures in 6).
The dialect was hierarchical; within a
state there could be other states, and if
you were in this state and the event occurred, you would enter the other state,
and so on. As this went on, things would
get increasingly complicated. The avionics engineers would bring up more
of the system’s behavior, and I would
respond by extending the state-based
structured description, often having to
enrich the syntax in real time.
When the multitude of emerging behavioral details caused things to be even
more complicated, I would doodle on
the side of the page to explain (visually)
what was meant. I recall the first time I
used visual encapsulation to illustrate
for the engineers the state hierarchy and
an arrow emanating from the higher
level to show a compound “
leave-any-state” transition. I also recall the first
time I used side-by-side adjacency with a
dashed separator line to depict orthogonal (concurrent) state components (see
Figure 1).
I drew these informal diagrams in
order to explain what the nongraphical
text-based state protocols meant. The
text was still the real thing, however, and
the diagrams were merely an aid. But
after a while it dawned on me that everyone around the table seemed to understand these back-of-the-napkin diagrams much better, relating to them far
more naturally. The pictures simply did
a much better job of setting down on paper the system’s behavior, as understood
by the avionics engineers, and we found
ourselves discussing the diagrams and
arguing about the avionics over them,
not over the state protocols. Still, the
mathematician in me found this difficult to accept; I told myself that doodled
diagrams could not really be better than
a real mathematical-looking artifact. So
it really took a leap of my own faith to be
able to think: “Hmmm…couldn’t the