PFA Scotts & Pug Jouranl Article
PFA Scotts & Pug Jouranl Article
Abstract
The class of parallel nite automata (PFA) is described that naturally expresses the interleaving
parallelism inherent in Petri net notation without admitting the possibility of an in nite state space.
The equivalence of this class to deterministic nite automata (DFA) is demonstrated using an algorithm
for generating an equivalent nondeterministic nite automaton (NFA) from a PFA. A composition rule
is given for constructing a PFA from a regular expression with the interleaving operator. Finally, the
languages generated by this class are related to known classes of Petri net languages. Though the class
PFA is equivalent in recognition power to the class DFA, the fact that DFAs are a structural subset of
PFAs makes the PFA representation preferable for many applications requiring nite automata models.
As an example, we discuss the usefulness of PFA notation as a structural model for hypertext, and
non-linear interactive information networks in general.
1
directly from regular expressions with an interleaving operator. In section 3 we discuss several interesting
modeling properties exhibited by PFAs and discuss their relationship to subclasses of Petri nets. In sec-
tion 4 we conclude by discussing the use of PFAs in the software system architecture of a novel interactive
information system called Trellis.
1.1 Formal descriptions
We begin with a formal de nition of the members of class PFA, and follow that with a description of their
representation and behavior. The notation and style is that commonly used in nite automata theory 7]. The
formal development is straightforward, but presented in detail for completeness and clarity of understanding
the execution of the transition diagrams in the ensuing examples.
De nition 1 Parallel nite automaton
A PFA M can be formally de ned as a 7-tuple M = (N Q q0 F ) in which
N is a nite set of nodes
Q 2N is a nite set of states
is a nite input alphabet
: 2N ( fg) ! 22N is the node transition function
: Q ( fg) ! 2Q is the state transition function
q0 2 Q is the start state
F N is the set of nal nodes
and where and are partial functions subject to the restrictions outlined in the following
discussion.
In a PFA, there is no one-to-one correspondence between states and nodes in a transition diagram, as is
common in other nite automata. Thus, the node transition function is used to generalize the notion of arc
found in directed graphs. Speci cally, if ((fA B g a) fC D E g) is an element of , we say that a transition
labeled a exists with source nodes A and B, and with target nodes C, D, and E.2
A state in a PFA is a set of nodes. During execution, the nodes composing the current state are termed
active. The state transition function is then de ned as follows. Initially, the set of active nodes for M
is exactly q0, the initial state. During execution of M, on seeing the input symbol3 c in state q, the set of
active nodes constituting the next state for M is any one of the sets in (q c). More speci cally, each state
transition is de ned based on the node transitions, as follows:
De nition 2 State transition rule ( ring rule)
Given an state q 2 Q and an input symbol c 2 ( fg),
(q c) = f (q ; m) n j n 2 (m c) for m q g :
We extend the operation of to strings from using the function ^, as follows:
^(q ) = (q )
^(q a) = f (p ) j for some r 2 ^(q ) p 2 (r a) g
Furthermore, the meaning of these functions applied to a set of states is simply the union of the results of
application to the individual states in the set. In the ensuing discussion we use only the symbol and let
the context of its use distinguish between the two functions.
2 A normal directed graph expressed in this form would have singletons for both the source and target node sets.
3 We will consistently use the term symbol to denote what is often called an input token in automata theory. This is to
prevent confusion with the Petri net notion of token, which refers to an indicator of node activity.
2
The PFA M accepts a string ! if, for some state q 2 (q0 !) q F . This intuitively says a string is
accepted if, after it is fully consumed by some execution of M, every active node is a nal nodes. Corre-
spondingly, the language accepted by a PFA M is de ned to be
L(M) = f ! j (q0 !) contains a subset of F g:
An error occurs during execution if no state transition is possible from the current state with the current
input symbol.
1.2 Informal representation and execution
A PFA is best depicted as a form of directed graph with labeled transitions, as shown in gure 1. The
nodeset N in the PFA is represented by the nodes in the graph. Each node transition in is represented by
drawing a collective form of arc from its set of source nodes to its set of target nodes. We shall refer to such
arcs as tied arcs. For any transitions with multiple sources or targets, a small circle is drawn as a collection
point to emphasize the tying together of the various arcs composing the transition. The label is placed at
the collection point. Collectively, the labels on the transitions leaving any particular node do not have to be
unique.
A transition that enters more than one target node is termed a parallel transition if it leaves more than
one source node it is termed a synchronizing transition. The one or more nodes which collectively constitute
the start state q0 are denoted in the representation of a PFA with bold arrows. The nal nodes in F are
shown as double circles.
A node transition in is possible, or enabled, if all of its source nodes are active and the current input
symbol matches the label on the node transition. At each step in the execution of a PFA, an enabled
transition is nondeterministicly chosen and executed, producing a next state from the current state. Note
that nondeterministic choice possibly arises in two ways: a single node can have several outgoing transitions
bearing the same label, and two or more active nodes may each have outgoing transitions bearing the same
label. When a transition is executed, all of its source nodes are made inactive, and then all of its target
nodes are made active. This consumes the input symbol. There is no notion of a node being \doubly" active,
as might be thought if a target node of an executed transition is already an active node.
If a transition is labeled with , it indicates that the transition is enabled whenever all of its source nodes
are active, and that it does not consume any input when it executes.4
The most intuitive way to understand PFA execution is in Petri net terms. A PFA has basically the
same structure as a Petri net, with the PFA node set N representing Petri net places, the tied PFA arcs in
representing Petri net transitions, and the initial PFA state q0 specifying an initial Petri net marking of
one token per active place. PFA execution, then, proceeds as normal Petri net execution, except that the
token count in each place is normalized (i.e., any token count greater than 1 is set to 1) after each transition
ring. Thus, the net never has more than one token in any place. The token distribution is part of the state
information in a normal Petri net, and since multiple tokens can accumulate in places, a classical Petri net
is a potentially in nite state automaton. The nets represented by PFAs, however, have 1-bounded token
counts at each node in the graph, so PFAs are nite state automata. Section 2.1 below expands on this
point by showing speci cally the equivalence between PFAs and DFAs. First, we informally illustrate PFA
execution with two examples.
1.3 Example 1
To illustrate the representation and execution of a PFA, consider the diagrams in gure 1. In the PFA, nodes
4 and 6 are the nal nodes, and node 1 is the only start node. The language L accepted by this automaton
is
a b k (c+ d+ )+
4 Since our construction allows transitions, a PFA could have a single start node instead of a set of start nodes without
loss of generality. We have chosen to de ne a set of start nodes for consistency with common Petri net notation.
3
4
b
c
1 λ c
2 1
c 5
c c b
a c
3
d
5 c d 2
c 6
a b 4 a,c d b
d 3
6 d
a,d
PFA DFA
where the k operator speci es an interleaving of the languages that are its operands. The DFA shown is
equivalent to the PFA, in the sense that it accepts the same language L. It is also minimal for L. The
execution sequence obtained while accepting the word \accbd$" (where \$" is the end marker) is as follows:
In contrast, the execution sequence obtained for this PFA on the word \caba$" leads to an error, as follows:
1.4 Example 2
As further illustration, consider the PFA shown in gure 2. It recognizes the language
(a b k c ) m (ac k (cd) k b a)
4
a
1
b c
3
2 m
b
8
6 a
4
d 9
a c
7
5
c
using two start nodes (1 and 3) and three nal nodes (5, 6 and 9). An execution sequence for this PFA
accepting the word \acbmaba$" is as follows:
Note that when control is at nodes f4 6 8g and the input symbol is \a" the automaton can choose to move
to have control in nodes f4 6 9g, but for the word in this example no accepting state can then be reached.
Thus, the behavior of PFAs is somewhat similar to that of NFAs, as section 2.1 points out. By directly
incorporating interleaving, though, the notation of PFAs is more convenient for expressing cooperating
parallel activities.
Note also that the move from active nodes f2 3g to active nodes f4 6 8g on input symbol \m" is a
parallel synchronizing move. Because the transitions leaving nodes 2 and 3 are tied together, control must
be at both nodes concurrently for the move to occur.
1.5 Related work
The language theory of regular expressions with interleaving is well known. Peterson 10, pp.169-171] restates
(without proof) the result that type 0, 1, and 3 (regular) languages are closed under interleaving, and then
(more to the point for this report) demonstrates a construction to support the fact that Petri net languages
5
are closed under interleaving as well. We have adapted this construction, by adding transitions, for the
generation of PFAs from augmented regular expressions, as described in section 2.2.
It was previously noted that PFAs are best thought of as a form of Petri net with a modi ed (normalizing)
execution rule. In this light, they bear some resemblance to the class of automata recently introduced as
binary Petri Nets (BPN) 2]. The de nition and execution behavior of BPNs has been explained, but their
language theory remains undeveloped. Several distinctions between PFAs and BPNs are evident, though,
with the most obvious one being that, to emphasize the relationship with regular languages, PFAs are
formulated more with a traditional nite state machine notation rather than the Petri net notation of
BPNs. BPNs incorporate the notion of a net node either being active or not without counting the number
of activations thus they are also nite state automata, and as well they include the Petri net notions of
parallel and synchronizing transitions that we have adopted for PFAs. However, BPNs have an unusual
interpretation of an active node that is unlike other Petri net models and unlike PFAs. When a BPN node
is active, all enabled transitions that leave that node must be executed at once. In PFA terms, this behavior
would require several input symbols to be consumed simultaneously, since enabled transitions leaving a PFA
node must be selected for execution one-at-a-time.
6
a,c c b,c b,c
d
b
13 23 568 578
c
a
m a
a c
b
a a
468 469 569
c c
c d d d
a
478 479 579
b
along with a short argument that the construction terminates. The NFA can, of course, be
converted into a DFA by the well-known \subset" algorithm (see 1, pages 117-119]).
Each state of the NFA will represent a set of active PFA nodes. The NFA can be generated
by rst creating an initial state that is exactly the set containing the start nodes of the PFA,
marking the state \undone," letting this node be the \current" NFA state, and then generating
successor NFA states from it. First construct the dierent sets of PFA nodes that can be active
after a move is made from the active PFA nodes represented by the current NFA state. For each
such PFA node set, if the NFA already has a state representing it, add an arc in the NFA from
the current state to that next state. Label the arc with the input symbol that causes that move.
For each set of PFA nodes that has not already been represented in the NFA, construct a new
NFA state, mark the new state \undone," and add an arc from the current state to it. Label this
arc with the input symbol that causes the move. After all possible successors of the current NFA
state are generated, mark the current NFA state \done," pick an \undone" NFA state to be the
new \current" state, and repeat the process of generating successors.
The NFA construction algorithm terminates because there are only a nite number of subsets of
the nodes in the original PFA. Since each node generated in the NFA is either a new subset or
a duplicate of a previously generated one, eventually no new nodes will be generated from each
\undone" state and all NFA states will become \done."
2
The tied arcs in the PFA aect NFA generation by entering into the determination at each NFA state of
the possible successors for that state. This procedure is very similar to the previously mentioned NFA-to-
DFA construction algorithm it is also essentially the same procedure used to generate the coverability graph
of a Petri net 10], which, for bounded nets, can be thought of as a deterministic nite automaton. The NFA
shown in gure 3 was generated by this construction and is equivalent to the PFA in gure 2. The states of
the NFA have been named to correspond to the active PFA nodes each represents.
7
M(A)
λ λ
M(B) M ( A || B )
3 Properties of PFAs
3.1 Safety and composition
Use of the composition algorithm from the previous section results in a special subclass of PFA having a
structural property we refer to as safety. The notion of safety from Petri net theory5 can be directly adapted
to say that a PFA is safe if no node transition in , when executed, will attempt to activate an already active
node. Note that self-loops (a transition that has some node as both a source and a target) are considered
safe, since when a self-loop transition is executed, the source node can considered as becoming inactive before
it is reactivated.
Theorem 2 A PFA generated using the given composition rules from regular expressions is safe.
Proof: by induction on the PFAs generated from each composition operator.
5 A net is termed k-bounded if no place (node) can ever contain more than k tokens. A 1-bounded net is termed safe. For
details see Reisig 11].
8
For regular expressions A and B, if M(A) and M(B) are safe PFAs, then M(AB), M(AjB)
and M(A ) (and so M(A+ )) are all safe because the composition rules create no new possible
parallel activity. The PFA M(A k B) is safe because the concurrently active machines have no
interconnecting arcs in the construction. The base cases of the induction (machines to accept
single symbols) are obviously safe, because they are DFAs.
2
The safety property guarantees that the structure of a PFA is, in a sense, simple. There are no complex
interactions among states, but only transitions from distinct subsets of nodes to distinct subsets of nodes. It
is fairly easy to see that for any unsafe PFA, a safe PFA can be found that recognizes the same language. This
is a consequence of the fact that safe PFAs are derived from regular expressions, which properly generate all
regular languages.
3.2 Relation of PFAs to other Petri net models
We rst relate PFAs to the Petri nets from which their parallel and synchronizing transition structures are
borrowed. A Petri net can be viewed as a language generator/acceptor by mapping elements from a nite
alphabet to the transitions in its structure. The recognition power of Petri nets is aected by the manner in
which symbols are mapped to transitions (e.g., mapping a unique symbol to each transition, or allowing
transitions), as well as how termination and acceptance is determined. Termination and acceptance in PFAs
is a form of what are called L ; type Petri net languages, in that a particular set of nal states is identi ed.
PFA acceptance occurs whenever a reachable subset of the nal nodes is obtained. A full description of the
Petri net languages can be found in Peterson 10, pp. 154-188].
Theorem 2 essentially shows how to construct PFAs that are structurally and behaviorally equivalent to
safe Petri nets given the language to be recognized. A Petri net recognizing the same language can be created
directly from a safe PFA structure by placing a Petri net transition bar on each PFA transition. Similarly,
any safe Petri net is trivially a PFA. This direct structural equivalence with PFAs does not hold, however,
for Petri nets that are bounded and not safe, that is, that have a nite state space but may sometimes
contain two or more net tokens at some node. A PFA does not count the number of times that its nodes are
activated, but simply records each as being \on" or `o.'
For Petri nets that are bounded but not safe, though, a language equivalence with PFAs has already
been proven. This can be seen from the fact that for every bounded Petri net, its previously mentioned
coverability graph is, in fact, an NFA recognizing the same language as the net.
Obviously neither structural nor language equivalence with PFAs holds for general Petri nets since they
admit possibly in nite state spaces.
3.3 Inhibitor arcs
Another interesting property of the PFA is that, unlike classical Petri nets, the addition of inhibitor arcs
does not change the recognition power of the automata. An inhibitor arc is one that allows a transition to
re only if the node that is its source is empty (as opposed to nonempty for a normal arc). For Petri nets,
this addition takes the class of automata into an equivalence with Turing machines. For PFAs, since they
are nite state by construction, no change occurs in their power, but considerable exibility is added as a
modeling notation.
Other Petri net extensions also can be used with PFAs to extend their expressive exibility while retaining
the analyzability of a nite state space. For example, the recently introduced concept of debit arcs 15]
(similar to negative tokens 8]) can be employed to represent systems allowing physical phenomena similar to
economic debt, or deferred actions. Though we have not introduced any notation for such PFA extensions,
the Petri net notation given in the indicated references will work well if the ring rule is altered to the
normalizing one used with PFAs. In fact, Petri net notation in general is a viable alternative for the basic
PFA notation of this paper. As mentioned earlier, we adopted a DFA-like notation for familiarity and to
make plain the fact that a PFA has a nite state space.
9
a
a
b
a b
λ λ λ λ λ
λ λ λ λ λ λ
10
λ λ λ
λ λ
However, the same exponential blowup experienced in coverting NFAs to DFAs can occur in converting
PFAs to DFAs. In fact, for some PFAs, the equivalent minimal DFA suers a doubly exponential blowup in
the size of its state space. This is because the algorithm for creating the DFA may rst, in an exponential
number of steps, actually create an NFA the NFA in turn will require an additional exponential number of
steps to produce the minimal DFA.
The PFA in gure 5 provides an example of double-exponential blowup in converting a PFA to a DFA.
This PFA accepts the string (ajb) a(ajb)31. Deciding whether or not to accept a string of this form requires
keeping track of the last 32 characters, requiring 32 bits of memory with a state space ofk 23 2. More generally,
we can writek
a PFA with O(k) states that accepts strings of the form (ajb) a(ajb)2 and requires a state
space of 2 .
2
For conciseness, the PFA in gure 5 makes use of the forced safety ring rule: any transition with
activated output sites that are not also input sites are unable to re. Figure 6 shows the conversion of the
boxed area of gure 5 into a PFA without the safe ring rule, using the construction previously described.
The PFA in gure 5 works similarly to the NFA for (ajb) a(ajb)n normally used to show exponential
blowup. The bottom part of the PFA encodes a binary counter than must receive either 0 or 32 activations.
We can encode a counter that must receive either 0 or 2k activations in 2k + 2 states using the assumed
ring rule (or 4k+4 without the forced safety ring rule).
11
Structure
Editor (Client)
Read Client
Read/Traverse
Client
Read/Traverse
Client Structure
Display
Collaboration Petri Net (Client)
Wrapper Engine
Traverse Server
Client
Structure
Analysis net Creation
package (Client)
12
Figure 8: Concurrently displayed Neptune images classi ed by features.
13
As the following examples show, Trellis hyperprograms are especially useful expression and simulation of
processes in which human direction is an important aspect of the control ow. An example is the software
development process. Such computations are referred to as being enacted, rather than as being executed, to
distinguish the major role human input and human decisions have in the unfolding of the actions described
in the program. A version of Trellis is currently being developed speci cally for expression and enactment
of software process models, and PFAs are one form of engine being used to structure these models.
Example: image browsing index
Figure 8 shows a screen from an early Trellis prototype implemented for Unix platforms and the SunView
window system. This example is an image browsing index constructed as part of a NASA experiment at
CESDIS (Goddard Space Flight Center, MD). Images of Neptune and Phobos are linked and cross linked in
the net structure according to common characteristics. The net concurrently displays all images that share
some characteristic, as selected by a reader from the browsing interface.
Three interface clients are visible: a graphical editing client on the right, overlapping the windows of a
text browsing client on the left, and a graphics image client on the bottom all three are communicating
via RPC with one Trellis engine. In the text browser are four text windows. When a net place is marked
its content element is displayed in one of these text windows. In this example, the text showing in the top
window of the browser is the content of the place "neptune" which is showing as marked in the graphical
editor window. Each enabled transition is displayed as a selectable button in a menu to the left of the text
window (for example, transitions "rings" and "clouds" in the net, among others). Selection of a button in
a browser menu causes the associated transition to re in the net, changing the net state and thereby the
display as well.
The net editor client on the right presents a graphical view of the underlying model. With it, a user can
build or alter the structure of the net, annotate the net with content element names, and also execute the
net. The graphics client on the bottom is displaying under X Windows on a dierent monitor. It monitors
the execution activity in a hyperprogram and renders graphics images on the X screen whenever a marked
place has a bit-mapped image as its content. At the instant shown, the places "nepColor" and "nep3" are
marked in the net, so two images show.
The graphics client does not allow a user to alter the net structure like the editor client does it does not
even allow a user to re transitions like the text browser does it just sits and listens, acting when necessary
according to its purpose.
Example: Parallel program browsing
The Trellis application illustrated in this section shows both the usefulness of the model for representing
parallel threads of activity, and the usefulness of our hypertextual interpretation of the PT net for supporting
human reasoning through browsing. A CSP program browser 12] is shown in gure 9. This speci c example
uses a CSP program taken from Hoare's original paper 6].
We wrote a translator to parse CSP programs and generate as output the storage format of Trellis
hyperprograms. The translation converted the control structures of CSP statements and the message buers
between CSP processes into PT net structures with the appropriate control behaviors. Each place in the PT
net represents a statement from the source program. We annotated the places with CSP source code each
place is mapped to a copy of the CSP process that contains its statement, with that statement highlighted
(this gives a reader some context for the statement). The top view of gure 9 shows the editor client full-
screen to illustrate the graphical structure of this particular model. The bottom view shows the editor client
with a closeup of the net, with the text browser displaying the CSP code segments that are active at this
point in simulated execution.
The result is a browsing system for simulating the parallel execution of CSP programs. The simulation
proceeds by selecting buttons in the text browser to \execute" statements one at a time. The simulation
proceeds at user speed and at a user's discretion, following a user's train of thought as browsing progresses.
14
Figure 9: Two views of Trellis used for browsing a CSP parallel program.
15
Figure 10: Initial Dining Philosophers screen.
16
Figure 11: Small Trellis structure with programmed browsing behavior.
17
Is it impossible for both the \shuttle" text and the \engines" text to be concurrently visible?
|= AG( ~C_shuttle | ~C_engines ).
The formula is TRUE.
Can both the \allow" access control and the \inhibit" access control ever be in force at the same time?
|= EF(C_inhibit & C_allow).
The formula is FALSE.
Is it possible to select the \orbiter" button twice on some browsing path without selecting the \remove"
button in between?
|= EF(B_orbiter & AX(AB_remove U B_orbiter])).
The formula is FALSE.
This particular Trellis model is very small compared to those encountered in realistic applications. Our
checker has also been tested on larger Trellis documents. For example, the one shown back in gure 9
produced a state machine with over six thousand states. Using a DECstation 5000/25, the performance of
the model checker on formulae like those above is still on the order of a few seconds each.
18
the currently displayed content element is deactivated, and the content elements mapped to the output
nodes are activated, in accordance with token movement. It makes no sense to always require, as with C/E
systems, that a reader cannot follow a link to see, say, a new text block if that text block is already rendered
for viewing. It is more natural to think of the reader following the link ( ring the transition), but nothing
changing in the visible state (i.e., the extra token in the output place is normalized away). Thus, our physical
environment requires PT net semantics free of implicit synchronizations PFA behavior meets this need.
We conclude by noting that, even though PFAs and DFAs are equivalent in language theoretic terms,
the inherently parallel state representation in a PFA makes this automaton class more useful as a modeling
tool. The fact that the DFA automaton class is a direct structural subset of the PFA class makes the PFA a
preferred replacement for the traditional state machine representation in applications involving concurrency.
References
1] A. V. Aho, R. Sethi, and J. D. Ullman. Compilers: Principles, Techniques, and Tools. Addison-Wesley,
1986.
2] H. Alayan and R. W. Newcomb. Binary petri-net relationships. IEEE Transactions on Circuits and
Systems, CAS-34(5):565{568, May 1987.
3] E. Clarke, E. A. Emerson, and S. Sistla. Automatic veri cation of concurrent systems. ACM TOPLAS,
8(2):244{263, April 1986.
4] Richard Furuta and P. David Stotts. Programmable browsing semantics in Trellis. In Hypertext '89
Proceedings, pages 27{42. ACM, New York, November 1989.
5] C. Ghezzi, M. Jazayeri, and D. Mandrioli. Fundamentals of Software Engineering. Prentice Hall, 1991.
6] C. A. R. Hoare. Communicating sequential processes. Communications of the ACM, 21(8):666{677,
1978.
7] J. E. Hopcroft and J. D. Ullman. Introduction to Automata Theory, Languages, and Computation.
Addison-Wesley, 1979.
8] T. Murata and H. Yamaguchi. A petri net model with negative tokens and its application to automated
reasoning. In Proceedings of the 33rd Midwest Symposium on Circuits and Systems, pages 7{10. IEEE,
August 12-15 1990.
9] Tadao Murata. Petri nets: Properties, analysis and applications. Proceedings of the IEEE, 77(4):541{
580, April 1989.
10] James L. Peterson. Petri Net Theory and the Modeling of Systems. Prentice-Hall, Inc., 1981.
11] Wolfgang Reisig. Petri Nets: An Introduction. Springer-Verlag, 1985.
12] P. D. Stotts and R. Furuta. Browsing parallel process networks,. Journal of Parallel and Distributed
Computing, 9(2):224{235, 1990.
13] P. D. Stotts and R. Furuta. Hypertextual concurrent control of a lisp kernel. Journal of Visual Languages
and Computing, 3(2):221{236, June 1992.
14] P. D. Stotts, R. Furuta, and J. C. Ruiz. Hyperdocuments as automata: Trace-based browsing property
veri cation. In Proceedings of the 1992 European Conference on Hypertext (ECHT92: November 30{
December 4, Milan, Italy), pages 272{281. ACM Press, New York, 1992.
15] P. D. Stotts and P. Godfrey. Place/transition nets with debit arcs. Information Processing Letters,
41(1):25{33, January 1992.
19
16] P. David Stotts and Richard Furuta. Petri-net-based hypertext: Document structure with browsing
semantics. ACM Transactions on Information Systems, 7(1):3{29, January 1989.
17] P. David Stotts and Richard Furuta. Temporal hyperprogramming. Journal of Visual Languages and
Computing, 1(3):237{253, 1990.
20